MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNamedAttribute Class Reference

Represents a Python MlirNamedAttr, carrying an optional owned name. More...

#include "mlir/Bindings/Python/IRCore.h"

Public Member Functions

 PyNamedAttribute (MlirAttribute attr, std::string ownedName)
 Constructs a PyNamedAttr that retains an owned name.

Public Attributes

MlirNamedAttribute namedAttr

Detailed Description

Represents a Python MlirNamedAttr, carrying an optional owned name.

TODO: Refactor this and the C-API to be based on an Identifier owned by the context so as to avoid ownership issues here.

Definition at line 1035 of file IRCore.h.

Constructor & Destructor Documentation

◆ PyNamedAttribute()

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNamedAttribute::PyNamedAttribute ( MlirAttribute attr,
std::string ownedName )

Constructs a PyNamedAttr that retains an owned name.

This should be used in any code that originates an MlirNamedAttribute from a python string. The lifetime of the PyNamedAttr must extend to the lifetime of the passed attribute.

Definition at line 1933 of file IRCore.cpp.

References mlirAttributeGetContext(), mlirIdentifierGet(), mlirNamedAttributeGet(), namedAttr, and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::toMlirStringRef().

Member Data Documentation

◆ namedAttr

MlirNamedAttribute mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNamedAttribute::namedAttr

Definition at line 1044 of file IRCore.h.

Referenced by PyNamedAttribute().


The documentation for this class was generated from the following files: