MLIR  20.0.0git
Public Member Functions | List of all members
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). More...
 
StringRef getName () const
 Get the parameter name. More...
 
std::string getAccessorName () const
 Get the parameter accessor name. More...
 
std::optional< StringRef > getAllocator () const
 If specified, get the custom allocator code for this parameter. More...
 
StringRef getComparator () const
 If specified, get the custom comparator code for this parameter. More...
 
StringRef getCppType () const
 Get the C++ type of this parameter. More...
 
StringRef getCppAccessorType () const
 Get the C++ accessor type of this parameter. More...
 
StringRef getCppStorageType () const
 Get the C++ storage type of this parameter. More...
 
StringRef getConvertFromStorage () const
 Get the C++ code to convert from the storage type to the parameter type. More...
 
std::optional< StringRef > getParser () const
 Get an optional C++ parameter parser. More...
 
std::optional< ConstraintgetConstraint () const
 If this is a type constraint, return it. More...
 
std::optional< StringRef > getPrinter () const
 Get an optional C++ parameter printer. More...
 
std::optional< StringRef > getSummary () const
 Get a description of this parameter for documentation purposes. More...
 
StringRef getSyntax () const
 Get the assembly syntax documentation. More...
 
bool isOptional () const
 Returns true if the parameter is optional. More...
 
std::optional< StringRef > getDefaultValue () const
 Get the default value of the parameter if it has one. More...
 
const llvm::Init * getDef () const
 Return the underlying def of this parameter. More...
 
bool operator== (const AttrOrTypeParameter &other) const
 The parameter is pointer-comparable. More...
 
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

Definition at line 56 of file AttrOrTypeDef.h.

Member Function Documentation

◆ getAccessorName()

std::string AttrOrTypeParameter::getAccessorName ( ) const

Get the parameter accessor name.

Definition at line 272 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 277 of file AttrOrTypeDef.cpp.

◆ getComparator()

StringRef AttrOrTypeParameter::getComparator ( ) const

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

Definition at line 281 of file AttrOrTypeDef.cpp.

◆ getConstraint()

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

If this is a type constraint, return it.

Definition at line 343 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 310 of file AttrOrTypeDef.cpp.

◆ getCppAccessorType()

StringRef AttrOrTypeParameter::getCppAccessorType ( ) const

Get the C++ accessor type of this parameter.

Definition at line 302 of file AttrOrTypeDef.cpp.

References getCppType().

◆ getCppStorageType()

StringRef AttrOrTypeParameter::getCppStorageType ( ) const

Get the C++ storage type of this parameter.

Definition at line 306 of file AttrOrTypeDef.cpp.

References getCppType().

◆ getCppType()

StringRef AttrOrTypeParameter::getCppType ( ) const

Get the C++ type of this parameter.

Definition at line 285 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 341 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 336 of file AttrOrTypeDef.cpp.

Referenced by isOptional().

◆ getName()

StringRef AttrOrTypeParameter::getName ( ) const

Get the parameter name.

Definition at line 268 of file AttrOrTypeDef.cpp.

Referenced by getAccessorName().

◆ getParser()

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

Get an optional C++ parameter parser.

Definition at line 314 of file AttrOrTypeDef.cpp.

◆ getPrinter()

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

Get an optional C++ parameter printer.

Definition at line 318 of file AttrOrTypeDef.cpp.

◆ getSummary()

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

Get a description of this parameter for documentation purposes.

Definition at line 322 of file AttrOrTypeDef.cpp.

◆ getSyntax()

StringRef AttrOrTypeParameter::getSyntax ( ) const

Get the assembly syntax documentation.

Definition at line 326 of file AttrOrTypeDef.cpp.

References getCppType(), and getDef().

◆ isAnonymous()

bool AttrOrTypeParameter::isAnonymous ( ) const

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

Definition at line 264 of file AttrOrTypeDef.cpp.

◆ isOptional()

bool AttrOrTypeParameter::isOptional ( ) const

Returns true if the parameter is optional.

Definition at line 332 of file AttrOrTypeDef.cpp.

References getDefaultValue().

◆ operator!=()

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

Definition at line 114 of file AttrOrTypeDef.h.

◆ operator==()

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

The parameter is pointer-comparable.

Definition at line 111 of file AttrOrTypeDef.h.


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