MLIR
16.0.0git
|
This class contains all of the static information common to all instances of a registered Attribute. More...
#include "mlir/IR/AttributeSupport.h"
Public Types | |
using | HasTraitFn = llvm::unique_function< bool(TypeID) const > |
Public Member Functions | |
Dialect & | getDialect () const |
Return the dialect this attribute was registered to. More... | |
template<typename T > | |
T::Concept * | getInterface () const |
Returns an instance of the concept object for the given interface if it was registered to this attribute, null otherwise. More... | |
bool | hasInterface (TypeID interfaceID) const |
Returns true if the attribute has the interface with the given ID registered. More... | |
template<template< typename T > class Trait> | |
bool | hasTrait () const |
Returns true if the attribute has a particular trait. More... | |
bool | hasTrait (TypeID traitID) const |
Returns true if the attribute has a particular trait. More... | |
TypeID | getTypeID () const |
Return the unique identifier representing the concrete attribute class. More... | |
Static Public Member Functions | |
static const AbstractAttribute & | lookup (TypeID typeID, MLIRContext *context) |
Look up the specified abstract attribute in the MLIRContext and return a reference to it. More... | |
template<typename T > | |
static AbstractAttribute | get (Dialect &dialect) |
This method is used by Dialect objects when they register the list of attributes they contain. More... | |
static AbstractAttribute | get (Dialect &dialect, detail::InterfaceMap &&interfaceMap, HasTraitFn &&hasTrait, TypeID typeID) |
This method is used by Dialect objects to register attributes with custom TypeIDs. More... | |
Friends | |
template<typename ConcreteT , typename BaseT , typename StorageT , typename UniquerT , template< typename T > class... Traits> | |
class | detail::StorageUserBase |
Give StorageUserBase access to the mutable lookup. More... | |
This class contains all of the static information common to all instances of a registered Attribute.
Definition at line 32 of file AttributeSupport.h.
using mlir::AbstractAttribute::HasTraitFn = llvm::unique_function<bool(TypeID) const> |
Definition at line 34 of file AttributeSupport.h.
|
inlinestatic |
This method is used by Dialect objects when they register the list of attributes they contain.
Definition at line 43 of file AttributeSupport.h.
Referenced by mlir::ExtensibleDialect::registerDynamicAttr().
|
inlinestatic |
This method is used by Dialect objects to register attributes with custom TypeIDs.
The use of this method is in general discouraged in favor of 'get<CustomAttribute>(dialect)'.
Definition at line 52 of file AttributeSupport.h.
|
inline |
Return the dialect this attribute was registered to.
Definition at line 60 of file AttributeSupport.h.
|
inline |
Returns an instance of the concept object for the given interface if it was registered to this attribute, null otherwise.
This should not be used directly.
Definition at line 66 of file AttributeSupport.h.
|
inline |
Return the unique identifier representing the concrete attribute class.
Definition at line 86 of file AttributeSupport.h.
|
inline |
Returns true if the attribute has the interface with the given ID registered.
Definition at line 72 of file AttributeSupport.h.
|
inline |
Returns true if the attribute has a particular trait.
Definition at line 78 of file AttributeSupport.h.
Referenced by mlir::Attribute::hasTrait().
|
inline |
Returns true if the attribute has a particular trait.
Definition at line 83 of file AttributeSupport.h.
|
static |
Look up the specified abstract attribute in the MLIRContext and return a reference to it.
Get the dialect that registered the attribute with the provided typeid.
Definition at line 631 of file MLIRContext.cpp.
References mlir::MLIRContext::getImpl().
Referenced by mlir::MLIRContext::getAttributeUniquer().
|
friend |
Give StorageUserBase access to the mutable lookup.
Definition at line 97 of file AttributeSupport.h.