|
MLIR 22.0.0git
|
Bindings for MLIR symbol tables. More...
#include "mlir/Bindings/Python/IRCore.h"
Public Member Functions | |
| PySymbolTable (PyOperationBase &operation) | |
| Constructs a symbol table for the given operation. | |
| ~PySymbolTable () | |
| Destroys the symbol table. | |
| nanobind::object | dunderGetItem (const std::string &name) |
| Returns the symbol (opview) with the given name, throws if there is no such symbol in the table. | |
| void | erase (PyOperationBase &symbol) |
| Removes the given operation from the symbol table and erases it. | |
| void | dunderDel (const std::string &name) |
| Removes the operation with the given name from the symbol table and erases it, throws if there is no such symbol in the table. | |
| PyStringAttribute | insert (PyOperationBase &symbol) |
| Inserts the given operation into the symbol table. | |
| operator MlirSymbolTable () | |
| Casts the bindings class into the C API structure. | |
Static Public Member Functions | |
| static PyStringAttribute | getSymbolName (PyOperationBase &symbol) |
| Gets and sets the name of a symbol op. | |
| static void | setSymbolName (PyOperationBase &symbol, const std::string &name) |
| static PyStringAttribute | getVisibility (PyOperationBase &symbol) |
| Gets and sets the visibility of a symbol op. | |
| static void | setVisibility (PyOperationBase &symbol, const std::string &visibility) |
| static void | replaceAllSymbolUses (const std::string &oldSymbol, const std::string &newSymbol, PyOperationBase &from) |
| Replaces all symbol uses within an operation. | |
| static void | walkSymbolTables (PyOperationBase &from, bool allSymUsesVisible, nanobind::object callback) |
| Walks all symbol tables under and including 'from'. | |
|
explicit |
Constructs a symbol table for the given operation.
Definition at line 2037 of file IRCore.cpp.
References mlirSymbolTableCreate().
|
inline |
Destroys the symbol table.
Definition at line 1280 of file IRCore.h.
References mlirSymbolTableDestroy().
| void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::dunderDel | ( | const std::string & | name | ) |
Removes the operation with the given name from the symbol table and erases it, throws if there is no such symbol in the table.
Definition at line 2068 of file IRCore.cpp.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
| nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::dunderGetItem | ( | const std::string & | name | ) |
Returns the symbol (opview) with the given name, throws if there is no such symbol in the table.
Definition at line 2045 of file IRCore.cpp.
Referenced by insert().
| void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::erase | ( | PyOperationBase & | symbol | ) |
Removes the given operation from the symbol table and erases it.
Definition at line 2058 of file IRCore.cpp.
Referenced by insert(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
static |
Gets and sets the name of a symbol op.
Definition at line 2085 of file IRCore.cpp.
References mlirSymbolTableInsert().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
static |
Gets and sets the visibility of a symbol op.
Definition at line 2113 of file IRCore.cpp.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::toMlirStringRef().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
| PyStringAttribute mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::insert | ( | PyOperationBase & | symbol | ) |
Inserts the given operation into the symbol table.
The operation must have the symbol trait.
Definition at line 2073 of file IRCore.cpp.
References dunderGetItem(), and erase().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
inline |
|
static |
Replaces all symbol uses within an operation.
See the API mlirSymbolTableReplaceAllSymbolUses for all caveats.
Definition at line 2142 of file IRCore.cpp.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::toMlirStringRef().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
static |
Definition at line 2098 of file IRCore.cpp.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
static |
Definition at line 2124 of file IRCore.cpp.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
static |
Walks all symbol tables under and including 'from'.
Definition at line 2154 of file IRCore.cpp.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().