|
MLIR 22.0.0git
|
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. | |
| 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. | |
| void | writeDeclTo (raw_indented_ostream &os) const |
| Write the parameter as part of a method declaration. | |
| void | writeDefTo (raw_indented_ostream &os) const |
| Write the parameter as part of a method definition. | |
| StringRef | getType () const |
| Get the C++ type. | |
| StringRef | getName () const |
| Get the C++ parameter name. | |
| bool | hasDefaultValue () const |
| Returns true if the parameter has a default value. | |
| StringRef | getDefaultValue () const |
| Get the default value. | |
| bool | isOptional () const |
| Returns true if the parameter is optional. | |
This class contains a single method parameter for a C++ function.
|
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.
References mlir::tblgen::stringify().
Referenced by MethodParameter().
|
inline |
Create a method parameter with a C++ type, parameter name, and no default value.
Definition at line 59 of file Class.h.
References MethodParameter().
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if the parameter has a default value.
Definition at line 73 of file Class.h.
Referenced by writeDeclTo().
|
inline |
| void MethodParameter::writeDeclTo | ( | raw_indented_ostream & | os | ) | const |
Write the parameter as part of a method declaration.
Definition at line 27 of file Class.cpp.
References getSpaceAfterType(), and hasDefaultValue().
| void MethodParameter::writeDefTo | ( | raw_indented_ostream & | os | ) | const |
Write the parameter as part of a method definition.
Definition at line 35 of file Class.cpp.
References getSpaceAfterType().