MLIR  19.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::python::PyNamedAttribute Class Reference

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

#include "Bindings/Python/IRModule.h"

Public Member Functions

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

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 1026 of file IRModule.h.

Constructor & Destructor Documentation

◆ PyNamedAttribute()

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 1945 of file IRCore.cpp.

References mlirAttributeGetContext(), mlirIdentifierGet(), mlirNamedAttributeGet(), namedAttr, and toMlirStringRef().

Member Data Documentation

◆ namedAttr

MlirNamedAttribute mlir::python::PyNamedAttribute::namedAttr

Definition at line 1035 of file IRModule.h.

Referenced by PyNamedAttribute().


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