[Mlir-commits] [mlir] [mlir] implement `-verify-diagnostics=only-expected` (PR #135131)

Jacques Pienaar llvmlistbot at llvm.org
Thu Apr 10 11:00:57 PDT 2025


================
@@ -38,11 +38,20 @@ struct MlirTransformOptCLOptions {
       cl::desc("Allow operations coming from an unregistered dialect"),
       cl::init(false)};
 
-  cl::opt<bool> verifyDiagnostics{
-      "verify-diagnostics",
-      cl::desc("Check that emitted diagnostics match expected-* lines "
-               "on the corresponding line"),
-      cl::init(false)};
+  cl::opt<mlir::SourceMgrDiagnosticVerifierHandler::Level> verifyDiagnostics{
+      "verify-diagnostics", llvm::cl::ValueOptional,
+      cl::desc("Check that emitted diagnostics match "
+               "expected-* lines on the corresponding line"),
+      cl::values(
+          clEnumValN(
+              mlir::SourceMgrDiagnosticVerifierHandler::Level::All, "all",
+              "Check all diagnostics (expected, unexpected, near-misses)"),
+          clEnumValN(
----------------
jpienaar wrote:

Could you add a comment that you are repeating enum all for backward compatibility?

https://github.com/llvm/llvm-project/pull/135131


More information about the Mlir-commits mailing list