|
MLIR 22.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 |
| 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. | |
| 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. | |
| Method (Method &&)=default | |
| Method & | operator= (Method &&)=default |
| MethodBody & | body () |
| Get the method body. | |
| void | setDeprecated (std::optional< StringRef > message) |
| Sets or removes the deprecation message of the method. | |
| bool | isStatic () const |
| Returns true if this is a static method. | |
| bool | isPrivate () const |
| Returns true if this is a private method. | |
| bool | isInline () const |
| Returns true if this is an inline method. | |
| bool | isConstructor () const |
| Returns true if this is a constructor. | |
| bool | isConst () const |
| Returns true if this class method is const. | |
| StringRef | getName () const |
| Returns the name of this method. | |
| StringRef | getReturnType () const |
| Returns the return type of this method. | |
| bool | makesRedundant (const Method &other) const |
| Returns if this method makes the other method redundant. | |
| void | writeDeclTo (raw_indented_ostream &os) const override |
| Write the method declaration, including the definition if inline. | |
| void | writeDefTo (raw_indented_ostream &os, StringRef namePrefix) const override |
| Write the method definition. This is a no-op for inline methods. | |
| template<typename ParamT> | |
| void | addTemplateParam (ParamT param) |
| Add a template parameter. | |
| template<typename ContainerT> | |
| void | addTemplateParams (ContainerT &&container) |
| Add a list of template parameters. | |
| 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. | |
| Kind | getKind () const |
| Get the class declaration kind. | |
Static Protected Member Functions | |
| static bool | methodPropertiesAreCompatible (Properties properties) |
| Utility method to verify method properties correctness. | |
Protected Attributes | |
| Properties | properties |
| A collection of method properties. | |
| MethodSignature | methodSignature |
| The signature of the method. | |
| MethodBody | methodBody |
| The body of the method, if it has one. | |
| std::optional< std::string > | deprecationMessage |
| Deprecation message if the method is deprecated. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from mlir::tblgen::ClassDeclarationBase< ClassDeclaration::Method > | |
| static bool | classof (const ClassDeclaration *other) |
Properties (qualifiers) of class methods.
Bitfield is used here to help querying properties.
| Enumerator | |
|---|---|
| None | |
| Static | |
| Constructor | |
| Private | |
| Declaration | |
| Inline | |
| ConstexprValue | |
| Const | |
| Constexpr | |
| StaticDeclaration | |
| StaticInline | |
| ConstInline | |
| ConstDeclaration | |
|
inline |
Create a method with a return type, a name, method properties, and a some parameters.
The parameteres may be passed as a list or as a variadic pack.
Definition at line 334 of file Class.h.
References Declaration, methodBody, methodPropertiesAreCompatible(), methodSignature, and properties.
Referenced by mlir::tblgen::Constructor::Constructor(), makesRedundant(), Method(), and operator=().
|
inline |
Create a method with a return type, a name, method properties, and a list of parameters.
Definition at line 347 of file Class.h.
References Declaration, methodBody, methodPropertiesAreCompatible(), methodSignature, and properties.
| void mlir::tblgen::Method::addTemplateParam | ( | ParamT | param | ) |
Add a template parameter.
Definition at line 507 of file Class.h.
References Inline, methodSignature, and properties.
| void mlir::tblgen::Method::addTemplateParams | ( | ContainerT && | container | ) |
Add a list of template parameters.
Definition at line 514 of file Class.h.
References Inline, methodSignature, and properties.
|
inline |
|
inline |
Returns the name of this method.
Definition at line 385 of file Class.h.
References methodSignature.
|
inline |
Returns the return type of this method.
Definition at line 388 of file Class.h.
References methodSignature.
|
inline |
Returns true if this class method is const.
Definition at line 382 of file Class.h.
References Const, and properties.
Referenced by methodPropertiesAreCompatible(), writeDeclTo(), and writeDefTo().
|
inline |
Returns true if this is a constructor.
Definition at line 379 of file Class.h.
References Constructor, and properties.
Referenced by methodPropertiesAreCompatible().
|
inline |
Returns true if this is an inline method.
Definition at line 376 of file Class.h.
References Inline, and properties.
Referenced by methodPropertiesAreCompatible(), mlir::tblgen::Constructor::writeDeclTo(), writeDeclTo(), mlir::tblgen::Constructor::writeDefTo(), and writeDefTo().
|
inline |
Returns true if this is a private method.
Definition at line 373 of file Class.h.
References Private, and properties.
|
inline |
Returns true if this is a static method.
Definition at line 370 of file Class.h.
References properties, and Static.
Referenced by methodPropertiesAreCompatible(), and writeDeclTo().
Returns if this method makes the other method redundant.
Definition at line 391 of file Class.h.
References Method(), and methodSignature.
|
staticprotected |
Utility method to verify method properties correctness.
Definition at line 162 of file Class.cpp.
References Const, ConstexprValue, Constructor, Declaration, Inline, isConst(), isConstructor(), isInline(), isStatic(), properties, and Static.
|
inline |
Sets or removes the deprecation message of the method.
Definition at line 365 of file Class.h.
References deprecationMessage.
|
overridevirtual |
Write the method declaration, including the definition if inline.
Implements mlir::tblgen::ClassDeclaration.
Definition at line 126 of file Class.cpp.
References ConstexprValue, deprecationMessage, isConst(), isInline(), isStatic(), methodBody, methodSignature, and properties.
|
overridevirtual |
Write the method definition. This is a no-op for inline methods.
Reimplemented from mlir::tblgen::ClassDeclaration.
Definition at line 149 of file Class.cpp.
References Declaration, isConst(), isInline(), methodBody, methodSignature, and properties.
|
protected |
Deprecation message if the method is deprecated.
Definition at line 418 of file Class.h.
Referenced by setDeprecated(), and writeDeclTo().
|
protected |
The body of the method, if it has one.
Definition at line 416 of file Class.h.
Referenced by body(), Method(), Method(), mlir::tblgen::Constructor::writeDeclTo(), writeDeclTo(), mlir::tblgen::Constructor::writeDefTo(), and writeDefTo().
|
protected |
The signature of the method.
Definition at line 414 of file Class.h.
Referenced by addTemplateParam(), addTemplateParams(), getName(), getReturnType(), makesRedundant(), Method(), Method(), mlir::tblgen::Constructor::writeDeclTo(), writeDeclTo(), mlir::tblgen::Constructor::writeDefTo(), and writeDefTo().
|
protected |
A collection of method properties.
Definition at line 412 of file Class.h.
Referenced by addTemplateParam(), addTemplateParams(), mlir::tblgen::Constructor::Constructor(), isConst(), isConstructor(), isInline(), isPrivate(), isStatic(), Method(), Method(), methodPropertiesAreCompatible(), mlir::tblgen::Constructor::writeDeclTo(), writeDeclTo(), mlir::tblgen::Constructor::writeDefTo(), and writeDefTo().