15 Type &resultType,
bool resultOptional) {
16 argumentType = resultType =
nullptr;
20 if (!resultOptional && !hasLParen)
22 if (parser.
parseType(argumentType).failed())
34 argumentType =
nullptr;
36 if (parser.
parseType(argumentType).failed())
48 resultTypes.push_back(type);
61 if (!resultType.empty())
63 printer << argumentType;
64 if (resultType.empty())
68 if (resultType.size() > 1)
70 llvm::interleaveComma(resultType, printer.
getStream());
71 if (resultType.size() > 1)
77 bool resultOptional) {
78 assert(resultOptional || resultType !=
nullptr);
virtual ParseResult parseRParen()=0
Parse a ) token.
virtual ParseResult parseArrow()=0
Parse a '->' token.
virtual ParseResult parseLParen()=0
Parse a ( token.
virtual ParseResult parseType(Type &result)=0
Parse a type.
virtual ParseResult parseOptionalLParen()=0
Parse a ( token if present.
ParseResult parseTypeList(SmallVectorImpl< Type > &result)
Parse a type list.
virtual raw_ostream & getStream() const
Return the raw output stream used by this printer.
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Operation is the basic unit of execution within MLIR.
This class provides an abstraction over the various different ranges of value types.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Include the generated interface declarations.
ParseResult parseSemiFunctionType(OpAsmParser &parser, Type &argumentType, Type &resultType, bool resultOptional=true)
Parses a single non-function type or a function type with at least one argument.
void printSemiFunctionType(OpAsmPrinter &printer, Operation *op, Type argumentType, TypeRange resultType)
Prints argument and result types in a syntax similar to that of FunctionType but allowing and requiri...