summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PreprocessingRecord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/PreprocessingRecord.cpp')
-rw-r--r--clang/lib/Lex/PreprocessingRecord.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Lex/PreprocessingRecord.cpp b/clang/lib/Lex/PreprocessingRecord.cpp
index fe081b69bbb..3e0a03b74f8 100644
--- a/clang/lib/Lex/PreprocessingRecord.cpp
+++ b/clang/lib/Lex/PreprocessingRecord.cpp
@@ -26,12 +26,14 @@ void PopulatePreprocessingRecord::MacroExpands(const Token &Id,
Record.addPreprocessedEntity(
new (Record) MacroInstantiation(Id.getIdentifierInfo(),
Id.getLocation(),
- MI->getDefinitionLoc()));
+ MacroDefinitions[MI]));
}
void PopulatePreprocessingRecord::MacroDefined(const IdentifierInfo *II,
const MacroInfo *MI) {
SourceRange R(MI->getDefinitionLoc(), MI->getDefinitionEndLoc());
- Record.addPreprocessedEntity(
- new (Record) MacroDefinition(II, MI->getDefinitionLoc(), R));
+ MacroDefinition *Def
+ = new (Record) MacroDefinition(II, MI->getDefinitionLoc(), R);
+ MacroDefinitions[MI] = Def;
+ Record.addPreprocessedEntity(Def);
}
OpenPOWER on IntegriCloud