[Mlir-commits] [mlir] [tblgen] Use `emitError` for inferResultTypes failures (PR #165488)

Stef Lindall llvmlistbot at llvm.org
Wed Oct 29 22:05:24 PDT 2025


================
@@ -2681,7 +2681,7 @@ void OpEmitter::genSeparateArgParamBuilder() {
                       {1}.regions, inferredReturnTypes)))
           {1}.addTypes(inferredReturnTypes);
         else
-          ::mlir::detail::reportFatalInferReturnTypesError({1});
+          ::mlir::detail::emitInferReturnTypesError({1});
----------------
bethebunny wrote:

Correct, I'm following the same pattern used in `<Type>::getChecked` and `<Type>::parse` for instance, which afaict expect you to check whether a diagnostic was emitted to signal an error state. I don't think this is a great pattern necessarily, we can do something else, but it's the pattern that seems to (1) have prior use in the codebase and (2) appears to locally best fit the needs.

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


More information about the Mlir-commits mailing list