MLIR
20.0.0git
|
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) | |
StringAttr | getName () const |
Return the name of the attribute. More... | |
Dialect * | getNameDialect () 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... | |
NamedAttribute represents a combination of a name and an Attribute value.
Definition at line 207 of file Attributes.h.
NamedAttribute::NamedAttribute | ( | StringAttr | name, |
Attribute | value | ||
) |
Definition at line 43 of file Attributes.cpp.
StringAttr NamedAttribute::getName | ( | ) | const |
Return the name of the attribute.
Definition at line 49 of file Attributes.cpp.
Referenced by mlir::LLVMTranslationInterface::convertParameterAttr(), mlir::OpState::genericPrintProperties(), getNameDialect(), mlirDictionaryAttrGetElement(), mlirOperationGetAttribute(), mlirOperationGetDiscardableAttribute(), operator<(), processFMFAttr(), verifyKnownLaunchSizeAttr(), and verifyRegionAttribute().
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 53 of file Attributes.cpp.
References getName().
Referenced by mlir::LLVMTranslationInterface::amendOperation(), and mlir::LLVMTranslationInterface::convertParameterAttr().
|
inline |
Return the value of the attribute.
Definition at line 221 of file Attributes.h.
Referenced by mlirDictionaryAttrGetElement(), mlirOperationGetAttribute(), mlirOperationGetDiscardableAttribute(), processFMFAttr(), mlir::affine::replaceAllMemRefUsesWith(), verifyKnownLaunchSizeAttr(), and verifyRegionAttribute().
|
inline |
Definition at line 240 of file Attributes.h.
bool NamedAttribute::operator< | ( | const NamedAttribute & | rhs | ) | const |
Compare this attribute to the provided attribute, ordering by name.
Definition at line 62 of file Attributes.cpp.
References getName().
bool NamedAttribute::operator< | ( | StringRef | rhs | ) | const |
Compare this attribute to the provided string, ordering by name.
Definition at line 66 of file Attributes.cpp.
References getName().
|
inline |
Definition at line 237 of file Attributes.h.
void NamedAttribute::setName | ( | StringAttr | newName | ) |
Set the name of this attribute.
Definition at line 57 of file Attributes.cpp.
|
inline |
Set the value of this attribute.
Definition at line 227 of file Attributes.h.
|
friend |
Allow access to internals to enable hashing.
Definition at line 256 of file Attributes.h.