diff options
author | Ben Barham <ben_barham@apple.com> | 2020-11-17 17:25:50 -0800 |
---|---|---|
committer | Argyrios Kyrtzidis <kyrtzidis@apple.com> | 2020-11-17 17:27:50 -0800 |
commit | 5834996fefc937d6211dc8c8a5b200068753391a (patch) | |
tree | 13cb5ce724739d084d3a0a401ed55c84dc07afc7 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | f4c6080ab820219c5bf78b0c2143e7fa194da296 (diff) | |
download | llvm-5834996fefc937d6211dc8c8a5b200068753391a.zip llvm-5834996fefc937d6211dc8c8a5b200068753391a.tar.gz llvm-5834996fefc937d6211dc8c8a5b200068753391a.tar.bz2 |
[Frontend] Add flag to allow PCM generation despite compiler errors
As with precompiled headers, it's useful for indexers to be able to
continue through compiler errors in dependent modules.
Resolves rdar://69816264
Reviewed By: akyrtzi
Differential Revision: https://reviews.llvm.org/D91580
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index f4b00df..5c82878 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1523,7 +1523,9 @@ void CompilerInstance::createASTReader() { HeaderSearchOptions &HSOpts = getHeaderSearchOpts(); std::string Sysroot = HSOpts.Sysroot; const PreprocessorOptions &PPOpts = getPreprocessorOpts(); + const FrontendOptions &FEOpts = getFrontendOpts(); std::unique_ptr<llvm::Timer> ReadTimer; + if (FrontendTimerGroup) ReadTimer = std::make_unique<llvm::Timer>("reading_modules", "Reading modules", @@ -1532,7 +1534,7 @@ void CompilerInstance::createASTReader() { getPreprocessor(), getModuleCache(), &getASTContext(), getPCHContainerReader(), getFrontendOpts().ModuleFileExtensions, Sysroot.empty() ? "" : Sysroot.c_str(), PPOpts.DisablePCHValidation, - /*AllowASTWithCompilerErrors=*/false, + /*AllowASTWithCompilerErrors=*/FEOpts.AllowPCMWithCompilerErrors, /*AllowConfigurationMismatch=*/false, HSOpts.ModulesValidateSystemHeaders, HSOpts.ValidateASTInputFilesContent, getFrontendOpts().UseGlobalModuleIndex, std::move(ReadTimer)); |