13 #ifndef CIRCT_BINDINGS_PYTHON_PYBINDUTILS_H
14 #define CIRCT_BINDINGS_PYTHON_PYBINDUTILS_H
18 #include <pybind11/pybind11.h>
19 #include <pybind11/pytypes.h>
20 #include <pybind11/stl.h>
22 #include "mlir-c/Bindings/Python/Interop.h"
23 #include "mlir-c/IR.h"
24 #include "mlir-c/Pass.h"
44 return [](MlirStringRef part,
void *userData) {
45 pybind11::gil_scoped_acquire();
49 pybind11::bytes pyBytes(part.data, part.length);
52 pybind11::str pyStr(part.data,
71 inline pybind11::error_already_set
raisePyError(PyObject *exc_class,
72 const char *message) {
73 PyErr_SetString(exc_class, message);
74 return pybind11::error_already_set();
Taken from PybindUtils.h in MLIR.
pybind11::object pyWriteFunction
MlirStringCallback getCallback()
PyFileAccumulator(pybind11::object fileObject, bool binary)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
pybind11::error_already_set raiseValueError(const char *message)
Raises a value error with the given message.
pybind11::error_already_set raisePyError(PyObject *exc_class, const char *message)
Raises a python exception with the given message.