Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 901029c

Browse files
authored
Revert "[mlir] Python: Parse ModuleOp from file path" (#126482)
Reverts llvm/llvm-project#125736 The gcc7 Bot is broken at the moment.
1 parent c9ddeba commit 901029c

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

IRCore.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <filesystem>
109
#include <optional>
1110
#include <utility>
1211

@@ -300,7 +299,7 @@ struct PyAttrBuilderMap {
300299
return *builder;
301300
}
302301
static void dunderSetItemNamed(const std::string &attributeKind,
303-
nb::callable func, bool replace) {
302+
nb::callable func, bool replace) {
304303
PyGlobals::get().registerAttributeBuilder(attributeKind, std::move(func),
305304
replace);
306305
}
@@ -3050,19 +3049,6 @@ void mlir::python::populateIRCore(nb::module_ &m) {
30503049
},
30513050
nb::arg("asm"), nb::arg("context").none() = nb::none(),
30523051
kModuleParseDocstring)
3053-
.def_static(
3054-
"parse",
3055-
[](const std::filesystem::path &path,
3056-
DefaultingPyMlirContext context) {
3057-
PyMlirContext::ErrorCapture errors(context->getRef());
3058-
MlirModule module = mlirModuleCreateParseFromFile(
3059-
context->get(), toMlirStringRef(path.string()));
3060-
if (mlirModuleIsNull(module))
3061-
throw MLIRError("Unable to parse module assembly", errors.take());
3062-
return PyModule::forModule(module).releaseObject();
3063-
},
3064-
nb::arg("asm"), nb::arg("context").none() = nb::none(),
3065-
kModuleParseDocstring)
30663052
.def_static(
30673053
"create",
30683054
[](DefaultingPyLocation loc) {

0 commit comments

Comments
 (0)