[llvm] [opt] Do not exit on first emitError (PR #194858)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 08:52:05 PDT 2026
================
@@ -31,6 +32,15 @@ class TargetMachine;
class ToolOutputFile;
class TargetLibraryInfoImpl;
+/// A custom diagnostic handler for opt that consumes diagnostics so that the
+/// default LLVMContext::diagnose() does not call exit() on the first error.
+/// opt can then drain remaining diagnostics from a single pass run and report
+/// them all, mirroring llc's behavior so that opt remains a faithful test
+/// driver for passes that report errors via LLVMContext::emitError.
+struct OptDiagnosticHandler : public DiagnosticHandler {
----------------
arsenm wrote:
This should probably just be the default handler
https://github.com/llvm/llvm-project/pull/194858
More information about the llvm-commits
mailing list