MLIR
17.0.0git
|
Tracks an entry in the thread context stack. More...
#include "Bindings/Python/IRModule.h"
Public Types | |
enum class | FrameKind { Context , InsertionPoint , Location } |
Public Member Functions | |
PyThreadContextEntry (FrameKind frameKind, pybind11::object context, pybind11::object insertionPoint, pybind11::object location) | |
PyMlirContext * | getContext () |
PyInsertionPoint * | getInsertionPoint () |
PyLocation * | getLocation () |
FrameKind | getFrameKind () |
Static Public Member Functions | |
static PyMlirContext * | getDefaultContext () |
Gets the top of stack context and return nullptr if not defined. More... | |
static PyInsertionPoint * | getDefaultInsertionPoint () |
Gets the top of stack insertion point and return nullptr if not defined. More... | |
static PyLocation * | getDefaultLocation () |
Gets the top of stack location and returns nullptr if not defined. More... | |
static PyThreadContextEntry * | getTopOfStack () |
Stack management. More... | |
static pybind11::object | pushContext (PyMlirContext &context) |
static void | popContext (PyMlirContext &context) |
static pybind11::object | pushInsertionPoint (PyInsertionPoint &insertionPoint) |
static void | popInsertionPoint (PyInsertionPoint &insertionPoint) |
static pybind11::object | pushLocation (PyLocation &location) |
static void | popLocation (PyLocation &location) |
static std::vector< PyThreadContextEntry > & | getStack () |
Gets the thread local stack. More... | |
Tracks an entry in the thread context stack.
New entries are pushed onto here for each with block that activates a new InsertionPoint, Context or Location.
Pushing either a Location or InsertionPoint also pushes its associated Context. Pushing a Context will not modify the Location or InsertionPoint unless if they are from a different context, in which case, they are cleared.
Definition at line 104 of file IRModule.h.
|
strong |
Enumerator | |
---|---|
Context | |
InsertionPoint | |
Location |
Definition at line 106 of file IRModule.h.
|
inline |
Definition at line 112 of file IRModule.h.
PyMlirContext * PyThreadContextEntry::getContext | ( | ) |
Definition at line 751 of file IRCore.cpp.
|
static |
Gets the top of stack context and return nullptr if not defined.
Definition at line 769 of file IRCore.cpp.
Referenced by mlir::python::DefaultingPyMlirContext::resolve().
|
static |
Gets the top of stack insertion point and return nullptr if not defined.
Definition at line 774 of file IRCore.cpp.
|
static |
Gets the top of stack location and returns nullptr if not defined.
Definition at line 779 of file IRCore.cpp.
Referenced by mlir::python::DefaultingPyLocation::resolve().
|
inline |
Definition at line 130 of file IRModule.h.
PyInsertionPoint * PyThreadContextEntry::getInsertionPoint | ( | ) |
Definition at line 757 of file IRCore.cpp.
PyLocation * PyThreadContextEntry::getLocation | ( | ) |
Definition at line 763 of file IRCore.cpp.
|
static |
Gets the thread local stack.
Definition at line 717 of file IRCore.cpp.
|
static |
Stack management.
Definition at line 722 of file IRCore.cpp.
|
static |
Definition at line 792 of file IRCore.cpp.
Referenced by mlir::python::PyMlirContext::contextExit().
|
static |
Definition at line 814 of file IRCore.cpp.
Referenced by mlir::python::PyInsertionPoint::contextExit().
|
static |
Definition at line 834 of file IRCore.cpp.
Referenced by mlir::python::PyLocation::contextExit().
|
static |
Definition at line 784 of file IRCore.cpp.
Referenced by mlir::python::PyMlirContext::contextEnter().
|
static |
Definition at line 803 of file IRCore.cpp.
References mlir::python::PyInsertionPoint::getBlock(), mlir::python::BaseContextObject::getContext(), mlir::python::PyObjectRef< T >::getObject(), and mlir::python::PyBlock::getParentOperation().
Referenced by mlir::python::PyInsertionPoint::contextEnter().
|
static |
Definition at line 825 of file IRCore.cpp.
References mlir::python::BaseContextObject::getContext(), and mlir::python::PyObjectRef< T >::getObject().
Referenced by mlir::python::PyLocation::contextEnter().