|
MLIR 22.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. | |
| 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. | |
| 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. | |
| bool | makesRedundant (const MethodSignature &other) const |
| Determine whether a method with this signature makes a method with other signature redundant. | |
| StringRef | getName () const |
| Get the name of the method. | |
| StringRef | getReturnType () const |
| Get the return type of the method. | |
| unsigned | getNumParameters () const |
| Get the number of parameters. | |
| void | writeDeclTo (raw_indented_ostream &os) const |
| Write the signature as part of a method declaration. | |
| void | writeDefTo (raw_indented_ostream &os, StringRef namePrefix) const |
| Write the signature as part of a method definition. | |
| void | writeTemplateParamsTo (raw_indented_ostream &os) const |
| Write the template parameters of the signature. | |
| template<typename ParamT> | |
| void | addTemplateParam (ParamT param) |
| Add a template parameter. | |
| template<typename ContainerT> | |
| void | addTemplateParams (ContainerT &&container) |
| Add a list of template parameters. | |
This class contains the signature of a C++ method, including the return type.
method name, and method parameters.
|
inline |
Create a method signature with a return type, a method name, and a list of parameters.
Take ownership of the list.
Definition at line 126 of file Class.h.
References mlir::tblgen::stringify().
Referenced by makesRedundant(), MethodSignature(), and MethodSignature().
|
inline |
Create a method signature with a return type, a method name, and a list of parameters.
Definition at line 134 of file Class.h.
References MethodSignature().
|
inline |
Create a method signature with a return type, a method name, and a variadic list of parameters.
Definition at line 142 of file Class.h.
References MethodSignature().
|
inline |
Add a template parameter.
Definition at line 179 of file Class.h.
References mlir::tblgen::stringify().
|
inline |
|
inline |
|
inline |
|
inline |
| 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 76 of file Class.cpp.
References MethodSignature().
| void MethodSignature::writeDeclTo | ( | raw_indented_ostream & | os | ) | const |
Write the signature as part of a method declaration.
Definition at line 81 of file Class.cpp.
References getSpaceAfterType().
| 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 87 of file Class.cpp.
References getSpaceAfterType().
| void MethodSignature::writeTemplateParamsTo | ( | mlir::raw_indented_ostream & | os | ) | const |