MLIR  19.0.0git
Public Member Functions | Protected Attributes | List of all members
mlir::tblgen::AttrOrTypeDef Class Reference

Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them. More...

#include "mlir/TableGen/AttrOrTypeDef.h"

+ Inheritance diagram for mlir::tblgen::AttrOrTypeDef:

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< AttrOrTypeParametergetParameters () 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...
 
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< AttrOrTypeBuildergetBuilders () const
 Returns the builders of this def. More...
 
ArrayRef< TraitgetTraits () 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< AttrOrTypeBuilderbuilders
 The builders of this definition. More...
 
SmallVector< Traittraits
 The traits of this definition. More...
 
SmallVector< AttrOrTypeParameterparameters
 The parameters of this attribute or type. More...
 

Detailed Description

Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them.

Definition at line 143 of file AttrOrTypeDef.h.

Constructor & Destructor Documentation

◆ AttrOrTypeDef()

AttrOrTypeDef::AttrOrTypeDef ( const llvm::Record *  def)
explicit

Member Function Documentation

◆ genAccessors()

bool AttrOrTypeDef::genAccessors ( ) const

Returns true if the accessors based on the parameters should be generated.

Definition at line 179 of file AttrOrTypeDef.cpp.

References def.

Referenced by AttrOrTypeDef().

◆ genStorageClass()

bool AttrOrTypeDef::genStorageClass ( ) const

Returns true if we should generate the storage class.

Definition at line 154 of file AttrOrTypeDef.cpp.

References def.

◆ genVerifyDecl()

bool AttrOrTypeDef::genVerifyDecl ( ) const

Return true if we need to generate the verify declaration and getChecked method.

Definition at line 183 of file AttrOrTypeDef.cpp.

References def.

◆ getAssemblyFormat()

std::optional< StringRef > AttrOrTypeDef::getAssemblyFormat ( ) const

Returns the custom assembly format, if one was specified.

Definition at line 175 of file AttrOrTypeDef.cpp.

References def.

Referenced by AttrOrTypeDef().

◆ getBuilders()

ArrayRef<AttrOrTypeBuilder> mlir::tblgen::AttrOrTypeDef::getBuilders ( ) const
inline

Returns the builders of this def.

Definition at line 215 of file AttrOrTypeDef.h.

References builders.

◆ getCppBaseClassName()

StringRef AttrOrTypeDef::getCppBaseClassName ( ) const

Returns the name of the C++ base class to use when generating this def.

Definition at line 124 of file AttrOrTypeDef.cpp.

References def.

◆ getCppClassName()

StringRef AttrOrTypeDef::getCppClassName ( ) const

Returns the name of the C++ class to generate.

Definition at line 120 of file AttrOrTypeDef.cpp.

References def.

◆ getDef()

const llvm::Record* mlir::tblgen::AttrOrTypeDef::getDef ( ) const
inline

Return the underlying def.

Definition at line 231 of file AttrOrTypeDef.h.

References def.

Referenced by AttrOrTypeDef().

◆ getDescription()

StringRef AttrOrTypeDef::getDescription ( ) const

Definition at line 133 of file AttrOrTypeDef.cpp.

References def.

◆ getDialect()

Dialect AttrOrTypeDef::getDialect ( ) const

Get the dialect for which this def belongs.

Definition at line 113 of file AttrOrTypeDef.cpp.

References def.

◆ getExtraDecls()

std::optional< StringRef > AttrOrTypeDef::getExtraDecls ( ) const

Returns the def's extra class declaration code.

Definition at line 187 of file AttrOrTypeDef.cpp.

References def.

◆ getExtraDefs()

std::optional< StringRef > AttrOrTypeDef::getExtraDefs ( ) const

Returns the def's extra class definition code.

Definition at line 192 of file AttrOrTypeDef.cpp.

References def.

◆ getLoc()

ArrayRef< SMLoc > AttrOrTypeDef::getLoc ( ) const

Get the code location (for error printing).

Definition at line 197 of file AttrOrTypeDef.cpp.

References def.

Referenced by AttrOrTypeDef().

◆ getMnemonic()

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 167 of file AttrOrTypeDef.cpp.

References def.

Referenced by AttrOrTypeDef().

◆ getName()

StringRef AttrOrTypeDef::getName ( ) const

Returns the name of this AttrOrTypeDef record.

Definition at line 118 of file AttrOrTypeDef.cpp.

References def.

Referenced by operator<().

◆ getNumParameters()

unsigned AttrOrTypeDef::getNumParameters ( ) const

Return the number of parameters.

Definition at line 162 of file AttrOrTypeDef.cpp.

References def.

◆ getParameters()

ArrayRef<AttrOrTypeParameter> mlir::tblgen::AttrOrTypeDef::getParameters ( ) const
inline

Get the parameters of this attribute or type.

Definition at line 178 of file AttrOrTypeDef.h.

References parameters.

◆ getStorageClassName()

StringRef AttrOrTypeDef::getStorageClassName ( ) const

Returns the name of the storage class for this def.

Definition at line 146 of file AttrOrTypeDef.cpp.

References def.

◆ getStorageNamespace()

StringRef AttrOrTypeDef::getStorageNamespace ( ) const

Returns the C++ namespace for this def's storage class.

Definition at line 150 of file AttrOrTypeDef.cpp.

References def.

◆ getSummary()

StringRef AttrOrTypeDef::getSummary ( ) const

Definition at line 142 of file AttrOrTypeDef.cpp.

References def.

◆ getTraits()

ArrayRef<Trait> mlir::tblgen::AttrOrTypeDef::getTraits ( ) const
inline

Returns the traits of this def.

Definition at line 218 of file AttrOrTypeDef.h.

References traits.

◆ hasCustomAssemblyFormat()

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 171 of file AttrOrTypeDef.cpp.

References def.

Referenced by AttrOrTypeDef().

◆ hasDescription()

bool AttrOrTypeDef::hasDescription ( ) const

Query functions for the documentation of the def.

Definition at line 128 of file AttrOrTypeDef.cpp.

References def.

◆ hasStorageCustomConstructor()

bool AttrOrTypeDef::hasStorageCustomConstructor ( ) const

Indicates whether or not to generate the storage class constructor.

Definition at line 158 of file AttrOrTypeDef.cpp.

References def.

◆ hasSummary()

bool AttrOrTypeDef::hasSummary ( ) const

Definition at line 137 of file AttrOrTypeDef.cpp.

References def.

◆ operator bool()

mlir::tblgen::AttrOrTypeDef::operator bool ( ) const
inline

Returns whether the AttrOrTypeDef is defined.

Definition at line 228 of file AttrOrTypeDef.h.

References def.

◆ operator<()

bool AttrOrTypeDef::operator< ( const AttrOrTypeDef other) const

Compares two AttrOrTypeDefs by comparing the names of the dialects.

Definition at line 207 of file AttrOrTypeDef.cpp.

References getName().

◆ operator==()

bool AttrOrTypeDef::operator== ( const AttrOrTypeDef other) const

Returns whether two AttrOrTypeDefs are equal by checking the equality of the underlying record.

Definition at line 203 of file AttrOrTypeDef.cpp.

References def.

◆ skipDefaultBuilders()

bool AttrOrTypeDef::skipDefaultBuilders ( ) const

Returns true if the default get/getChecked methods should be skipped during generation.

Definition at line 199 of file AttrOrTypeDef.cpp.

References def.

Member Data Documentation

◆ builders

SmallVector<AttrOrTypeBuilder> mlir::tblgen::AttrOrTypeDef::builders
protected

The builders of this definition.

Definition at line 237 of file AttrOrTypeDef.h.

Referenced by AttrOrTypeDef(), and getBuilders().

◆ def

const llvm::Record* mlir::tblgen::AttrOrTypeDef::def
protected

◆ parameters

SmallVector<AttrOrTypeParameter> mlir::tblgen::AttrOrTypeDef::parameters
protected

The parameters of this attribute or type.

Definition at line 243 of file AttrOrTypeDef.h.

Referenced by AttrOrTypeDef(), and getParameters().

◆ traits

SmallVector<Trait> mlir::tblgen::AttrOrTypeDef::traits
protected

The traits of this definition.

Definition at line 240 of file AttrOrTypeDef.h.

Referenced by AttrOrTypeDef(), and getTraits().


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