[Mlir-commits] [mlir] [mlir][py] Overload print with state. (PR #72064)

Maksim Levental llvmlistbot at llvm.org
Sun Nov 12 11:56:12 PST 2023


================
@@ -2946,15 +2967,23 @@ void mlir::python::populateIRCore(py::module &m) {
                                /*assumeVerified=*/false);
           },
           "Returns the assembly form of the operation.")
-      .def("print", &PyOperationBase::print,
+      .def("print",
+           py::overload_cast<PyAsmState &, pybind11::object, bool>(
+               &PyOperationBase::print),
+           py::arg("state"), py::arg("file") = py::none(),
+           py::arg("binary") = false, kOperationPrintStateDocstring)
+      .def("print",
+           py::overload_cast<std::optional<int64_t>, bool, bool, bool, bool,
+                             bool, pybind11::object, bool>(
----------------
makslevental wrote:

```suggestion
                             bool, py::object, bool>(
```

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


More information about the Mlir-commits mailing list