|
MLIR 22.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, nanobind::object context, nanobind::object insertionPoint, nanobind::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. | |
| static PyInsertionPoint * | getDefaultInsertionPoint () |
| Gets the top of stack insertion point and return nullptr if not defined. | |
| static PyLocation * | getDefaultLocation () |
| Gets the top of stack location and returns nullptr if not defined. | |
| static PyThreadContextEntry * | getTopOfStack () |
| Stack management. | |
| static nanobind::object | pushContext (nanobind::object context) |
| static void | popContext (PyMlirContext &context) |
| static nanobind::object | pushInsertionPoint (nanobind::object insertionPoint) |
| static void | popInsertionPoint (PyInsertionPoint &insertionPoint) |
| static nanobind::object | pushLocation (nanobind::object location) |
| static void | popLocation (PyLocation &location) |
| static std::vector< PyThreadContextEntry > & | getStack () |
| Gets the thread local stack. | |
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 112 of file IRModule.h.
|
strong |
| Enumerator | |
|---|---|
| Context | |
| InsertionPoint | |
| Location | |
Definition at line 114 of file IRModule.h.
|
inline |
Definition at line 120 of file IRModule.h.
Referenced by getTopOfStack().
| PyMlirContext * PyThreadContextEntry::getContext | ( | ) |
Definition at line 720 of file IRCore.cpp.
|
static |
Gets the top of stack context and return nullptr if not defined.
Definition at line 738 of file IRCore.cpp.
References getTopOfStack().
Referenced by mlir::python::DefaultingPyMlirContext::resolve().
|
static |
Gets the top of stack insertion point and return nullptr if not defined.
Definition at line 743 of file IRCore.cpp.
References getTopOfStack().
Referenced by maybeInsertOperation().
|
static |
Gets the top of stack location and returns nullptr if not defined.
Definition at line 748 of file IRCore.cpp.
References getTopOfStack().
Referenced by mlir::python::DefaultingPyLocation::resolve().
|
inline |
Definition at line 138 of file IRModule.h.
| PyInsertionPoint * PyThreadContextEntry::getInsertionPoint | ( | ) |
Definition at line 726 of file IRCore.cpp.
| PyLocation * PyThreadContextEntry::getLocation | ( | ) |
Definition at line 732 of file IRCore.cpp.
|
static |
Gets the thread local stack.
Definition at line 686 of file IRCore.cpp.
Referenced by getTopOfStack(), popContext(), popInsertionPoint(), and popLocation().
|
static |
Stack management.
Definition at line 691 of file IRCore.cpp.
References getStack(), and PyThreadContextEntry().
Referenced by getDefaultContext(), getDefaultInsertionPoint(), and getDefaultLocation().
|
static |
Definition at line 760 of file IRCore.cpp.
References Context, and getStack().
Referenced by mlir::python::PyMlirContext::contextExit().
|
static |
Definition at line 783 of file IRCore.cpp.
References getStack(), and InsertionPoint.
Referenced by mlir::python::PyInsertionPoint::contextExit().
|
static |
Definition at line 803 of file IRCore.cpp.
References getStack(), and Location.
Referenced by mlir::python::PyLocation::contextExit().
|
static |
Definition at line 753 of file IRCore.cpp.
References Context.
Referenced by mlir::python::PyMlirContext::contextEnter().
|
static |
Definition at line 771 of file IRCore.cpp.
References InsertionPoint.
Referenced by mlir::python::PyInsertionPoint::contextEnter().
|
static |
Definition at line 794 of file IRCore.cpp.
References Location.
Referenced by mlir::python::PyLocation::contextEnter().