[Mlir-commits] [mlir] [mlir][NFC] update `include` create APIs (3/n) (PR #149687)

Maksim Levental llvmlistbot at llvm.org
Sun Jul 20 08:39:33 PDT 2025


================
@@ -226,6 +226,15 @@ static void generateOpBuilderDeclarations(irdl::detail::dictionary &dict,
   stream << llvm::formatv(
       R"(static void build(::mlir::OpBuilder &opBuilder, ::mlir::OperationState &opState, {0} {1} ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {{});)",
       resultParams, operandParams);
+  stream << "\n";
+  stream << llvm::formatv(
+      R"(static {0} create(::mlir::OpBuilder &opBuilder, ::mlir::Location location, {1} {2} ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {{});)",
+      opStrings.opCppName, resultParams, operandParams);
+  stream << "\n";
+  stream << llvm::formatv(
+      R"(static {0} create(::mlir::ImplicitLocOpBuilder &opBuilder, {1} {2} ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {{});)",
+      opStrings.opCppName, resultParams, operandParams);
+  stream << "\n";
----------------
makslevental wrote:

@Moxinilian @math-fehr can you review the changes here (enabling `create` support for `irdl-to-cpp`).

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


More information about the Mlir-commits mailing list