[cfe-commits] r44923 - in /cfe/trunk/Parse: ParseDecl.cpp ParseObjc.cpp

Chris Lattner sabre at nondot.org
Tue Dec 11 22:56:33 PST 2007


Author: lattner
Date: Wed Dec 12 00:56:32 2007
New Revision: 44923

URL: http://llvm.org/viewvc/llvm-project?rev=44923&view=rev
Log:
move function to a more logical location, add its grammar productions.

Modified:
    cfe/trunk/Parse/ParseDecl.cpp
    cfe/trunk/Parse/ParseObjc.cpp

Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=44923&r1=44922&r2=44923&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Wed Dec 12 00:56:32 2007
@@ -552,40 +552,6 @@
   }
 }
 
-/// ParseObjcTypeQualifierList - This routine parses the objective-c's type
-/// qualifier list and builds their bitmask representation in the input
-/// argument.
-void Parser::ParseObjcTypeQualifierList(ObjcDeclSpec &DS) {
-  while (1) {
-    if (!Tok.is(tok::identifier))
-      return;
-    
-    const IdentifierInfo *II = Tok.getIdentifierInfo();
-    for (unsigned i = 0; i != objc_NumQuals; ++i) {
-      if (II != ObjcTypeQuals[i])
-        continue;
-      
-      ObjcDeclSpec::ObjcDeclQualifier Qual;
-      switch (i) {
-      default: assert(0 && "Unknown decl qualifier");
-      case objc_in:     Qual = ObjcDeclSpec::DQ_In; break;
-      case objc_out:    Qual = ObjcDeclSpec::DQ_Out; break;
-      case objc_inout:  Qual = ObjcDeclSpec::DQ_Inout; break;
-      case objc_oneway: Qual = ObjcDeclSpec::DQ_Oneway; break;
-      case objc_bycopy: Qual = ObjcDeclSpec::DQ_Bycopy; break;
-      case objc_byref:  Qual = ObjcDeclSpec::DQ_Byref; break;
-      }
-      DS.setObjcDeclQualifier(Qual);
-      ConsumeToken();
-      II = 0;
-      break;
-    }
-    
-    // If this wasn't a recognized qualifier, bail out.
-    if (II) return;
-  }
-}
-
 /// ParseTag - Parse "struct-or-union-or-class-or-enum identifier[opt]", where
 /// the first token has already been read and has been turned into an instance
 /// of DeclSpec::TST (TagType).  This returns true if there is an error parsing,

Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=44923&r1=44922&r2=44923&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Wed Dec 12 00:56:32 2007
@@ -491,14 +491,49 @@
   return false;
 } 
 
-///   objc-type-name:
-///     '(' objc-type-qualifiers[opt] type-name ')'
-///     '(' objc-type-qualifiers[opt] ')'
+/// ParseObjcTypeQualifierList - This routine parses the objective-c's type
+/// qualifier list and builds their bitmask representation in the input
+/// argument.
 ///
 ///   objc-type-qualifiers:
 ///     objc-type-qualifier
 ///     objc-type-qualifiers objc-type-qualifier
 ///
+void Parser::ParseObjcTypeQualifierList(ObjcDeclSpec &DS) {
+  while (1) {
+    if (!Tok.is(tok::identifier))
+      return;
+    
+    const IdentifierInfo *II = Tok.getIdentifierInfo();
+    for (unsigned i = 0; i != objc_NumQuals; ++i) {
+      if (II != ObjcTypeQuals[i])
+        continue;
+      
+      ObjcDeclSpec::ObjcDeclQualifier Qual;
+      switch (i) {
+      default: assert(0 && "Unknown decl qualifier");
+      case objc_in:     Qual = ObjcDeclSpec::DQ_In; break;
+      case objc_out:    Qual = ObjcDeclSpec::DQ_Out; break;
+      case objc_inout:  Qual = ObjcDeclSpec::DQ_Inout; break;
+      case objc_oneway: Qual = ObjcDeclSpec::DQ_Oneway; break;
+      case objc_bycopy: Qual = ObjcDeclSpec::DQ_Bycopy; break;
+      case objc_byref:  Qual = ObjcDeclSpec::DQ_Byref; break;
+      }
+      DS.setObjcDeclQualifier(Qual);
+      ConsumeToken();
+      II = 0;
+      break;
+    }
+    
+    // If this wasn't a recognized qualifier, bail out.
+    if (II) return;
+  }
+}
+
+///   objc-type-name:
+///     '(' objc-type-qualifiers[opt] type-name ')'
+///     '(' objc-type-qualifiers[opt] ')'
+///
 Parser::TypeTy *Parser::ParseObjCTypeName(ObjcDeclSpec &DS) {
   assert(Tok.is(tok::l_paren) && "expected (");
   





More information about the cfe-commits mailing list