summaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/GeneratePCH.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/GeneratePCH.cpp')
-rw-r--r--clang/lib/Serialization/GeneratePCH.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp
index 002233e49bb0..d869796b82c1 100644
--- a/clang/lib/Serialization/GeneratePCH.cpp
+++ b/clang/lib/Serialization/GeneratePCH.cpp
@@ -57,6 +57,11 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {
}
}
+ // Errors that do not prevent the PCH from being written should not cause the
+ // overall compilation to fail either.
+ if (AllowASTWithErrors)
+ PP.getDiagnostics().getClient()->clear();
+
// Emit the PCH file to the Buffer.
assert(SemaPtr && "No Sema?");
Buffer->Signature =