[Mlir-commits] [mlir] [mlir][python] value casting (PR #69644)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Oct 31 02:48:51 PDT 2023


================
@@ -1124,6 +1122,8 @@ class PyValue {
   /// Gets a capsule wrapping the void* within the MlirValue.
   pybind11::object getCapsule();
 
+  virtual pybind11::object maybeDownCast();
----------------
ftynse wrote:

The tradition is to make a virtual destructor...  Do need `py::cast` to work for these? I'd rather not pay for something we don't use. It looks like this would be necessary if caster functions wanted to take BlockArgument or OpResult specifically, but arguably they should always take Value and can do `isa` inside if really needed.

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


More information about the Mlir-commits mailing list