MLIR  19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
mlir::tblgen::Constructor Class Reference

#include "mlir/TableGen/Class.h"

+ Inheritance diagram for mlir::tblgen::Constructor:

Classes

class  MemberInitializer
 Initialization of a class field in a constructor. More...
 

Public Member Functions

template<typename NameT , typename... Args>
 Constructor (NameT &&className, Properties properties, Args &&...args)
 Create a constructor for a given class, with method properties, and parameters specified either as a list of a variadic pack. More...
 
template<typename NameT , typename ValueT >
void addMemberInitializer (NameT &&name, ValueT &&value)
 Add member initializer to constructor initializing name with value. More...
 
void writeDeclTo (raw_indented_ostream &os) const override
 Write the declaration of the constructor, and its definition if inline. More...
 
void writeDefTo (raw_indented_ostream &os, StringRef namePrefix) const override
 Write the definition of the constructor if it is not inline. More...
 
- Public Member Functions inherited from mlir::tblgen::Method
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
 
Methodoperator= (Method &&)=default
 
MethodBodybody ()
 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...
 
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...
 

Static Public Member Functions

static bool classof (const ClassDeclaration *other)
 Return true if a method is a constructor. More...
 
- Static Public Member Functions inherited from mlir::tblgen::ClassDeclarationBase< ClassDeclaration::Method >
static bool classof (const ClassDeclaration *other)
 

Additional Inherited Members

- Public Types inherited from mlir::tblgen::Method
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...
 
- Protected Attributes inherited from mlir::tblgen::Method
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...
 

Detailed Description

Definition at line 414 of file Class.h.

Constructor & Destructor Documentation

◆ Constructor()

template<typename NameT , typename... Args>
mlir::tblgen::Constructor::Constructor ( NameT &&  className,
Properties  properties,
Args &&...  args 
)
inline

Create a constructor for a given class, with method properties, and parameters specified either as a list of a variadic pack.

Definition at line 419 of file Class.h.

Member Function Documentation

◆ addMemberInitializer()

template<typename NameT , typename ValueT >
void mlir::tblgen::Constructor::addMemberInitializer ( NameT &&  name,
ValueT &&  value 
)
inline

Add member initializer to constructor initializing name with value.

Definition at line 425 of file Class.h.

References mlir::tblgen::stringify().

◆ classof()

static bool mlir::tblgen::Constructor::classof ( const ClassDeclaration other)
inlinestatic

Return true if a method is a constructor.

Definition at line 438 of file Class.h.

◆ writeDeclTo()

void mlir::tblgen::Constructor::writeDeclTo ( raw_indented_ostream os) const
overridevirtual

Write the declaration of the constructor, and its definition if inline.

Reimplemented from mlir::tblgen::Method.

◆ writeDefTo()

void mlir::tblgen::Constructor::writeDefTo ( raw_indented_ostream os,
StringRef  namePrefix 
) const
overridevirtual

Write the definition of the constructor if it is not inline.

Reimplemented from mlir::tblgen::Method.


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