MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList Class Reference

Blocks are exposed by the C-API as a forward-only linked list. More...

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

Public Member Functions

 PyBlockList (PyOperationRef operation, MlirRegion region)
PyBlockIterator dunderIter ()
intptr_t dunderLen ()
PyBlock dunderGetItem (intptr_t index)
PyBlock appendBlock (const nanobind::args &pyArgTypes, const std::optional< nanobind::sequence > &pyArgLocs)

Static Public Member Functions

static void bind (nanobind::module_ &m)

Detailed Description

Blocks are exposed by the C-API as a forward-only linked list.

In Python, we present them as a more full-featured list-like container but optimize it for forward iteration. Blocks are always owned by a region.

Definition at line 1432 of file IRCore.h.

Constructor & Destructor Documentation

◆ PyBlockList()

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::PyBlockList ( PyOperationRef operation,
MlirRegion region )
inline

Definition at line 1434 of file IRCore.h.

Member Function Documentation

◆ appendBlock()

PyBlock mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::appendBlock ( const nanobind::args & pyArgTypes,
const std::optional< nanobind::sequence > & pyArgLocs )

◆ bind()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::bind ( nanobind::module_ & m)
static

◆ dunderGetItem()

PyBlock mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::dunderGetItem ( intptr_t index)

◆ dunderIter()

PyBlockIterator mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::dunderIter ( )

Definition at line 266 of file IRCore.cpp.

References mlirRegionGetFirstBlock().

Referenced by bind().

◆ dunderLen()

intptr_t mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::dunderLen ( )

Definition at line 271 of file IRCore.cpp.

References mlirBlockGetNextInRegion(), mlirBlockIsNull(), and mlirRegionGetFirstBlock().

Referenced by bind(), and dunderGetItem().


The documentation for this class was generated from the following files: