MLIR
20.0.0git
|
Class for holding an op's method for C++ code emission. More...
#include "mlir/TableGen/Class.h"
Public Types | |
enum | Properties { None = 0x0 , Static = 0x1 , Constructor = 0x2 , Private = 0x4 , Declaration = 0x8 , Inline = 0x10 , ConstexprValue = 0x20 , Const = 0x40 , Constexpr = ConstexprValue | Inline , StaticDeclaration = Static | Declaration , StaticInline = Static | Inline , ConstInline = Const | Inline , ConstDeclaration = Const | Declaration } |
Properties (qualifiers) of class methods. More... | |
Public Types inherited from mlir::tblgen::ClassDeclarationBase< ClassDeclaration::Method > | |
using | Base = ClassDeclarationBase< DeclKind > |
Public Types inherited from mlir::tblgen::ClassDeclaration | |
enum | Kind { Method , UsingDeclaration , VisibilityDeclaration , Field , ExtraClassDeclaration } |
Kinds for LLVM-style RTTI. More... | |
Public Member Functions | |
template<typename RetTypeT , typename NameT , typename... Args> | |
Method (RetTypeT &&retType, NameT &&name, Properties properties, Args &&...args) | |
Create a method with a return type, a name, method properties, and a some parameters. More... | |
Method (StringRef retType, StringRef name, Properties properties, std::initializer_list< MethodParameter > params) | |
Create a method with a return type, a name, method properties, and a list of parameters. More... | |
Method (Method &&)=default | |
Method & | operator= (Method &&)=default |
MethodBody & | body () |
Get the method body. More... | |
void | setDeprecated (std::optional< StringRef > message) |
Sets or removes the deprecation message of the method. More... | |
bool | isStatic () const |
Returns true if this is a static method. More... | |
bool | isPrivate () const |
Returns true if this is a private method. More... | |
bool | isInline () const |
Returns true if this is an inline method. More... | |
bool | isConstructor () const |
Returns true if this is a constructor. More... | |
bool | isConst () const |
Returns true if this class method is const. More... | |
StringRef | getName () const |
Returns the name of this method. More... | |
StringRef | getReturnType () const |
Returns the return type of this method. More... | |
bool | makesRedundant (const Method &other) const |
Returns if this method makes the other method redundant. More... | |
void | writeDeclTo (raw_indented_ostream &os) const override |
Write the method declaration, including the definition if inline. More... | |
void | writeDefTo (raw_indented_ostream &os, StringRef namePrefix) const override |
Write the method definition. This is a no-op for inline methods. More... | |
template<typename ParamT > | |
void | addTemplateParam (ParamT param) |
Add a template parameter. More... | |
template<typename ContainerT > | |
void | addTemplateParams (ContainerT &&container) |
Add a list of template parameters. More... | |
Public Member Functions inherited from mlir::tblgen::ClassDeclarationBase< ClassDeclaration::Method > | |
ClassDeclarationBase () | |
Public Member Functions inherited from mlir::tblgen::ClassDeclaration | |
virtual | ~ClassDeclaration ()=default |
ClassDeclaration (Kind kind) | |
Create a class declaration with a given kind. More... | |
Kind | getKind () const |
Get the class declaration kind. More... | |
Protected Attributes | |
Properties | properties |
A collection of method properties. More... | |
MethodSignature | methodSignature |
The signature of the method. More... | |
MethodBody | methodBody |
The body of the method, if it has one. More... | |
std::optional< std::string > | deprecationMessage |
Deprecation message if the method is deprecated. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from mlir::tblgen::ClassDeclarationBase< ClassDeclaration::Method > | |
static bool | classof (const ClassDeclaration *other) |
|
inline |
|
inline |
|
default |
void mlir::tblgen::Method::addTemplateParam | ( | ParamT | param | ) |
Add a template parameter.
Definition at line 489 of file Class.h.
References mlir::tblgen::MethodSignature::addTemplateParam(), Inline, methodSignature, and properties.
void mlir::tblgen::Method::addTemplateParams | ( | ContainerT && | container | ) |
Add a list of template parameters.
Definition at line 496 of file Class.h.
References mlir::tblgen::MethodSignature::addTemplateParam(), Inline, methodSignature, and properties.
|
inline |
|
inline |
Returns the name of this method.
Definition at line 371 of file Class.h.
References mlir::tblgen::MethodSignature::getName(), and methodSignature.
|
inline |
Returns the return type of this method.
Definition at line 374 of file Class.h.
References mlir::tblgen::MethodSignature::getReturnType(), and methodSignature.
|
inline |
Returns true if this class method is const.
Definition at line 368 of file Class.h.
References Const, and properties.
Referenced by writeDeclTo().
|
inline |
Returns true if this is a constructor.
Definition at line 365 of file Class.h.
References Constructor, and properties.
|
inline |
Returns true if this is an inline method.
Definition at line 362 of file Class.h.
References Inline, and properties.
Referenced by writeDeclTo().
|
inline |
Returns true if this is a private method.
Definition at line 359 of file Class.h.
References Private, and properties.
|
inline |
Returns true if this is a static method.
Definition at line 356 of file Class.h.
References properties, and Static.
Referenced by writeDeclTo().
|
inline |
Returns if this method makes the other
method redundant.
Definition at line 377 of file Class.h.
References mlir::tblgen::MethodSignature::makesRedundant(), and methodSignature.
|
inline |
Sets or removes the deprecation message of the method.
Definition at line 351 of file Class.h.
References deprecationMessage.
|
overridevirtual |
Write the method declaration, including the definition if inline.
Implements mlir::tblgen::ClassDeclaration.
Reimplemented in mlir::tblgen::Constructor.
Definition at line 128 of file Class.cpp.
References ConstexprValue, deprecationMessage, isConst(), isInline(), isStatic(), methodBody, methodSignature, properties, mlir::tblgen::MethodSignature::writeDeclTo(), mlir::tblgen::MethodSignature::writeTemplateParamsTo(), and mlir::tblgen::MethodBody::writeTo().
|
overridevirtual |
Write the method definition. This is a no-op for inline methods.
Reimplemented from mlir::tblgen::ClassDeclaration.
Reimplemented in mlir::tblgen::Constructor.
|
protected |
Deprecation message if the method is deprecated.
Definition at line 404 of file Class.h.
Referenced by setDeprecated(), and writeDeclTo().
|
protected |
The body of the method, if it has one.
Definition at line 402 of file Class.h.
Referenced by body(), and writeDeclTo().
|
protected |
The signature of the method.
Definition at line 400 of file Class.h.
Referenced by addTemplateParam(), addTemplateParams(), getName(), getReturnType(), makesRedundant(), and writeDeclTo().
|
protected |
A collection of method properties.
Definition at line 398 of file Class.h.
Referenced by addTemplateParam(), addTemplateParams(), isConst(), isConstructor(), isInline(), isPrivate(), isStatic(), and writeDeclTo().