aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-12-19 21:51:26 -0800
committerGitHub <noreply@github.com>2023-12-19 21:51:26 -0800
commit207cbbd71009090768c63004b967eddfab0f1d2e (patch)
tree4de085034aa32ae9534f913c378111cc62caf96b /clang/lib/CodeGen/CodeGenAction.cpp
parent47413bb2760e63a3302871ea770d6c0f5a742036 (diff)
downloadllvm-207cbbd71009090768c63004b967eddfab0f1d2e.zip
llvm-207cbbd71009090768c63004b967eddfab0f1d2e.tar.gz
llvm-207cbbd71009090768c63004b967eddfab0f1d2e.tar.bz2
DiagnosticHandler: refactor error checking (#75889)
In LLVMContext::diagnose, set `HasErrors` for `DS_Error` so that all derived `DiagnosticHandler` have correct `HasErrors` information. An alternative is to set `HasErrors` in `DiagnosticHandler::handleDiagnostics`, but all derived `handleDiagnostics` would have to call the base function.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 4121a37..753a8fd 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -418,8 +418,6 @@ void BackendConsumer::anchor() { }
} // namespace clang
bool ClangDiagnosticHandler::handleDiagnostics(const DiagnosticInfo &DI) {
- if (DI.getSeverity() == DS_Error)
- HasErrors = true;
BackendCon->DiagnosticHandlerImpl(DI);
return true;
}