[Mlir-commits] [mlir] [mlir] Python: Parse ModuleOp from file path (PR #126572)

Nikhil Kalra llvmlistbot at llvm.org
Wed Feb 12 10:24:35 PST 2025


================
@@ -3049,6 +3052,21 @@ void mlir::python::populateIRCore(nb::module_ &m) {
           },
           nb::arg("asm"), nb::arg("context").none() = nb::none(),
           kModuleParseDocstring)
+#if __has_include(<filesystem>)
+      .def_static(
+          "parse",
+          [](const std::filesystem::path &path,
+             DefaultingPyMlirContext context) {
----------------
nikalra wrote:

There was already an overload that accepted string asm; I ended up adding a new `parseFile` API instead.

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


More information about the Mlir-commits mailing list