summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-09 16:01:50 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-09 16:01:50 +0000
commit8cb174654fa508a759e11fda7b2ca8c15efe9cae (patch)
tree1ba673ed54f793b8fd441868733515bd4cbd4002 /clang/lib/Serialization/ASTWriter.cpp
parent97e5949068f77dbc0569c9bc9813d789ed4b299b (diff)
downloadbcm5719-llvm-8cb174654fa508a759e11fda7b2ca8c15efe9cae.tar.gz
bcm5719-llvm-8cb174654fa508a759e11fda7b2ca8c15efe9cae.zip
If a macro has been #undef'd in a precompiled header, we still need to
write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. llvm-svn: 165502
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index b8a0c28938f..19a236fde2f 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1698,14 +1698,13 @@ void ASTWriter::WritePreprocessor(const Preprocessor &PP, bool IsModule) {
IdentifierInfo *Name
= const_cast<IdentifierInfo *>(DeserializedMacroNames[I]);
if (Name->hadMacroDefinition() && MacroDefinitionsSeen.insert(Name))
- MacrosToEmit.push_back(std::make_pair(Name, PP.getMacroInfo(Name)));
+ MacrosToEmit.push_back(std::make_pair(Name,
+ PP.getMacroInfoHistory(Name)));
}
for (unsigned I = 0, N = MacrosToEmit.size(); I != N; ++I) {
const IdentifierInfo *Name = MacrosToEmit[I].first;
MacroInfo *MI = MacrosToEmit[I].second;
- if (!MI)
- continue;
// History of macro definitions for this identifier in chronological order.
SmallVector<MacroInfo*, 8> MacroHistory;
OpenPOWER on IntegriCloud