llvm-project/mlir/lib/Parser
Jean Perier 49af2a6275 [mlir][flang] Do not prevent integer types from being parsed as MLIR keywords
DialectAsmParser::parseKeyword is rejecting `'i' digit+` while it is
a valid identifier according to mlir/docs/LangRef.md.

Integer types actually used to be TOK_KEYWORD a while back before the
change: 6af866c58d.

This patch Modifies `isCurrentTokenAKeyword` to return true for tokens that
match integer types too.

The motivation for this change is the parsing of `!fir.type<{` `component-name: component-type,`+ `}>`
type in FIR that represent Fortran derived types. The component-names are
parsed as keywords, and can very well be i32 or any ixxx (which are
valid Fortran derived type component names).

The Quant dialect type parser had to be modified since it relied on `iw` not
being parsed as keywords.

Differential Revision: https://reviews.llvm.org/D108913
2021-09-03 08:20:49 +02:00
..
AffineParser.cpp [mlir] support max/min lower/upper bounds in affine.parallel 2021-04-29 13:16:25 +02:00
AsmParserState.cpp [mlir-lsp-server] Add support for textDocument/documentSymbols 2021-06-10 10:58:39 -07:00
AttributeParser.cpp [Builder] Eliminate the StringRef/StringAttr forms of getSymbolRefAttr. 2021-08-30 16:05:36 -07:00
CMakeLists.txt Add a new AsmParserState class to capture detailed source information for .mlir files 2021-04-21 14:44:37 -07:00
DialectSymbolParser.cpp [mlir][flang] Do not prevent integer types from being parsed as MLIR keywords 2021-09-03 08:20:49 +02:00
Lexer.cpp [Reland] [mlir] Speed up Lexer::getEncodedSourceLocation 2021-05-19 12:57:18 -07:00
Lexer.h Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
LocationParser.cpp [mlir][IR][NFC] Define the Location classes in ODS instead of C++ 2021-03-08 14:32:40 -08:00
Parser.cpp Add a new interface allowing to set a default dialect to be used for printing/parsing regions 2021-08-31 17:52:40 +00:00
Parser.h [OpAsmParser] Refactor parseOptionalInteger to support wide integers, NFC. 2021-05-10 22:35:42 -07:00
ParserState.h Add a new interface allowing to set a default dialect to be used for printing/parsing regions 2021-08-31 17:52:40 +00:00
Token.cpp [AsmParser] Fix support for zero bit integer types. 2020-12-12 21:24:18 -08:00
Token.h [mlir] Optimize the parsing of ElementsAttr hex strings 2020-10-28 16:58:06 -07:00
TokenKinds.def [mlir] Add better support for f80 and f128 2021-01-15 10:29:48 -05:00
TypeParser.cpp [mlir][tensors] Introduce attribute interface/attribute for tensor encoding 2021-04-26 18:31:54 -07:00