llvm-project/mlir/lib/Parser
Jeremy Furtek a266a21000 [mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes
This diff allows the EnumAttr class to be used for bit enum attributes (in
addition to previously supported integer enum attributes). While integer
and bit enum attributes share many common implementation aspects, parsing
bit enum values requires a separate implementation. This is accomplished
by creating empty parser and printer strings in the EnumAttrInfo record,
and having derived classes (specific to bit and integer enums) override with
an appropriate parser/printer string.

To support existing bit enums that may use a vertical bar separator, the
parser is modified to support the | token.

Tests were added for bit enums alongside integer enums.

Future diffs for fastmath attributes in the arithmetic dialect will use these
changes.

(resubmission of earlier abaondoned diff, updated to reflect subsequent changes
in the repository)

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D123880
2022-04-25 19:00:00 +00:00
..
AffineParser.cpp Apply clang-tidy fixes for modernize-use-default-member-init to MLIR (NFC) 2022-03-07 10:41:44 +00:00
AsmParserImpl.h [mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes 2022-04-25 19:00:00 +00:00
AsmParserState.cpp [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
AttributeParser.cpp [mlir] Fix two AttributeParser aborts 2022-04-18 09:30:35 -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][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
Lexer.cpp [mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes 2022-04-25 19:00:00 +00:00
Lexer.h [mlir][NFC] Move Parser.h to Parser/ 2022-03-07 01:05:38 -08:00
LocationParser.cpp [mlir] Relax restriction on name location parsing 2021-12-12 08:06:59 -08:00
Parser.cpp [AsmParser/Printer] Rework sourceloc support for function arguments. 2022-04-21 12:43:36 -07:00
Parser.h [mlir] Fix emitting an error at EOF 2022-03-23 20:23:01 +00:00
ParserState.h [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
Token.cpp [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
Token.h [mlir][NFC] Add a using for llvm::SMLoc/llvm::SMRange to LLVM.h 2022-01-26 21:37:23 -08:00
TokenKinds.def [mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes 2022-04-25 19:00:00 +00:00
TypeParser.cpp [mlir] support f80 and f128 in parseOptionalType 2022-03-02 14:56:47 +01:00