Skip to content

Commit 2325f36

Browse files
committed
Revert "[mlir] fix crash in PybindAdaptors.h"
This reverts commit 970cb57. Broke the buildbot.
1 parent 873a7ee commit 2325f36

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

mlir/include/mlir/Bindings/Python/PybindAdaptors.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,7 @@ class mlir_attribute_subclass : public pure_subclass {
320320
// Casting constructor. Note that defining an __init__ method is special
321321
// and not yet generalized on pure_subclass (it requires a somewhat
322322
// different cpp_function and other requirements on chaining to super
323-
// __init__ make it more awkward to do generally). It is marked as
324-
// `is_new_style_constructor` to suppress the deprecation warning from
325-
// pybind11 related to placement-new since we are not doing any allocation
326-
// here but relying on the superclass constructor that does "new-style"
327-
// allocation for pybind11.
323+
// __init__ make it more awkward to do generally).
328324
std::string captureTypeName(
329325
typeClassName); // As string in case if typeClassName is not static.
330326
py::cpp_function initCf(
@@ -340,9 +336,7 @@ class mlir_attribute_subclass : public pure_subclass {
340336
}
341337
superClass.attr("__init__")(self, otherType);
342338
},
343-
py::name("__init__"), py::arg("cast_from_type"),
344-
py::is_method(scope.attr(typeClassName)),
345-
py::detail::is_new_style_constructor(),
339+
py::arg("cast_from_type"), py::is_method(py::none()),
346340
"Casts the passed type to this specific sub-type.");
347341
thisClass.attr("__init__") = initCf;
348342

@@ -377,11 +371,7 @@ class mlir_type_subclass : public pure_subclass {
377371
// Casting constructor. Note that defining an __init__ method is special
378372
// and not yet generalized on pure_subclass (it requires a somewhat
379373
// different cpp_function and other requirements on chaining to super
380-
// __init__ make it more awkward to do generally). It is marked as
381-
// `is_new_style_constructor` to suppress the deprecation warning from
382-
// pybind11 related to placement-new since we are not doing any allocation
383-
// here but relying on the superclass constructor that does "new-style"
384-
// allocation for pybind11.
374+
// __init__ make it more awkward to do generally).
385375
std::string captureTypeName(
386376
typeClassName); // As string in case if typeClassName is not static.
387377
py::cpp_function initCf(
@@ -397,9 +387,7 @@ class mlir_type_subclass : public pure_subclass {
397387
}
398388
superClass.attr("__init__")(self, otherType);
399389
},
400-
py::name("__init__"), py::arg("cast_from_type"),
401-
py::is_method(scope.attr(typeClassName)),
402-
py::detail::is_new_style_constructor(),
390+
py::arg("cast_from_type"), py::is_method(py::none()),
403391
"Casts the passed type to this specific sub-type.");
404392
thisClass.attr("__init__") = initCf;
405393

0 commit comments

Comments
 (0)