MLIR
20.0.0git
|
This class contains the signature of a C++ method, including the return type. More...
#include "mlir/TableGen/Class.h"
Public Member Functions | |
template<typename RetTypeT , typename NameT > | |
MethodSignature (RetTypeT &&retType, NameT &&name, SmallVector< MethodParameter > &¶meters) | |
Create a method signature with a return type, a method name, and a list of parameters. More... | |
template<typename RetTypeT , typename NameT > | |
MethodSignature (RetTypeT &&retType, NameT &&name, ArrayRef< MethodParameter > parameters) | |
Create a method signature with a return type, a method name, and a list of parameters. More... | |
template<typename RetTypeT , typename NameT , typename... Parameters> | |
MethodSignature (RetTypeT &&retType, NameT &&name, Parameters &&...parameters) | |
Create a method signature with a return type, a method name, and a variadic list of parameters. More... | |
bool | makesRedundant (const MethodSignature &other) const |
Determine whether a method with this signature makes a method with other signature redundant. More... | |
StringRef | getName () const |
Get the name of the method. More... | |
StringRef | getReturnType () const |
Get the return type of the method. More... | |
unsigned | getNumParameters () const |
Get the number of parameters. More... | |
void | writeDeclTo (raw_indented_ostream &os) const |
Write the signature as part of a method declaration. More... | |
void | writeDefTo (raw_indented_ostream &os, StringRef namePrefix) const |
Write the signature as part of a method definition. More... | |
void | writeTemplateParamsTo (raw_indented_ostream &os) const |
Write the template parameters of the signature. 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... | |
This class contains the signature of a C++ method, including the return type.
method name, and method parameters.
|
inline |
|
inline |
|
inline |
|
inline |
Add a template parameter.
Definition at line 175 of file Class.h.
References mlir::tblgen::stringify().
Referenced by mlir::tblgen::Method::addTemplateParam(), and mlir::tblgen::Method::addTemplateParams().
|
inline |
|
inline |
Get the name of the method.
Definition at line 154 of file Class.h.
Referenced by mlir::tblgen::Method::getName().
|
inline |
Get the number of parameters.
Definition at line 160 of file Class.h.
References mlir::tblgen::MethodParameters::getNumParameters().
|
inline |
Get the return type of the method.
Definition at line 157 of file Class.h.
Referenced by mlir::tblgen::Method::getReturnType().
bool MethodSignature::makesRedundant | ( | const MethodSignature & | other | ) | const |
Determine whether a method with this signature makes a method with other
signature redundant.
This occurs if the signatures have the same name and this signature's parameteres subsume the other's.
A method that makes another method redundant with a different return type can replace the other, the assumption being that the subsuming method provides a more resolved return type, e.g. IntegerAttr vs. Attribute.
Definition at line 78 of file Class.cpp.
References mlir::tblgen::MethodParameters::subsumes().
Referenced by mlir::tblgen::Method::makesRedundant().
void MethodSignature::writeDeclTo | ( | raw_indented_ostream & | os | ) | const |
Write the signature as part of a method declaration.
Definition at line 83 of file Class.cpp.
References getSpaceAfterType(), and mlir::tblgen::MethodParameters::writeDeclTo().
Referenced by mlir::tblgen::Method::writeDeclTo().
void MethodSignature::writeDefTo | ( | raw_indented_ostream & | os, |
StringRef | namePrefix | ||
) | const |
Write the signature as part of a method definition.
namePrefix
is to be prepended to the method name (typically namespaces for qualifying the method definition).
Definition at line 89 of file Class.cpp.
References getSpaceAfterType(), and mlir::tblgen::MethodParameters::writeDefTo().
void MethodSignature::writeTemplateParamsTo | ( | mlir::raw_indented_ostream & | os | ) | const |
Write the template parameters of the signature.
Definition at line 97 of file Class.cpp.
Referenced by mlir::tblgen::Method::writeDeclTo().