MLIR
20.0.0git
|
Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them. More...
#include "mlir/TableGen/AttrOrTypeDef.h"
Public Member Functions | |
AttrOrTypeDef (const llvm::Record *def) | |
Dialect | getDialect () const |
Get the dialect for which this def belongs. More... | |
StringRef | getName () const |
Returns the name of this AttrOrTypeDef record. More... | |
bool | hasDescription () const |
Query functions for the documentation of the def. More... | |
StringRef | getDescription () const |
bool | hasSummary () const |
StringRef | getSummary () const |
StringRef | getCppClassName () const |
Returns the name of the C++ class to generate. More... | |
StringRef | getCppBaseClassName () const |
Returns the name of the C++ base class to use when generating this def. More... | |
StringRef | getStorageClassName () const |
Returns the name of the storage class for this def. More... | |
StringRef | getStorageNamespace () const |
Returns the C++ namespace for this def's storage class. More... | |
bool | genStorageClass () const |
Returns true if we should generate the storage class. More... | |
bool | hasStorageCustomConstructor () const |
Indicates whether or not to generate the storage class constructor. More... | |
ArrayRef< AttrOrTypeParameter > | getParameters () const |
Get the parameters of this attribute or type. More... | |
unsigned | getNumParameters () const |
Return the number of parameters. More... | |
std::optional< StringRef > | getMnemonic () const |
Return the keyword/mnemonic to use in the printer/parser methods if we are supposed to auto-generate them. More... | |
bool | hasCustomAssemblyFormat () const |
Returns if the attribute or type has a custom assembly format implemented in C++. More... | |
std::optional< StringRef > | getAssemblyFormat () const |
Returns the custom assembly format, if one was specified. More... | |
bool | genAccessors () const |
Returns true if the accessors based on the parameters should be generated. More... | |
bool | genVerifyDecl () const |
Return true if we need to generate the verify declaration and getChecked method. More... | |
bool | genVerifyInvariantsImpl () const |
Return true if we need to generate any type constraint verification and the getChecked method. More... | |
std::optional< StringRef > | getExtraDecls () const |
Returns the def's extra class declaration code. More... | |
std::optional< StringRef > | getExtraDefs () const |
Returns the def's extra class definition code. More... | |
ArrayRef< SMLoc > | getLoc () const |
Get the code location (for error printing). More... | |
bool | skipDefaultBuilders () const |
Returns true if the default get/getChecked methods should be skipped during generation. More... | |
ArrayRef< AttrOrTypeBuilder > | getBuilders () const |
Returns the builders of this def. More... | |
ArrayRef< Trait > | getTraits () const |
Returns the traits of this def. More... | |
bool | operator== (const AttrOrTypeDef &other) const |
Returns whether two AttrOrTypeDefs are equal by checking the equality of the underlying record. More... | |
bool | operator< (const AttrOrTypeDef &other) const |
Compares two AttrOrTypeDefs by comparing the names of the dialects. More... | |
operator bool () const | |
Returns whether the AttrOrTypeDef is defined. More... | |
const llvm::Record * | getDef () const |
Return the underlying def. More... | |
Protected Attributes | |
const llvm::Record * | def |
SmallVector< AttrOrTypeBuilder > | builders |
The builders of this definition. More... | |
SmallVector< Trait > | traits |
The traits of this definition. More... | |
SmallVector< AttrOrTypeParameter > | parameters |
The parameters of this attribute or type. More... | |
Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them.
Definition at line 147 of file AttrOrTypeDef.h.
|
explicit |
Definition at line 44 of file AttrOrTypeDef.cpp.
References builders, mlir::tblgen::Trait::create(), def, genAccessors(), getAssemblyFormat(), getDef(), getLoc(), getMnemonic(), mlir::tblgen::Builder::getParameters(), hasCustomAssemblyFormat(), parameters, and traits.
bool AttrOrTypeDef::genAccessors | ( | ) | const |
Returns true if the accessors based on the parameters should be generated.
Definition at line 184 of file AttrOrTypeDef.cpp.
References def.
Referenced by AttrOrTypeDef().
bool AttrOrTypeDef::genStorageClass | ( | ) | const |
Returns true if we should generate the storage class.
Definition at line 159 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::genVerifyDecl | ( | ) | const |
Return true if we need to generate the verify declaration and getChecked method.
Definition at line 188 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::genVerifyInvariantsImpl | ( | ) | const |
Return true if we need to generate any type constraint verification and the getChecked method.
Definition at line 192 of file AttrOrTypeDef.cpp.
References mlir::tblgen::AttrOrTypeParameter::getConstraint(), and parameters.
std::optional< StringRef > AttrOrTypeDef::getAssemblyFormat | ( | ) | const |
Returns the custom assembly format, if one was specified.
Definition at line 180 of file AttrOrTypeDef.cpp.
References def.
Referenced by AttrOrTypeDef().
|
inline |
Returns the builders of this def.
Definition at line 223 of file AttrOrTypeDef.h.
References builders.
StringRef AttrOrTypeDef::getCppBaseClassName | ( | ) | const |
Returns the name of the C++ base class to use when generating this def.
Definition at line 129 of file AttrOrTypeDef.cpp.
References def.
StringRef AttrOrTypeDef::getCppClassName | ( | ) | const |
Returns the name of the C++ class to generate.
Definition at line 125 of file AttrOrTypeDef.cpp.
References def.
|
inline |
Return the underlying def.
Definition at line 239 of file AttrOrTypeDef.h.
References def.
Referenced by AttrOrTypeDef().
StringRef AttrOrTypeDef::getDescription | ( | ) | const |
Definition at line 138 of file AttrOrTypeDef.cpp.
References def.
Dialect AttrOrTypeDef::getDialect | ( | ) | const |
Get the dialect for which this def belongs.
Definition at line 118 of file AttrOrTypeDef.cpp.
References def.
std::optional< StringRef > AttrOrTypeDef::getExtraDecls | ( | ) | const |
Returns the def's extra class declaration code.
Definition at line 198 of file AttrOrTypeDef.cpp.
References def.
std::optional< StringRef > AttrOrTypeDef::getExtraDefs | ( | ) | const |
Returns the def's extra class definition code.
Definition at line 203 of file AttrOrTypeDef.cpp.
References def.
ArrayRef< SMLoc > AttrOrTypeDef::getLoc | ( | ) | const |
Get the code location (for error printing).
Definition at line 208 of file AttrOrTypeDef.cpp.
References def.
Referenced by AttrOrTypeDef().
std::optional< StringRef > AttrOrTypeDef::getMnemonic | ( | ) | const |
Return the keyword/mnemonic to use in the printer/parser methods if we are supposed to auto-generate them.
Definition at line 172 of file AttrOrTypeDef.cpp.
References def.
Referenced by AttrOrTypeDef().
StringRef AttrOrTypeDef::getName | ( | ) | const |
Returns the name of this AttrOrTypeDef record.
Definition at line 123 of file AttrOrTypeDef.cpp.
References def.
Referenced by operator<().
unsigned AttrOrTypeDef::getNumParameters | ( | ) | const |
|
inline |
Get the parameters of this attribute or type.
Definition at line 182 of file AttrOrTypeDef.h.
References parameters.
StringRef AttrOrTypeDef::getStorageClassName | ( | ) | const |
Returns the name of the storage class for this def.
Definition at line 151 of file AttrOrTypeDef.cpp.
References def.
StringRef AttrOrTypeDef::getStorageNamespace | ( | ) | const |
Returns the C++ namespace for this def's storage class.
Definition at line 155 of file AttrOrTypeDef.cpp.
References def.
StringRef AttrOrTypeDef::getSummary | ( | ) | const |
Definition at line 147 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::hasCustomAssemblyFormat | ( | ) | const |
Returns if the attribute or type has a custom assembly format implemented in C++.
Corresponds to the hasCustomAssemblyFormat
field.
Definition at line 176 of file AttrOrTypeDef.cpp.
References def.
Referenced by AttrOrTypeDef().
bool AttrOrTypeDef::hasDescription | ( | ) | const |
Query functions for the documentation of the def.
Definition at line 133 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::hasStorageCustomConstructor | ( | ) | const |
Indicates whether or not to generate the storage class constructor.
Definition at line 163 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::hasSummary | ( | ) | const |
Definition at line 142 of file AttrOrTypeDef.cpp.
References def.
|
inline |
Returns whether the AttrOrTypeDef is defined.
Definition at line 236 of file AttrOrTypeDef.h.
References def.
bool AttrOrTypeDef::operator< | ( | const AttrOrTypeDef & | other | ) | const |
Compares two AttrOrTypeDefs by comparing the names of the dialects.
Definition at line 218 of file AttrOrTypeDef.cpp.
References getName().
bool AttrOrTypeDef::operator== | ( | const AttrOrTypeDef & | other | ) | const |
Returns whether two AttrOrTypeDefs are equal by checking the equality of the underlying record.
Definition at line 214 of file AttrOrTypeDef.cpp.
References def.
bool AttrOrTypeDef::skipDefaultBuilders | ( | ) | const |
Returns true if the default get/getChecked methods should be skipped during generation.
Definition at line 210 of file AttrOrTypeDef.cpp.
References def.
|
protected |
The builders of this definition.
Definition at line 245 of file AttrOrTypeDef.h.
Referenced by AttrOrTypeDef(), and getBuilders().
|
protected |
Definition at line 242 of file AttrOrTypeDef.h.
Referenced by AttrOrTypeDef(), mlir::tblgen::AttrDef::classof(), mlir::tblgen::TypeDef::classof(), genAccessors(), genStorageClass(), genVerifyDecl(), getAssemblyFormat(), mlir::tblgen::AttrDef::getAttrName(), getCppBaseClassName(), getCppClassName(), getDef(), getDescription(), getDialect(), getExtraDecls(), getExtraDefs(), getLoc(), getMnemonic(), getName(), getNumParameters(), getStorageClassName(), getStorageNamespace(), getSummary(), mlir::tblgen::AttrDef::getTypeBuilder(), mlir::tblgen::TypeDef::getTypeName(), hasCustomAssemblyFormat(), hasDescription(), hasStorageCustomConstructor(), hasSummary(), operator bool(), operator==(), and skipDefaultBuilders().
|
protected |
The parameters of this attribute or type.
Definition at line 251 of file AttrOrTypeDef.h.
Referenced by AttrOrTypeDef(), genVerifyInvariantsImpl(), and getParameters().
|
protected |
The traits of this definition.
Definition at line 248 of file AttrOrTypeDef.h.
Referenced by AttrOrTypeDef(), and getTraits().