================ @@ -256,10 +256,13 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { RS->emit(*OptDiagBase); // If there is a report handler, use it. - if (pImpl->DiagHandler && - (!pImpl->RespectDiagnosticFilters || isDiagnosticEnabled(DI)) && - pImpl->DiagHandler->handleDiagnostics(DI)) - return; + if (pImpl->DiagHandler) { + if (DI.getSeverity() == DS_Error) + pImpl->DiagHandler->HasErrors = true; ---------------- MaskRay wrote:
I've considered this choice. Currently, * LLVMContext::diagnose and handleDiagnostics need to cooperate and handle part of the process. * handleDiagnostics is only called by LLVMContext::diagnose. If we call `handleDiagnostics` in more places, it's clear that we need to duplicate some code in `diagnose` to the new call site, at least the `LLVMRemarkStreamer` stuff. Therefore, adding a new method to DiagnosticHandler does not abstract away things, and do not make things less error-prone. https://github.com/llvm/llvm-project/pull/75889 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits