aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PreprocessingRecord.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-08 17:18:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-08 17:18:41 +0000
commit8f7c540ac42370c40ebcdc4b69018c938faf94ec (patch)
treeaad315d5d8733b9cd0711bb671a8192436509530 /lib/Lex/PreprocessingRecord.cpp
parent5471bc85b69912e3b448de004498a80c0de32296 (diff)
[libclang] Fix annotation and getting a "macro expansion" cursor
for a builtin macro expansion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PreprocessingRecord.cpp')
-rw-r--r--lib/Lex/PreprocessingRecord.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp
index 6303c3d629..d02db25ae3 100644
--- a/lib/Lex/PreprocessingRecord.cpp
+++ b/lib/Lex/PreprocessingRecord.cpp
@@ -14,7 +14,6 @@
#include "clang/Lex/PreprocessingRecord.h"
#include "clang/Lex/MacroInfo.h"
#include "clang/Lex/Token.h"
-#include "clang/Basic/IdentifierTable.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Capacity.h"
@@ -113,10 +112,12 @@ void PreprocessingRecord::MacroExpands(const Token &Id, const MacroInfo* MI,
if (!IncludeNestedMacroExpansions && Id.getLocation().isMacroID())
return;
- if (MacroDefinition *Def = findMacroDefinition(MI))
+ if (MI->isBuiltinMacro())
PreprocessedEntities.push_back(
- new (*this) MacroExpansion(Id.getIdentifierInfo(),
- Range, Def));
+ new (*this) MacroExpansion(Id.getIdentifierInfo(),Range));
+ else if (MacroDefinition *Def = findMacroDefinition(MI))
+ PreprocessedEntities.push_back(
+ new (*this) MacroExpansion(Def, Range));
}
void PreprocessingRecord::MacroDefined(const Token &Id,