[Mlir-commits] [mlir] MLIR Rewriters: add new listener to emit match failures to user, enhance docs (PR #94130)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Jun 3 00:50:32 PDT 2024


================
@@ -511,6 +512,50 @@ class RewriterBase : public OpBuilder {
     OpBuilder::Listener *listener;
   };
 
+  /// A listener that emits all notifyMatchFailure calls
+  /// with the given DiagnosticSeverity (default is Error).
+  /// This can be used so that any notifyMatchFailure calls will be emitted
+  /// as a message with the given severity (Remark will be used for Note)
+  struct MatchFailureEmittingListener : public RewriterBase::Listener {
----------------
ftynse wrote:

Some flows, especially downstreams built entirely around patterns, increasingly use "notifyMatchFailure" as a generic silenceable error-reporting mechanism. It's a creative misuse of the infra, but they've got nothing else.

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


More information about the Mlir-commits mailing list