diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Frontend/ChainedIncludesSource.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 635d566159b..e0bf1c51c85 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -2509,7 +2509,8 @@ static bool serializeUnit(ASTWriter &Writer, } bool ASTUnit::serialize(raw_ostream &OS) { - bool hasErrors = getDiagnostics().hasErrorOccurred(); + // For serialization we are lenient if the errors were only warn-as-error kind. + bool hasErrors = getDiagnostics().hasUncompilableErrorOccurred(); if (WriterData) return serializeUnit(WriterData->Writer, WriterData->Buffer, diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp index 1c1081fbe08..51771bfb549 100644 --- a/clang/lib/Frontend/ChainedIncludesSource.cpp +++ b/clang/lib/Frontend/ChainedIncludesSource.cpp @@ -164,7 +164,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource( ArrayRef<llvm::IntrusiveRefCntPtr<ModuleFileExtension>> Extensions; auto consumer = llvm::make_unique<PCHGenerator>( Clang->getPreprocessor(), "-", nullptr, /*isysroot=*/"", Buffer, - Extensions); + Extensions, /*AllowASTWithErrors=*/true); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); Clang->setASTConsumer(std::move(consumer)); |