diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 956877d..7c2b2bf 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1144,7 +1144,10 @@ compileModuleImpl(CompilerInstance &ImportingInstance, SourceLocation ImportLoc, // module generation thread crashed. Instance.clearOutputFiles(/*EraseFiles=*/true); - return !Instance.getDiagnostics().hasErrorOccurred(); + // If \p AllowPCMWithCompilerErrors is set return 'success' even if errors + // occurred. + return !Instance.getDiagnostics().hasErrorOccurred() || + Instance.getFrontendOpts().AllowPCMWithCompilerErrors; } static const FileEntry *getPublicModuleMap(const FileEntry *File, @@ -1697,7 +1700,8 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( // Try to load the module file. If we are not trying to load from the // module cache, we don't know how to rebuild modules. unsigned ARRFlags = Source == MS_ModuleCache - ? ASTReader::ARR_OutOfDate | ASTReader::ARR_Missing + ? ASTReader::ARR_OutOfDate | ASTReader::ARR_Missing | + ASTReader::ARR_TreatModuleWithErrorsAsOutOfDate : Source == MS_PrebuiltModulePath ? 0 : ASTReader::ARR_ConfigurationMismatch; |