More infrastructure to recognize objective-c's type qualifiers (in,inout, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43580 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index ea48704..579c48c 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -451,18 +451,6 @@
   }
 }
 
-///   objc-type-qualifier: one of
-///     in out inout bycopy byref oneway
-///
-bool Parser::isObjCTypeQualifier() {
-  if (Tok.is(tok::identifier)) {
-    const IdentifierInfo *II = Tok.getIdentifierInfo();
-    for (unsigned i = 0; i < objc_NumQuals; ++i)
-      if (II == ObjcTypeQuals[i]) return true;
-  }
-  return false;
-}
-
 ///  property-attrlist: one of
 ///    readonly getter setter assign retain copy nonatomic
 ///
@@ -489,8 +477,9 @@
   SourceLocation LParenLoc = ConsumeParen(), RParenLoc;
   TypeTy *Ty = 0;
   
-  while (isObjCTypeQualifier())
-    ConsumeToken();
+  // Parse type qualifiers, in, inout, etc.
+  ObjcDeclSpec DS;
+  ParseObjcTypeQualifierList(DS);
 
   if (isTypeSpecifierQualifier()) {
     Ty = ParseTypeName();