MLIR 23.0.0git
mlir::tblgen::AttrOrTypeParameter Class Reference

A wrapper class for tblgen AttrOrTypeParameter, arrays of which belong to AttrOrTypeDefs to parameterize them. More...

#include "mlir/TableGen/AttrOrTypeDef.h"

Inheritance diagram for mlir::tblgen::AttrOrTypeParameter:

Public Member Functions

 AttrOrTypeParameter (const llvm::DagInit *def, unsigned index)
bool isAnonymous () const
 Returns true if the parameter is anonymous (has no name).
StringRef getName () const
 Get the parameter name.
std::string getAccessorName () const
 Get the parameter accessor name.
std::optional< StringRef > getAllocator () const
 If specified, get the custom allocator code for this parameter.
bool hasCustomComparator () const
 Return true if user defined comparator is specified.
StringRef getComparator () const
 Get the custom comparator code for this parameter or fallback to the default.
StringRef getCppType () const
 Get the C++ type of this parameter.
StringRef getCppAccessorType () const
 Get the C++ accessor type of this parameter.
StringRef getCppStorageType () const
 Get the C++ storage type of this parameter.
StringRef getConvertFromStorage () const
 Get the C++ code to convert from the storage type to the parameter type.
std::optional< StringRef > getParser () const
 Get an optional C++ parameter parser.
std::optional< ConstraintgetConstraint () const
 If this is a type constraint, return it.
std::optional< StringRef > getPrinter () const
 Get an optional C++ parameter printer.
std::optional< StringRef > getSummary () const
 Get a description of this parameter for documentation purposes.
StringRef getSyntax () const
 Get the assembly syntax documentation.
bool isOptional () const
 Returns true if the parameter is optional.
std::optional< StringRef > getDefaultValue () const
 Get the default value of the parameter if it has one.
const llvm::Init * getDef () const
 Return the underlying def of this parameter.
bool operator== (const AttrOrTypeParameter &other) const
 The parameter is pointer-comparable.
bool operator!= (const AttrOrTypeParameter &other) const

Detailed Description

A wrapper class for tblgen AttrOrTypeParameter, arrays of which belong to AttrOrTypeDefs to parameterize them.

Definition at line 54 of file AttrOrTypeDef.h.

Constructor & Destructor Documentation

◆ AttrOrTypeParameter()

mlir::tblgen::AttrOrTypeParameter::AttrOrTypeParameter ( const llvm::DagInit * def,
unsigned index )
inlineexplicit

Member Function Documentation

◆ getAccessorName()

std::string AttrOrTypeParameter::getAccessorName ( ) const

Get the parameter accessor name.

Definition at line 278 of file AttrOrTypeDef.cpp.

References getName().

◆ getAllocator()

std::optional< StringRef > AttrOrTypeParameter::getAllocator ( ) const

If specified, get the custom allocator code for this parameter.

Definition at line 283 of file AttrOrTypeDef.cpp.

◆ getComparator()

StringRef AttrOrTypeParameter::getComparator ( ) const

Get the custom comparator code for this parameter or fallback to the default.

Definition at line 291 of file AttrOrTypeDef.cpp.

◆ getConstraint()

std::optional< Constraint > AttrOrTypeParameter::getConstraint ( ) const

If this is a type constraint, return it.

Definition at line 352 of file AttrOrTypeDef.cpp.

References getDef().

Referenced by mlir::tblgen::AttrOrTypeDef::genVerifyInvariantsImpl().

◆ getConvertFromStorage()

StringRef AttrOrTypeParameter::getConvertFromStorage ( ) const

Get the C++ code to convert from the storage type to the parameter type.

Definition at line 319 of file AttrOrTypeDef.cpp.

◆ getCppAccessorType()

StringRef AttrOrTypeParameter::getCppAccessorType ( ) const

Get the C++ accessor type of this parameter.

Definition at line 311 of file AttrOrTypeDef.cpp.

References getCppType().

◆ getCppStorageType()

StringRef AttrOrTypeParameter::getCppStorageType ( ) const

Get the C++ storage type of this parameter.

Definition at line 315 of file AttrOrTypeDef.cpp.

References getCppType().

◆ getCppType()

StringRef AttrOrTypeParameter::getCppType ( ) const

Get the C++ type of this parameter.

Definition at line 295 of file AttrOrTypeDef.cpp.

References getDef().

Referenced by getCppAccessorType(), getCppStorageType(), and getSyntax().

◆ getDef()

const Init * AttrOrTypeParameter::getDef ( ) const

Return the underlying def of this parameter.

Definition at line 350 of file AttrOrTypeDef.cpp.

Referenced by mlir::tblgen::AttributeSelfTypeParameter::classof(), getConstraint(), getCppType(), and getSyntax().

◆ getDefaultValue()

std::optional< StringRef > AttrOrTypeParameter::getDefaultValue ( ) const

Get the default value of the parameter if it has one.

Definition at line 345 of file AttrOrTypeDef.cpp.

References result.

Referenced by isOptional().

◆ getName()

StringRef AttrOrTypeParameter::getName ( ) const

Get the parameter name.

Definition at line 274 of file AttrOrTypeDef.cpp.

Referenced by getAccessorName().

◆ getParser()

std::optional< StringRef > AttrOrTypeParameter::getParser ( ) const

Get an optional C++ parameter parser.

Definition at line 323 of file AttrOrTypeDef.cpp.

◆ getPrinter()

std::optional< StringRef > AttrOrTypeParameter::getPrinter ( ) const

Get an optional C++ parameter printer.

Definition at line 327 of file AttrOrTypeDef.cpp.

◆ getSummary()

std::optional< StringRef > AttrOrTypeParameter::getSummary ( ) const

Get a description of this parameter for documentation purposes.

Definition at line 331 of file AttrOrTypeDef.cpp.

◆ getSyntax()

StringRef AttrOrTypeParameter::getSyntax ( ) const

Get the assembly syntax documentation.

Definition at line 335 of file AttrOrTypeDef.cpp.

References getCppType(), and getDef().

◆ hasCustomComparator()

bool AttrOrTypeParameter::hasCustomComparator ( ) const

Return true if user defined comparator is specified.

Definition at line 287 of file AttrOrTypeDef.cpp.

◆ isAnonymous()

bool AttrOrTypeParameter::isAnonymous ( ) const

Returns true if the parameter is anonymous (has no name).

Definition at line 270 of file AttrOrTypeDef.cpp.

◆ isOptional()

bool AttrOrTypeParameter::isOptional ( ) const

Returns true if the parameter is optional.

Definition at line 341 of file AttrOrTypeDef.cpp.

References getDefaultValue().

◆ operator!=()

bool mlir::tblgen::AttrOrTypeParameter::operator!= ( const AttrOrTypeParameter & other) const
inline

Definition at line 118 of file AttrOrTypeDef.h.

References AttrOrTypeParameter().

◆ operator==()

bool mlir::tblgen::AttrOrTypeParameter::operator== ( const AttrOrTypeParameter & other) const
inline

The parameter is pointer-comparable.

Definition at line 115 of file AttrOrTypeDef.h.

References AttrOrTypeParameter().


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