Teach the PCH validator to check the preprocessor options, especially
authorDouglas Gregor <dgregor@apple.com>
Wed, 24 Oct 2012 23:41:50 +0000 (23:41 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 24 Oct 2012 23:41:50 +0000 (23:41 +0000)
commitb63687519610a73dd565be1fec28332211b4df5b
treee6e1ef1c203b216cf54ae696c51adbb78c266330
parent468f1df7533f453dca45df1adc79f4199a6a366b
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
clang/include/clang/Basic/DiagnosticSerializationKinds.td
clang/include/clang/Serialization/ASTReader.h
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/PCH/fuzzy-pch.c
clang/test/PCH/pch-dir.c