diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-05-05 00:55:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-05-05 00:55:20 +0000 |
commit | aa8a66de0e7951ba5a305f3e5a39c9b14a318c42 (patch) | |
tree | 16691857554d3b66a07c1b55961b4fc8939c51b1 | |
parent | 11949cbae3f42c32a2933fb85b125620666d98ea (diff) |
Map Objective-C keywords to CXToken_Keyword.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103063 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/libclang/CIndex.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 23be3dfcb2..0c0dbbabc2 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -2286,9 +2286,15 @@ void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, const char *StartPos = Buf.data() + LocInfo.second; IdentifierInfo *II = CXXUnit->getPreprocessor().LookUpIdentifierInfo(Tok, StartPos); - CXTok.int_data[0] = II->getTokenID() == tok::identifier? - CXToken_Identifier - : CXToken_Keyword; + + if (II->getObjCKeywordID() != tok::objc_not_keyword) { + CXTok.int_data[0] = CXToken_Keyword; + } + else { + CXTok.int_data[0] = II->getTokenID() == tok::identifier? + CXToken_Identifier + : CXToken_Keyword; + } CXTok.ptr_data = II; } else if (Tok.is(tok::comment)) { CXTok.int_data[0] = CXToken_Comment; |