diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ChainedIncludesSource.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index dbb06bd23c..5f7ff74bc6 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -108,6 +108,8 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { OwningPtr<ASTConsumer> consumer; consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", 0, /*isysroot=*/"", &OS)); + Clang->getPreprocessor().setPPMutationListener( + consumer->GetPPMutationListener()); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); Clang->setASTConsumer(consumer.take()); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index bf46e549b5..24f38d428b 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -946,6 +946,8 @@ Module *CompilerInstance::loadModule(SourceLocation ImportLoc, getASTConsumer().GetASTDeserializationListener()); getASTContext().setASTMutationListener( getASTConsumer().GetASTMutationListener()); + getPreprocessor().setPPMutationListener( + getASTConsumer().GetPPMutationListener()); } OwningPtr<ExternalASTSource> Source; Source.reset(ModuleManager); diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index a4321e720e..ca8511247a 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -247,7 +247,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, goto failure; CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener()); - + CI.getPreprocessor().setPPMutationListener( + Consumer->GetPPMutationListener()); + if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) { // Convert headers to PCH and chain them. OwningPtr<ExternalASTSource> source; |