MLIR  21.0.0git
Public Member Functions | Friends | List of all members
mlir::NamedAttribute Class Reference

NamedAttribute represents a combination of a name and an Attribute value. More...

#include "mlir/IR/Attributes.h"

Public Member Functions

 NamedAttribute (StringAttr name, Attribute value)
 
 NamedAttribute (StringRef name, Attribute value)
 
StringAttr getName () const
 Return the name of the attribute. More...
 
DialectgetNameDialect () const
 Return the dialect of the name of this attribute, if the name is prefixed by a dialect namespace. More...
 
Attribute getValue () const
 Return the value of the attribute. More...
 
void setName (StringAttr newName)
 Set the name of this attribute. More...
 
void setValue (Attribute newValue)
 Set the value of this attribute. More...
 
bool operator< (const NamedAttribute &rhs) const
 Compare this attribute to the provided attribute, ordering by name. More...
 
bool operator< (StringRef rhs) const
 Compare this attribute to the provided string, ordering by name. More...
 
bool operator== (const NamedAttribute &rhs) const
 
bool operator!= (const NamedAttribute &rhs) const
 

Friends

::llvm::hash_code hash_value (const NamedAttribute &arg)
 Allow access to internals to enable hashing. More...
 

Detailed Description

NamedAttribute represents a combination of a name and an Attribute value.

Definition at line 164 of file Attributes.h.

Constructor & Destructor Documentation

◆ NamedAttribute() [1/2]

NamedAttribute::NamedAttribute ( StringAttr  name,
Attribute  value 
)

Definition at line 43 of file Attributes.cpp.

◆ NamedAttribute() [2/2]

NamedAttribute::NamedAttribute ( StringRef  name,
Attribute  value 
)

Definition at line 49 of file Attributes.cpp.

References mlir::get(), and mlir::Attribute::getContext().

Member Function Documentation

◆ getName()

StringAttr NamedAttribute::getName ( ) const

◆ getNameDialect()

Dialect * NamedAttribute::getNameDialect ( ) const

Return the dialect of the name of this attribute, if the name is prefixed by a dialect namespace.

For example, llvm.fast_math would return the LLVM dialect (if it is loaded). Returns nullptr if the dialect isn't loaded, or if the name is not prefixed by a dialect namespace.

Definition at line 59 of file Attributes.cpp.

References getName().

Referenced by mlir::LLVMTranslationInterface::amendOperation(), and mlir::LLVMTranslationInterface::convertParameterAttr().

◆ getValue()

Attribute mlir::NamedAttribute::getValue ( ) const
inline

◆ operator!=()

bool mlir::NamedAttribute::operator!= ( const NamedAttribute rhs) const
inline

Definition at line 198 of file Attributes.h.

◆ operator<() [1/2]

bool NamedAttribute::operator< ( const NamedAttribute rhs) const

Compare this attribute to the provided attribute, ordering by name.

Definition at line 68 of file Attributes.cpp.

References getName().

◆ operator<() [2/2]

bool NamedAttribute::operator< ( StringRef  rhs) const

Compare this attribute to the provided string, ordering by name.

Definition at line 72 of file Attributes.cpp.

References getName().

◆ operator==()

bool mlir::NamedAttribute::operator== ( const NamedAttribute rhs) const
inline

Definition at line 195 of file Attributes.h.

◆ setName()

void NamedAttribute::setName ( StringAttr  newName)

Set the name of this attribute.

Definition at line 63 of file Attributes.cpp.

◆ setValue()

void mlir::NamedAttribute::setValue ( Attribute  newValue)
inline

Set the value of this attribute.

Definition at line 185 of file Attributes.h.

Friends And Related Function Documentation

◆ hash_value

::llvm::hash_code hash_value ( const NamedAttribute arg)
friend

Allow access to internals to enable hashing.

Definition at line 214 of file Attributes.h.


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