[Mlir-commits] [mlir] 2325f36 - Revert "[mlir] fix crash in PybindAdaptors.h"

Alex Zinenko llvmlistbot at llvm.org
Mon Jan 17 01:56:08 PST 2022


Author: Alex Zinenko
Date: 2022-01-17T10:56:01+01:00
New Revision: 2325f363010d3176e96579628cbb96b8fca003a1

URL: https://github.com/llvm/llvm-project/commit/2325f363010d3176e96579628cbb96b8fca003a1
DIFF: https://github.com/llvm/llvm-project/commit/2325f363010d3176e96579628cbb96b8fca003a1.diff

LOG: Revert "[mlir] fix crash in PybindAdaptors.h"

This reverts commit 970cb57ef72c9045250e0492cb00127b49ddfea8.

Broke the buildbot.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Bindings/Python/PybindAdaptors.h b/mlir/include/mlir/Bindings/Python/PybindAdaptors.h
index 68942e560355c..0340e9cc4b87f 100644
--- a/mlir/include/mlir/Bindings/Python/PybindAdaptors.h
+++ b/mlir/include/mlir/Bindings/Python/PybindAdaptors.h
@@ -320,11 +320,7 @@ class mlir_attribute_subclass : public pure_subclass {
     // Casting constructor. Note that defining an __init__ method is special
     // and not yet generalized on pure_subclass (it requires a somewhat
     // 
diff erent cpp_function and other requirements on chaining to super
-    // __init__ make it more awkward to do generally). It is marked as
-    // `is_new_style_constructor` to suppress the deprecation warning from
-    // pybind11 related to placement-new since we are not doing any allocation
-    // here but relying on the superclass constructor that does "new-style"
-    // allocation for pybind11.
+    // __init__ make it more awkward to do generally).
     std::string captureTypeName(
         typeClassName); // As string in case if typeClassName is not static.
     py::cpp_function initCf(
@@ -340,9 +336,7 @@ class mlir_attribute_subclass : public pure_subclass {
           }
           superClass.attr("__init__")(self, otherType);
         },
-        py::name("__init__"), py::arg("cast_from_type"),
-        py::is_method(scope.attr(typeClassName)),
-        py::detail::is_new_style_constructor(),
+        py::arg("cast_from_type"), py::is_method(py::none()),
         "Casts the passed type to this specific sub-type.");
     thisClass.attr("__init__") = initCf;
 
@@ -377,11 +371,7 @@ class mlir_type_subclass : public pure_subclass {
     // Casting constructor. Note that defining an __init__ method is special
     // and not yet generalized on pure_subclass (it requires a somewhat
     // 
diff erent cpp_function and other requirements on chaining to super
-    // __init__ make it more awkward to do generally). It is marked as
-    // `is_new_style_constructor` to suppress the deprecation warning from
-    // pybind11 related to placement-new since we are not doing any allocation
-    // here but relying on the superclass constructor that does "new-style"
-    // allocation for pybind11.
+    // __init__ make it more awkward to do generally).
     std::string captureTypeName(
         typeClassName); // As string in case if typeClassName is not static.
     py::cpp_function initCf(
@@ -397,9 +387,7 @@ class mlir_type_subclass : public pure_subclass {
           }
           superClass.attr("__init__")(self, otherType);
         },
-        py::name("__init__"), py::arg("cast_from_type"),
-        py::is_method(scope.attr(typeClassName)),
-        py::detail::is_new_style_constructor(),
+        py::arg("cast_from_type"), py::is_method(py::none()),
         "Casts the passed type to this specific sub-type.");
     thisClass.attr("__init__") = initCf;
 


        


More information about the Mlir-commits mailing list