summaryrefslogtreecommitdiffstats
path: root/clang/tools
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2010-10-13 21:44:48 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2010-10-13 21:44:48 +0000
commit1822d1f0a810e28b4321c07f05b2a7f14711130b (patch)
tree8a2d1fda6d3d3175f6f09f1f41b151572b53b155 /clang/tools
parentef83e21b5743876e128c34792bffbbe1fd9b0bc5 (diff)
downloadbcm5719-llvm-1822d1f0a810e28b4321c07f05b2a7f14711130b.tar.gz
bcm5719-llvm-1822d1f0a810e28b4321c07f05b2a7f14711130b.zip
Don't claim that things that are Objective-C keywords if preceded by an @ are keywords unless they are preceded by an @.
For example, don't claim that end is a keyword in: unsigned end; llvm-svn: 116439
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/libclang/CIndex.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index a5b342dbe75..1d7efe42082 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3533,6 +3533,7 @@ void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range,
const char *EffectiveBufferEnd = Buffer.data() + EndLocInfo.second;
llvm::SmallVector<CXToken, 32> CXTokens;
Token Tok;
+ bool previousWasAt = false;
do {
// Lex the next token
Lex.LexFromRawLexer(Tok);
@@ -3565,7 +3566,7 @@ void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range,
IdentifierInfo *II
= CXXUnit->getPreprocessor().LookUpIdentifierInfo(Tok, StartPos);
- if (II->getObjCKeywordID() != tok::objc_not_keyword) {
+ if ((II->getObjCKeywordID() != tok::objc_not_keyword) && previousWasAt) {
CXTok.int_data[0] = CXToken_Keyword;
}
else {
@@ -3582,6 +3583,7 @@ void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range,
CXTok.ptr_data = 0;
}
CXTokens.push_back(CXTok);
+ previousWasAt = Tok.is(tok::at);
} while (Lex.getBufferLocation() <= EffectiveBufferEnd);
if (CXTokens.empty())
OpenPOWER on IntegriCloud