diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-29 22:54:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-29 22:54:08 +0000 |
commit | 34870da70fa42b0391b79627ebd0cfc6eb22213b (patch) | |
tree | 1c667792ccbfa38387b2ec0c66610c04666db49e /Parse/Parser.cpp | |
parent | 79859c3ce1040e07ffed8f3a17dff33b739c8f11 (diff) |
cleanup context-sensitive objc keyword recognition. Patch by Fariborz Jahanian.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/Parser.cpp')
-rw-r--r-- | Parse/Parser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp index d034dc26bc..581d585a82 100644 --- a/Parse/Parser.cpp +++ b/Parse/Parser.cpp @@ -247,6 +247,17 @@ void Parser::Initialize() { if (Tok.getKind() == tok::eof && !getLang().CPlusPlus) // Empty source file is an extension in C Diag(Tok, diag::ext_empty_source_file); + + // Initialization for Objective-C context sensitive keywords recognition. + // Referenced in Parser::isObjCTypeQualifier. + if (getLang().ObjC1) { + ObjcTypeQuals[objc_in] = &PP.getIdentifierTable().get("in"); + ObjcTypeQuals[objc_out] = &PP.getIdentifierTable().get("out"); + ObjcTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout"); + ObjcTypeQuals[objc_oneway] = &PP.getIdentifierTable().get("oneway"); + ObjcTypeQuals[objc_bycopy] = &PP.getIdentifierTable().get("bycopy"); + ObjcTypeQuals[objc_byref] = &PP.getIdentifierTable().get("byref"); + } } /// ParseTopLevelDecl - Parse one top-level declaration, return whatever the |