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

Mehdi Amini llvmlistbot at llvm.org
Tue Nov 11 05:58:53 PST 2025


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

What method are you trying to actually bind? 

Seems like "build" method could be updated to return a LogicalResult maybe?
 Right now they look like: `void FOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a) {`

If they were returning a LogicalResult, the current wrappers could `assert(successed(result) && "build method unexpectedly failed);`  and you could use the build methods directly for a failable use-case.

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


More information about the Mlir-commits mailing list