[Mlir-commits] [mlir] [mlirbc] Switch generator to enable write's with failures. (PR #182464)

Jacques Pienaar llvmlistbot at llvm.org
Fri Feb 20 03:27:31 PST 2026


================
@@ -341,10 +341,14 @@ void Generator::emitPrint(StringRef kind, StringRef type,
     }
 
     if (!pred.empty()) {
+      os << "return success();\n";
       os.unindent();
       os << "}\n";
+    } else {
+      os << "return success();\n";
     }
   }
+  os << "return failure();\n";
----------------
jpienaar wrote:

Sure, added a test to show structure. Every match is success yes, previously it was assuming there will always be a match and so the caller returned success unconditionally.

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


More information about the Mlir-commits mailing list