diff options
author | Fangrui Song <i@maskray.me> | 2023-12-19 21:51:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 21:51:26 -0800 |
commit | 207cbbd71009090768c63004b967eddfab0f1d2e (patch) | |
tree | 4de085034aa32ae9534f913c378111cc62caf96b /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | 47413bb2760e63a3302871ea770d6c0f5a742036 (diff) | |
download | llvm-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.cpp | 2 |
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; } |