summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-24 23:41:50 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-24 23:41:50 +0000
commitb63687519610a73dd565be1fec28332211b4df5b (patch)
treee6e1ef1c203b216cf54ae696c51adbb78c266330 /clang/lib/Frontend/FrontendAction.cpp
parent468f1df7533f453dca45df1adc79f4199a6a366b (diff)
downloadbcm5719-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/Frontend/FrontendAction.cpp')
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index b7b93a9178d..fa1655db790 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -243,7 +243,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
// Check whether this is an acceptable AST file.
if (ASTReader::isAcceptableASTFile(Dir->path(), FileMgr,
CI.getLangOpts(),
- CI.getTargetOpts())) {
+ CI.getTargetOpts(),
+ CI.getPreprocessorOpts())) {
for (unsigned I = 0, N = PPOpts.Includes.size(); I != N; ++I) {
if (PPOpts.Includes[I] == PPOpts.ImplicitPCHInclude) {
PPOpts.Includes[I] = Dir->path();
OpenPOWER on IntegriCloud