MLIR
20.0.0git
|
Wrapper around an MlirLocation. More...
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
PyLocation (PyMlirContextRef contextRef, MlirLocation loc) | |
operator MlirLocation () const | |
MlirLocation | get () const |
pybind11::object | contextEnter () |
Enter and exit the context manager. More... | |
void | contextExit (const pybind11::object &excType, const pybind11::object &excVal, const pybind11::object &excTb) |
pybind11::object | getCapsule () |
Gets a capsule wrapping the void* within the MlirLocation. More... | |
Public Member Functions inherited from mlir::python::BaseContextObject | |
BaseContextObject (PyMlirContextRef ref) | |
PyMlirContextRef & | getContext () |
Accesses the context reference. More... | |
Static Public Member Functions | |
static PyLocation | createFromCapsule (pybind11::object capsule) |
Creates a PyLocation from the MlirLocation wrapped by a capsule. More... | |
Wrapper around an MlirLocation.
Definition at line 318 of file IRModule.h.
|
inline |
Definition at line 320 of file IRModule.h.
Referenced by createFromCapsule().
py::object PyLocation::contextEnter | ( | ) |
Enter and exit the context manager.
Definition at line 1061 of file IRCore.cpp.
References mlir::python::PyThreadContextEntry::pushLocation().
void PyLocation::contextExit | ( | const pybind11::object & | excType, |
const pybind11::object & | excVal, | ||
const pybind11::object & | excTb | ||
) |
Definition at line 1065 of file IRCore.cpp.
References mlir::python::PyThreadContextEntry::popLocation().
|
static |
Creates a PyLocation from the MlirLocation wrapped by a capsule.
Note that PyLocation instances are uniqued, so the returned object may be a pre-existing object. Ownership of the underlying MlirLocation is taken by calling this function.
Definition at line 1053 of file IRCore.cpp.
References mlir::python::PyMlirContext::forContext(), mlirLocationGetContext(), mlirLocationIsNull(), mlirPythonCapsuleToLocation(), and PyLocation().
|
inline |
Definition at line 324 of file IRModule.h.
py::object PyLocation::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirLocation.
Definition at line 1049 of file IRCore.cpp.
References mlirPythonLocationToCapsule().
|
inline |
Definition at line 323 of file IRModule.h.