[Mlir-commits] [mlir] [mlir][python] fix value builders (PR #68764)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 11 19:05:01 PDT 2023


================
@@ -1009,7 +1016,8 @@ static void emitValueBuilder(const Operator &op,
         return (lhs + "=" + llvm::convertToSnakeFromCamelCase(lhs)).str();
       });
   os << llvm::formatv(
-      valueBuilderTemplate,
+      op.getNumResults() > 0 ? valueBuilderTemplate
+                             : valueBuilderNoResultsTemplate,
----------------
rkayaith wrote:

should the `if len(op.results) > 0` case be removed from `_get_op_result_or_op_results` with this? it could have a slightly more specific return type

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


More information about the Mlir-commits mailing list