From 5ffb14b7e88e587cd2f78dcc3a966a64108920f0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 23 Aug 2008 02:02:23 +0000 Subject: [PATCH] we already have a handle on the 'in' keyword, don't bother getting two. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55217 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Parse/Parser.h | 1 - lib/Parse/ParseObjc.cpp | 42 ++++++++++++++++++------------------ lib/Parse/Parser.cpp | 1 - 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index c95e3f1f0b..f74960425a 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -354,7 +354,6 @@ private: IdentifierInfo *ObjCPropertyAttrs[objc_NumAttrs]; bool isObjCPropertyAttribute(); - IdentifierInfo *ObjCForCollectionInKW; bool isTokIdentifier_in() const; TypeTy *ParseObjCTypeName(ObjCDeclSpec &DS); diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 31e62d3434..7ef3282a32 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -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 diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 330c22d1f4..ccdf264bd8 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -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"); -- 2.40.0