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

This class contains a single method parameter for a C++ function. More...

#include "mlir/TableGen/Class.h"

Public Member Functions

template<typename TypeT , typename NameT , typename DefaultT >
 MethodParameter (TypeT &&type, NameT &&name, DefaultT &&defaultValue, bool optional=false)
 Create a method parameter with a C++ type, parameter name, and an optional default value. More...
 
template<typename TypeT , typename NameT >
 MethodParameter (TypeT &&type, NameT &&name, bool optional=false)
 Create a method parameter with a C++ type, parameter name, and no default value. More...
 
void writeDeclTo (raw_indented_ostream &os) const
 Write the parameter as part of a method declaration. More...
 
void writeDefTo (raw_indented_ostream &os) const
 Write the parameter as part of a method definition. More...
 
StringRef getType () const
 Get the C++ type. More...
 
bool hasDefaultValue () const
 Returns true if the parameter has a default value. More...
 

Detailed Description

This class contains a single method parameter for a C++ function.

Definition at line 43 of file Class.h.

Constructor & Destructor Documentation

◆ MethodParameter() [1/2]

template<typename TypeT , typename NameT , typename DefaultT >
mlir::tblgen::MethodParameter::MethodParameter ( TypeT &&  type,
NameT &&  name,
DefaultT &&  defaultValue,
bool  optional = false 
)
inline

Create a method parameter with a C++ type, parameter name, and an optional default value.

Marking a parameter as "optional" is a cosmetic effect on the generated code.

Definition at line 49 of file Class.h.

◆ MethodParameter() [2/2]

template<typename TypeT , typename NameT >
mlir::tblgen::MethodParameter::MethodParameter ( TypeT &&  type,
NameT &&  name,
bool  optional = false 
)
inline

Create a method parameter with a C++ type, parameter name, and no default value.

Definition at line 59 of file Class.h.

Member Function Documentation

◆ getType()

StringRef mlir::tblgen::MethodParameter::getType ( ) const
inline

Get the C++ type.

Definition at line 69 of file Class.h.

◆ hasDefaultValue()

bool mlir::tblgen::MethodParameter::hasDefaultValue ( ) const
inline

Returns true if the parameter has a default value.

Definition at line 71 of file Class.h.

Referenced by writeDeclTo().

◆ writeDeclTo()

void MethodParameter::writeDeclTo ( raw_indented_ostream os) const

Write the parameter as part of a method declaration.

Definition at line 29 of file Class.cpp.

References getSpaceAfterType(), and hasDefaultValue().

◆ writeDefTo()

void MethodParameter::writeDefTo ( raw_indented_ostream os) const

Write the parameter as part of a method definition.

Definition at line 37 of file Class.cpp.

References getSpaceAfterType().


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