[Mlir-commits] [llvm] [mlir] [mlir][emitc] Add support for C-API/python binding to EmitC dialect (PR #119476)

Maksim Levental llvmlistbot at llvm.org
Tue Dec 10 21:56:05 PST 2024


================
@@ -227,6 +227,37 @@ filegroup(
     ],
 )
 
+##---------------------------------------------------------------------------##
+# EmitC dialect.
+##---------------------------------------------------------------------------##
+
+gentbl_filegroup(
+    name = "EmitCPyGen",
+    tbl_outs = [
+        (
+            [
+                "-gen-python-op-bindings",
+                "-bind-dialect=emitc",
+            ],
+            "mlir/dialects/_emitc_ops_gen.py",
+        ),
+    ],
+    tblgen = "//mlir:mlir-tblgen",
+    td_file = "mlir/dialects/EmitC.td",
+    deps = [
+        "//mlir:OpBaseTdFiles",
+        "//mlir:EmitCTdFiles",
+    ],
+)
+
+filegroup(
+    name = "EmitCPyFiles",
+    srcs = [
+        "mlir/dialects/emitc.py",
+        ":EmitCPyGen",
+    ],
+)
+
----------------
makslevental wrote:

you know this works or this is just your best guess? it's a good guess but FYI bazel is only generally maintained by google people. not that they wouldn't appreciate the PR but just that you don't _need_ to do this if you're not sure.

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


More information about the Mlir-commits mailing list