Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/IR/FunctionImplementation.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
/// Callback type for `parseFunctionLikeOp`, the callback should produce the | /// Callback type for `parseFunctionLikeOp`, the callback should produce the | ||||
/// type that will be associated with a function-like operation from lists of | /// type that will be associated with a function-like operation from lists of | ||||
/// function arguments and results, VariadicFlag indicates whether the function | /// function arguments and results, VariadicFlag indicates whether the function | ||||
/// should have variadic arguments; in case of error, it may populate the last | /// should have variadic arguments; in case of error, it may populate the last | ||||
/// argument with a message. | /// argument with a message. | ||||
using FuncTypeBuilder = function_ref<Type( | using FuncTypeBuilder = function_ref<Type( | ||||
Builder &, ArrayRef<Type>, ArrayRef<Type>, VariadicFlag, std::string &)>; | Builder &, ArrayRef<Type>, ArrayRef<Type>, VariadicFlag, std::string &)>; | ||||
/// Parses function arguments using `parser`. The `allowVariadic` argument | |||||
/// indicates whether functions with variadic arguments are supported. The | |||||
/// trailing arguments are populated by this function with names, types and | |||||
/// attributes of the arguments. | |||||
ParseResult | |||||
parseFunctionArgumentList(OpAsmParser &parser, bool allowVariadic, | |||||
SmallVectorImpl<OpAsmParser::OperandType> &argNames, | |||||
SmallVectorImpl<Type> &argTypes, | |||||
SmallVectorImpl<NamedAttrList> &argAttrs, | |||||
bool &isVariadic); | |||||
herhut: You could add an option here whether it may have attributes, like `allowAttributes` or… | |||||
/// Parses a function signature using `parser`. The `allowVariadic` argument | /// Parses a function signature using `parser`. The `allowVariadic` argument | ||||
/// indicates whether functions with variadic arguments are supported. The | /// indicates whether functions with variadic arguments are supported. The | ||||
/// trailing arguments are populated by this function with names, types and | /// trailing arguments are populated by this function with names, types and | ||||
/// attributes of the arguments and those of the results. | /// attributes of the arguments and those of the results. | ||||
ParseResult | ParseResult | ||||
parseFunctionSignature(OpAsmParser &parser, bool allowVariadic, | parseFunctionSignature(OpAsmParser &parser, bool allowVariadic, | ||||
SmallVectorImpl<OpAsmParser::OperandType> &argNames, | SmallVectorImpl<OpAsmParser::OperandType> &argNames, | ||||
SmallVectorImpl<Type> &argTypes, | SmallVectorImpl<Type> &argTypes, | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
You could add an option here whether it may have attributes, like allowAttributes or something and then parsing would just fail with a parse error.