aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-01 21:46:47 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-01 21:46:47 +0000
commitbec1c9d6f3feeec112cc8eeae90c1be29c6aaf13 (patch)
tree10e0dc8f6a9429ba3fae034786e5a4302d4e3b79 /lib/Lex/Lexer.cpp
parentec0bf0500c4fd737975a40b781983ee0c4c0eb09 (diff)
Objective-C keywords are not always identifiers. Some are also C++ keywords
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index d72c319d97..f85cfd9f0f 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -41,8 +41,9 @@ static void InitCharacterInfo();
/// isObjCAtKeyword - Return true if we have an ObjC keyword identifier.
bool Token::isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const {
- return is(tok::identifier) &&
- getIdentifierInfo()->getObjCKeywordID() == objcKey;
+ if (IdentifierInfo *II = getIdentifierInfo())
+ return II->getObjCKeywordID() == objcKey;
+ return false;
}
/// getObjCKeywordID - Return the ObjC keyword kind.