diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-24 23:41:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-24 23:41:50 +0000 |
commit | b63687519610a73dd565be1fec28332211b4df5b (patch) | |
tree | e6e1ef1c203b216cf54ae696c51adbb78c266330 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 468f1df7533f453dca45df1adc79f4199a6a366b (diff) | |
download | bcm5719-llvm-b63687519610a73dd565be1fec28332211b4df5b.tar.gz bcm5719-llvm-b63687519610a73dd565be1fec28332211b4df5b.zip |
Teach the PCH validator to check the preprocessor options, especially
the macros that are #define'd or #undef'd on the command line. This
checking happens much earlier than the current macro-definition
checking and is far cleaner, because it does a direct comparison
rather than a diff of the predefines buffers. Moreover, it allows us
to use the result of this check to skip over PCH files within a
directory that have non-matching -D's or -U's on the command
line. Finally, it improves the diagnostics a bit for mismatches,
fixing <rdar://problem/8612222>.
The old predefines-buffer diff'ing will go away in a subsequent commit.
llvm-svn: 166641
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 50e6763308c..ea100864e3f 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -1153,6 +1153,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, for (unsigned I = 0, N = PPOpts.MacroIncludes.size(); I != N; ++I) AddString(PPOpts.MacroIncludes[I], Record); + Record.push_back(PPOpts.UsePredefines); AddString(PPOpts.ImplicitPCHInclude, Record); AddString(PPOpts.ImplicitPTHInclude, Record); Record.push_back(static_cast<unsigned>(PPOpts.ObjCXXARCStandardLibrary)); |