|
| virtual | ~OpAsmParser () |
| |
| virtual InFlightDiagnostic | emitError (llvm::SMLoc loc, const Twine &message={})=0 |
| | Emit a diagnostic at the specified location and return failure. More...
|
| |
| virtual Builder & | getBuilder () const =0 |
| |
| virtual llvm::SMLoc | getCurrentLocation ()=0 |
| |
| ParseResult | getCurrentLocation (llvm::SMLoc *loc) |
| |
| virtual llvm::SMLoc | getNameLoc () const =0 |
| | Return the location of the original name token. More...
|
| |
| virtual Operation * | parseGenericOperation (Block *insertBlock, Block::iterator insertPt)=0 |
| |
| virtual ParseResult | parseArrow ()=0 |
| | Parse a '->' token. More...
|
| |
| virtual ParseResult | parseOptionalArrow ()=0 |
| | Parse a '->' token if present. More...
|
| |
| virtual ParseResult | parseColon ()=0 |
| | Parse a : token. More...
|
| |
| virtual ParseResult | parseOptionalColon ()=0 |
| | Parse a : token if present. More...
|
| |
| virtual ParseResult | parseComma ()=0 |
| | Parse a , token. More...
|
| |
| virtual ParseResult | parseOptionalComma ()=0 |
| | Parse a , token if present. More...
|
| |
| virtual ParseResult | parseEqual ()=0 |
| | Parse a = token. More...
|
| |
| virtual ParseResult | parseLess ()=0 |
| | Parse a '<' token. More...
|
| |
| virtual ParseResult | parseGreater ()=0 |
| | Parse a '>' token. More...
|
| |
| ParseResult | parseKeyword (StringRef keyword, const Twine &msg="") |
| | Parse a given keyword. More...
|
| |
| ParseResult | parseKeyword (StringRef *keyword) |
| | Parse a keyword into 'keyword'. More...
|
| |
| virtual ParseResult | parseOptionalKeyword (StringRef keyword)=0 |
| | Parse the given keyword if present. More...
|
| |
| virtual ParseResult | parseOptionalKeyword (StringRef *keyword)=0 |
| | Parse a keyword, if present, into 'keyword'. More...
|
| |
| virtual ParseResult | parseLParen ()=0 |
| | Parse a ( token. More...
|
| |
| virtual ParseResult | parseOptionalLParen ()=0 |
| | Parse a ( token if present. More...
|
| |
| virtual ParseResult | parseRParen ()=0 |
| | Parse a ) token. More...
|
| |
| virtual ParseResult | parseOptionalRParen ()=0 |
| | Parse a ) token if present. More...
|
| |
| virtual ParseResult | parseLSquare ()=0 |
| | Parse a [ token. More...
|
| |
| virtual ParseResult | parseOptionalLSquare ()=0 |
| | Parse a [ token if present. More...
|
| |
| virtual ParseResult | parseRSquare ()=0 |
| | Parse a ] token. More...
|
| |
| virtual ParseResult | parseOptionalRSquare ()=0 |
| | Parse a ] token if present. More...
|
| |
| virtual ParseResult | parseOptionalEllipsis ()=0 |
| | Parse a ... token if present;. More...
|
| |
| ParseResult | parseAttribute (Attribute &result, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs) |
| |
| template<typename AttrType > |
| ParseResult | parseAttribute (AttrType &result, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs) |
| | Parse an attribute of a specific kind and type. More...
|
| |
| virtual ParseResult | parseAttribute (Attribute &result, Type type, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs)=0 |
| |
| template<typename AttrType > |
| ParseResult | parseAttribute (AttrType &result, Type type, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs) |
| | Parse an attribute of a specific kind and type. More...
|
| |
| virtual ParseResult | parseOptionalAttrDict (SmallVectorImpl< NamedAttribute > &result)=0 |
| | Parse a named dictionary into 'result' if it is present. More...
|
| |
| virtual ParseResult | parseOptionalAttrDictWithKeyword (SmallVectorImpl< NamedAttribute > &result)=0 |
| |
| ParseResult | parseSymbolName (StringAttr &result, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs) |
| |
| virtual ParseResult | parseOptionalSymbolName (StringAttr &result, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs)=0 |
| |
| virtual ParseResult | parseOperand (OperandType &result)=0 |
| | Parse a single operand. More...
|
| |
| virtual ParseResult | parseOperandList (SmallVectorImpl< OperandType > &result, int requiredOperandCount=-1, Delimiter delimiter=Delimiter::None)=0 |
| |
| ParseResult | parseOperandList (SmallVectorImpl< OperandType > &result, Delimiter delimiter) |
| |
| virtual ParseResult | parseTrailingOperandList (SmallVectorImpl< OperandType > &result, int requiredOperandCount=-1, Delimiter delimiter=Delimiter::None)=0 |
| |
| ParseResult | parseTrailingOperandList (SmallVectorImpl< OperandType > &result, Delimiter delimiter) |
| |
| virtual ParseResult | resolveOperand (const OperandType &operand, Type type, SmallVectorImpl< Value > &result)=0 |
| | Resolve an operand to an SSA value, emitting an error on failure. More...
|
| |
| ParseResult | resolveOperands (ArrayRef< OperandType > operands, Type type, SmallVectorImpl< Value > &result) |
| |
| ParseResult | resolveOperands (ArrayRef< OperandType > operands, ArrayRef< Type > types, llvm::SMLoc loc, SmallVectorImpl< Value > &result) |
| |
| virtual ParseResult | parseAffineMapOfSSAIds (SmallVectorImpl< OperandType > &operands, Attribute &map, StringRef attrName, SmallVectorImpl< NamedAttribute > &attrs)=0 |
| |
| virtual ParseResult | parseRegion (Region ®ion, ArrayRef< OperandType > arguments, ArrayRef< Type > argTypes, bool enableNameShadowing=false)=0 |
| |
| virtual ParseResult | parseOptionalRegion (Region ®ion, ArrayRef< OperandType > arguments, ArrayRef< Type > argTypes, bool enableNameShadowing=false)=0 |
| | Parses a region if present. More...
|
| |
| virtual ParseResult | parseRegionArgument (OperandType &argument)=0 |
| |
| virtual ParseResult | parseRegionArgumentList (SmallVectorImpl< OperandType > &result, int requiredOperandCount=-1, Delimiter delimiter=Delimiter::None)=0 |
| |
| virtual ParseResult | parseRegionArgumentList (SmallVectorImpl< OperandType > &result, Delimiter delimiter) |
| |
| virtual ParseResult | parseOptionalRegionArgument (OperandType &argument)=0 |
| | Parse a region argument if present. More...
|
| |
| virtual ParseResult | parseSuccessorAndUseList (Block *&dest, SmallVectorImpl< Value > &operands)=0 |
| | Parse a single operation successor and its operand list. More...
|
| |
| virtual ParseResult | parseType (Type &result)=0 |
| | Parse a type. More...
|
| |
| virtual ParseResult | parseOptionalArrowTypeList (SmallVectorImpl< Type > &result)=0 |
| | Parse an optional arrow followed by a type list. More...
|
| |
| virtual ParseResult | parseColonType (Type &result)=0 |
| | Parse a colon followed by a type. More...
|
| |
| template<typename TypeType > |
| ParseResult | parseColonType (TypeType &result) |
| | Parse a colon followed by a type of a specific kind, e.g. a FunctionType. More...
|
| |
| virtual ParseResult | parseColonTypeList (SmallVectorImpl< Type > &result)=0 |
| | Parse a colon followed by a type list, which must have at least one type. More...
|
| |
| virtual ParseResult | parseOptionalColonTypeList (SmallVectorImpl< Type > &result)=0 |
| |
| ParseResult | parseKeywordType (const char *keyword, Type &result) |
| | Parse a keyword followed by a type. More...
|
| |
| ParseResult | addTypeToList (Type type, SmallVectorImpl< Type > &result) |
| |
| ParseResult | addTypesToList (ArrayRef< Type > types, SmallVectorImpl< Type > &result) |
| |
The OpAsmParser has methods for interacting with the asm parser: parsing things from it, emitting errors etc. It has an intentionally high-level API that is designed to reduce/constrain syntax innovation in individual operations.
For example, consider an op like this:
x = load p[%1, %2] : memref<...>
The "%x = load" tokens are already parsed and therefore invisible to the custom op parser. This can be supported by calling parseOperandList to parse the p, then calling parseOperandList with a SquareDelimiter to parse the indices, then calling parseColonTypeList to parse the result type.