diff options
Diffstat (limited to 'clang/lib/Interpreter')
-rw-r--r-- | clang/lib/Interpreter/IncrementalAction.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Interpreter/IncrementalParser.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Interpreter/Interpreter.cpp | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Interpreter/IncrementalAction.cpp b/clang/lib/Interpreter/IncrementalAction.cpp index 4d1bc4c..3d489fc 100644 --- a/clang/lib/Interpreter/IncrementalAction.cpp +++ b/clang/lib/Interpreter/IncrementalAction.cpp @@ -106,7 +106,8 @@ std::unique_ptr<llvm::Module> IncrementalAction::GenModule() { // around we created an empty module to make CodeGen happy. We should make // sure it always stays empty. assert(((!CachedInCodeGenModule || - !CI.getPreprocessorOpts().Includes.empty()) || + !CI.getPreprocessorOpts().Includes.empty() || + !CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) || (CachedInCodeGenModule->empty() && CachedInCodeGenModule->global_empty() && CachedInCodeGenModule->alias_empty() && diff --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp index 32d1663..bf08911 100644 --- a/clang/lib/Interpreter/IncrementalParser.cpp +++ b/clang/lib/Interpreter/IncrementalParser.cpp @@ -37,6 +37,10 @@ IncrementalParser::IncrementalParser(CompilerInstance &Instance, llvm::ErrorAsOutParameter EAO(&Err); Consumer = &S.getASTConsumer(); P.reset(new Parser(S.getPreprocessor(), S, /*SkipBodies=*/false)); + + if (ExternalASTSource *External = S.getASTContext().getExternalSource()) + External->StartTranslationUnit(Consumer); + P->Initialize(); } diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp index 9cc1c45..b05cb5a 100644 --- a/clang/lib/Interpreter/Interpreter.cpp +++ b/clang/lib/Interpreter/Interpreter.cpp @@ -278,9 +278,10 @@ Interpreter::Interpreter(std::unique_ptr<CompilerInstance> Instance, if (Act->getCodeGen()) { Act->CacheCodeGenModule(); - // The initial PTU is filled by `-include` or by CUDA includes - // automatically. - if (!CI->getPreprocessorOpts().Includes.empty()) { + // The initial PTU is filled by `-include`/`-include-pch` or by CUDA + // includes automatically. + if (!CI->getPreprocessorOpts().Includes.empty() || + !CI->getPreprocessorOpts().ImplicitPCHInclude.empty()) { // We can't really directly pass the CachedInCodeGenModule to the Jit // because it will steal it, causing dangling references as explained in // Interpreter::Execute |