Skip to content

Commit 843ef85

Browse files
committed
[MLIR][Python] fixup Context and Location stubs
1 parent e83a3b8 commit 843ef85

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

mlir/lib/Bindings/Python/IRCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3601,7 +3601,7 @@ void mlir::python::populateIRCore(nb::module_ &m) {
36013601
"walk", &PyOperationBase::walk, nb::arg("callback"),
36023602
nb::arg("walk_order") = MlirWalkPostOrder,
36033603
// clang-format off
3604-
nb::sig("def walk(self, callback: Callable[[Operation], WalkResult], walk_order: WalkOrder = " MAKE_MLIR_PYTHON_QUALNAME("ir.WalkOrder.POST_ORDER") ") -> None")
3604+
nb::sig("def walk(self, callback: Callable[[Operation], WalkResult], walk_order: WalkOrder) -> None")
36053605
// clang-format on
36063606
);
36073607

mlir/lib/Bindings/Python/IRModule.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ class DefaultingPyMlirContext
273273
: public Defaulting<DefaultingPyMlirContext, PyMlirContext> {
274274
public:
275275
using Defaulting::Defaulting;
276-
static constexpr const char kTypeDescription[] =
277-
MAKE_MLIR_PYTHON_QUALNAME("ir.Context");
276+
static constexpr const char kTypeDescription[] = "Context";
278277
static PyMlirContext &resolve();
279278
};
280279

@@ -500,8 +499,7 @@ class DefaultingPyLocation
500499
: public Defaulting<DefaultingPyLocation, PyLocation> {
501500
public:
502501
using Defaulting::Defaulting;
503-
static constexpr const char kTypeDescription[] =
504-
MAKE_MLIR_PYTHON_QUALNAME("ir.Location");
502+
static constexpr const char kTypeDescription[] = "Location";
505503
static PyLocation &resolve();
506504

507505
operator MlirLocation() const { return *get(); }

mlir/lib/Bindings/Python/IRTypes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ class PyTupleType : public PyConcreteType<PyTupleType> {
10101010
},
10111011
nb::arg("elements"), nb::arg("context") = nb::none(),
10121012
// clang-format off
1013-
nb::sig("def get_tuple(elements: Sequence[Type], context: mlir.ir.Context | None = None) -> TupleType"),
1013+
nb::sig("def get_tuple(elements: Sequence[Type], context: Context | None = None) -> TupleType"),
10141014
// clang-format on
10151015
"Create a tuple type");
10161016
c.def(
@@ -1070,7 +1070,7 @@ class PyFunctionType : public PyConcreteType<PyFunctionType> {
10701070
},
10711071
nb::arg("inputs"), nb::arg("results"), nb::arg("context") = nb::none(),
10721072
// clang-format off
1073-
nb::sig("def get(inputs: Sequence[Type], results: Sequence[Type], context: mlir.ir.Context | None = None) -> FunctionType"),
1073+
nb::sig("def get(inputs: Sequence[Type], results: Sequence[Type], context: Context | None = None) -> FunctionType"),
10741074
// clang-format on
10751075
"Gets a FunctionType from a list of input and result types");
10761076
c.def_prop_ro(

0 commit comments

Comments
 (0)