]> granicus.if.org Git - clang/commitdiff
we already have a handle on the 'in' keyword, don't bother getting two.
authorChris Lattner <sabre@nondot.org>
Sat, 23 Aug 2008 02:02:23 +0000 (02:02 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 23 Aug 2008 02:02:23 +0000 (02:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55217 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Parser.h
lib/Parse/ParseObjc.cpp
lib/Parse/Parser.cpp

index c95e3f1f0b742e7057ab9e6743b0b4aebf883116..f74960425add921b589d0d96dba36186395df801 100644 (file)
@@ -354,7 +354,6 @@ private:
   IdentifierInfo *ObjCPropertyAttrs[objc_NumAttrs];
   bool isObjCPropertyAttribute();
   
-  IdentifierInfo *ObjCForCollectionInKW;
   bool isTokIdentifier_in() const;
 
   TypeTy *ParseObjCTypeName(ObjCDeclSpec &DS);
index 31e62d343454ecd1a7f4a39b55146e24d5708db3..7ef3282a3224a796fcfac3b015df7dcea671a08a 100644 (file)
@@ -31,26 +31,26 @@ Parser::DeclTy *Parser::ParseObjCAtDirectives() {
   SourceLocation AtLoc = ConsumeToken(); // the "@"
   
   switch (Tok.getObjCKeywordID()) {
-    case tok::objc_class:
-      return ParseObjCAtClassDeclaration(AtLoc);
-    case tok::objc_interface:
-      return ParseObjCAtInterfaceDeclaration(AtLoc);
-    case tok::objc_protocol:
-      return ParseObjCAtProtocolDeclaration(AtLoc);
-    case tok::objc_implementation:
-      return ParseObjCAtImplementationDeclaration(AtLoc);
-    case tok::objc_end:
-      return ParseObjCAtEndDeclaration(AtLoc);
-    case tok::objc_compatibility_alias:
-      return ParseObjCAtAliasDeclaration(AtLoc);
-    case tok::objc_synthesize:
-      return ParseObjCPropertySynthesize(AtLoc);
-    case tok::objc_dynamic:
-      return ParseObjCPropertyDynamic(AtLoc);
-    default:
-      Diag(AtLoc, diag::err_unexpected_at);
-      SkipUntil(tok::semi);
-      return 0;
+  case tok::objc_class:
+    return ParseObjCAtClassDeclaration(AtLoc);
+  case tok::objc_interface:
+    return ParseObjCAtInterfaceDeclaration(AtLoc);
+  case tok::objc_protocol:
+    return ParseObjCAtProtocolDeclaration(AtLoc);
+  case tok::objc_implementation:
+    return ParseObjCAtImplementationDeclaration(AtLoc);
+  case tok::objc_end:
+    return ParseObjCAtEndDeclaration(AtLoc);
+  case tok::objc_compatibility_alias:
+    return ParseObjCAtAliasDeclaration(AtLoc);
+  case tok::objc_synthesize:
+    return ParseObjCPropertySynthesize(AtLoc);
+  case tok::objc_dynamic:
+    return ParseObjCPropertyDynamic(AtLoc);
+  default:
+    Diag(AtLoc, diag::err_unexpected_at);
+    SkipUntil(tok::semi);
+    return 0;
   }
 }
 
@@ -511,7 +511,7 @@ bool Parser::isTokIdentifier_in() const {
   // valid tokens following an 'in'; such as an identifier, unary operators,
   // '[' etc.
   return (getLang().ObjC2 && Tok.is(tok::identifier) && 
-          Tok.getIdentifierInfo() == ObjCForCollectionInKW);
+          Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]);
 }
 
 /// ParseObjCTypeQualifierList - This routine parses the objective-c's type
index 330c22d1f47196463c84b117a953e9564f33d4a2..ccdf264bd85ead0ec54dab857c30a860a577ad15 100644 (file)
@@ -265,7 +265,6 @@ void Parser::Initialize() {
     ObjCPropertyAttrs[objc_copy] = &PP.getIdentifierTable().get("copy");
     ObjCPropertyAttrs[objc_nonatomic] =
                                   &PP.getIdentifierTable().get("nonatomic");
-    ObjCForCollectionInKW = &PP.getIdentifierTable().get("in");
   }
 
   Ident_super = &PP.getIdentifierTable().get("super");