My Project
Public Types | Public Member Functions | List of all members
mlir::NamedAttributeList Class Reference

#include <Attributes.h>

Public Types

enum  RemoveResult { RemoveResult::Removed, RemoveResult::NotFound }
 

Public Member Functions

 NamedAttributeList (DictionaryAttr attrs=nullptr)
 
 NamedAttributeList (ArrayRef< NamedAttribute > attributes)
 
bool operator!= (const NamedAttributeList &other) const
 
bool operator== (const NamedAttributeList &other) const
 
DictionaryAttr getDictionary () const
 
ArrayRef< NamedAttributegetAttrs () const
 Return all of the attributes on this operation. More...
 
void setAttrs (ArrayRef< NamedAttribute > attributes)
 Replace the held attributes with ones provided in 'newAttrs'. More...
 
Attribute get (StringRef name) const
 Return the specified attribute if present, null otherwise. More...
 
Attribute get (Identifier name) const
 Return the specified attribute if present, null otherwise. More...
 
void set (Identifier name, Attribute value)
 
RemoveResult remove (Identifier name)
 

Detailed Description

A NamedAttributeList is used to manage a list of named attributes. This provides simple interfaces for adding/removing/finding attributes from within a DictionaryAttr.

We assume there will be relatively few attributes on a given operation (maybe a dozen or so, but not hundreds or thousands) so we use linear searches for everything.

Member Enumeration Documentation

◆ RemoveResult

Enumerator
Removed 
NotFound 

Constructor & Destructor Documentation

◆ NamedAttributeList() [1/2]

mlir::NamedAttributeList::NamedAttributeList ( DictionaryAttr  attrs = nullptr)
inline

◆ NamedAttributeList() [2/2]

NamedAttributeList::NamedAttributeList ( ArrayRef< NamedAttribute attributes)

Member Function Documentation

◆ get() [1/2]

Attribute NamedAttributeList::get ( StringRef  name) const

Return the specified attribute if present, null otherwise.

◆ get() [2/2]

Attribute NamedAttributeList::get ( Identifier  name) const

Return the specified attribute if present, null otherwise.

◆ getAttrs()

ArrayRef< NamedAttribute > NamedAttributeList::getAttrs ( ) const

Return all of the attributes on this operation.

◆ getDictionary()

DictionaryAttr mlir::NamedAttributeList::getDictionary ( ) const
inline

Return the underlying dictionary attribute. This may be null, if this list has no attributes.

◆ operator!=()

bool mlir::NamedAttributeList::operator!= ( const NamedAttributeList other) const
inline

◆ operator==()

bool mlir::NamedAttributeList::operator== ( const NamedAttributeList other) const
inline

◆ remove()

auto NamedAttributeList::remove ( Identifier  name)

Remove the attribute with the specified name if it exists. The return value indicates whether the attribute was present or not.

◆ set()

void NamedAttributeList::set ( Identifier  name,
Attribute  value 
)

If the an attribute exists with the specified name, change it to the new value. Otherwise, add a new attribute with the specified name/value.

◆ setAttrs()

void NamedAttributeList::setAttrs ( ArrayRef< NamedAttribute attributes)

Replace the held attributes with ones provided in 'newAttrs'.


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