MLIR 23.0.0git
IRCore.cpp File Reference
#include "mlir/Bindings/Python/Globals.h"
#include "mlir/Bindings/Python/IRCore.h"
#include "mlir/Bindings/Python/NanobindUtils.h"
#include "mlir/Bindings/Python/NanobindAdaptors.h"
#include "mlir-c/Bindings/Python/Interop.h"
#include "mlir-c/BuiltinAttributes.h"
#include "mlir-c/Debug.h"
#include "mlir-c/Diagnostics.h"
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>

Go to the source code of this file.

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::python
namespace  mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN

Macros

#define _Py_CAST(type, expr)
#define _Py_NULL   NULL
#define Py_XNewRef(obj)
#define Py_NewRef(obj)

Functions

template<class Func, typename... Args>
static nb::object classmethod (Func f, Args... args)
 Helper for creating an @classmethod.
static nb::object createCustomDialectWrapper (const std::string &dialectNamespace, nb::object dialectDescriptor)
MlirBlock mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::createBlock (const nb::sequence &pyArgTypes, const std::optional< nb::sequence > &pyArgLocs)
static void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::maybeInsertOperation (PyOperationRef &op, const nb::object &maybeIp)
template<typename Container>
static std::vector< nb::typed< nb::object, PyType > > mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getValueTypes (Container &container, PyMlirContextRef &context)
 Returns the list of types of the values held by container.
static void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateResultTypes (StringRef name, nb::list resultTypeList, const nb::object &resultSegmentSpecObj, std::vector< int32_t > &resultSegmentLengths, std::vector< PyType * > &resultTypes)
MLIR_PYTHON_API_EXPORTED MlirValue mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getUniqueResult (MlirOperation operation)
static MlirValue mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getOpResultOrValue (nb::handle operand)
static PyOperationRef mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getValueOwnerRef (MlirValue value)
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateRoot (nb::module_ &m)
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore (nb::module_ &m)

Variables

static const char kModuleParseDocstring []
static const char kDumpDocstring []
static const char kValueReplaceAllUsesExceptDocstring []

Macro Definition Documentation

◆ _Py_CAST

#define _Py_CAST ( type,
expr )
Value:
((type)(expr))

Definition at line 2536 of file IRCore.cpp.

◆ _Py_NULL

#define _Py_NULL   NULL

Definition at line 2547 of file IRCore.cpp.

◆ Py_NewRef

#define Py_NewRef ( obj)
Value:
_Py_NewRef(_PyObject_CAST(obj))

Definition at line 2569 of file IRCore.cpp.

◆ Py_XNewRef

#define Py_XNewRef ( obj)
Value:
_Py_XNewRef(_PyObject_CAST(obj))

Definition at line 2560 of file IRCore.cpp.

Function Documentation

◆ classmethod()

template<class Func, typename... Args>
nb::object classmethod ( Func f,
Args... args )
static

Helper for creating an @classmethod.

Definition at line 57 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ createCustomDialectWrapper()

nb::object createCustomDialectWrapper ( const std::string & dialectNamespace,
nb::object dialectDescriptor )
static

Variable Documentation

◆ kDumpDocstring

const char kDumpDocstring[]
static
Initial value:
=
"Dumps a debug representation of the object to stderr."

Definition at line 42 of file IRCore.cpp.

◆ kModuleParseDocstring

const char kModuleParseDocstring[]
static
Initial value:
=
R"(Parses a module's assembly format from a string.
Returns a new MlirModule or raises an MLIRError if the parsing fails.
See also: https://mlir.llvm.org/docs/LangRef/
)"

Definition at line 34 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ kValueReplaceAllUsesExceptDocstring

const char kValueReplaceAllUsesExceptDocstring[]
static
Initial value:
=
R"(Replace all uses of this value with the `with` value, except for those
in `exceptions`. `exceptions` can be either a single operation or a list of
operations.
)"

Definition at line 45 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().