MLIR 23.0.0git
nanobind::detail::type_caster< MlirBlock > Struct Reference

Casts object -> MlirBlock. More...

#include "mlir/Bindings/Python/NanobindAdaptors.h"

Public Member Functions

 NB_TYPE_CASTER (MlirBlock, const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Block"))) bool from_python(handle src

Public Attributes

uint8_t flags
uint8_t cleanup_list *cleanup noexcept

Detailed Description

Casts object -> MlirBlock.

Definition at line 165 of file NanobindAdaptors.h.

Member Function Documentation

◆ NB_TYPE_CASTER()

nanobind::detail::type_caster< MlirBlock >::NB_TYPE_CASTER ( MlirBlock ,
const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Block"))  )

Member Data Documentation

◆ flags

uint8_t nanobind::detail::type_caster< MlirBlock >::flags

Definition at line 167 of file NanobindAdaptors.h.

◆ noexcept

uint8_t cleanup_list* cleanup nanobind::detail::type_caster< MlirBlock >::noexcept
Initial value:
{
if (auto capsule = mlirApiObjectToCapsule(src)) {
value = mlirPythonCapsuleToBlock(capsule->ptr());
return !mlirBlockIsNull(value);
}
return false
static MlirBlock mlirPythonCapsuleToBlock(PyObject *capsule)
Extracts an MlirBlock from a capsule as produced from mlirPythonBlockToCapsule.
Definition Interop.h:206
static bool mlirBlockIsNull(MlirBlock block)
Checks whether a block is null.
Definition IR.h:941
static std::optional< nanobind::object > mlirApiObjectToCapsule(nanobind::handle apiObject)
Helper to convert a presumed MLIR API object to a capsule, accepting either an explicit Capsule (whic...

Definition at line 167 of file NanobindAdaptors.h.


The documentation for this struct was generated from the following file: