aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/GeneratePCH.cpp
diff options
context:
space:
mode:
authorRajkumar Ananthu <rajkumar.ananthu108@gmail.com>2023-10-06 00:21:57 +0530
committerGitHub <noreply@github.com>2023-10-05 14:51:57 -0400
commita50e63b38b931d945f97eac882278068221eca17 (patch)
tree78e2009d928e52eb339fcf0043623d91d00f7c33 /clang/lib/Serialization/GeneratePCH.cpp
parentf320065aeb379d8f9d2780a687768742f8b18eb2 (diff)
downloadllvm-a50e63b38b931d945f97eac882278068221eca17.zip
llvm-a50e63b38b931d945f97eac882278068221eca17.tar.gz
llvm-a50e63b38b931d945f97eac882278068221eca17.tar.bz2
Fixes and closes #53952. Setting the ASTHasCompilerErrors member variable correctly based on the PP diagnostics. (#68127)
The issue #53952 is reported indicating clang is giving a crashing pch file, when hasErrors is been passed incorrectly to WriteAST method. To fix the issue, the parameter has been removed and instead we're relying on the results of `hasUncompilableErrorOccured()` instead of letting the caller override it. Fixes https://github.com/llvm/llvm-project/issues/53952
Diffstat (limited to 'clang/lib/Serialization/GeneratePCH.cpp')
-rw-r--r--clang/lib/Serialization/GeneratePCH.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp
index 601a24b4..cf80843 100644
--- a/clang/lib/Serialization/GeneratePCH.cpp
+++ b/clang/lib/Serialization/GeneratePCH.cpp
@@ -65,12 +65,8 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {
// Emit the PCH file to the Buffer.
assert(SemaPtr && "No Sema?");
- Buffer->Signature =
- Writer.WriteAST(*SemaPtr, OutputFile, Module, isysroot,
- // For serialization we are lenient if the errors were
- // only warn-as-error kind.
- PP.getDiagnostics().hasUncompilableErrorOccurred(),
- ShouldCacheASTInMemory);
+ Buffer->Signature = Writer.WriteAST(*SemaPtr, OutputFile, Module, isysroot,
+ ShouldCacheASTInMemory);
Buffer->IsComplete = true;
}