[all-commits] [llvm/llvm-project] 57a1e0: [mlir] Decouple enum generation from attributes, a...
Krzysztof Drewniak via All-commits
all-commits at lists.llvm.org
Wed Mar 26 22:19:48 PDT 2025
Branch: refs/heads/users/krzysz00/refactor-enum-enum-attr
Home: https://github.com/llvm/llvm-project
Commit: 57a1e0841847694a14462c4bb16f748176a386e4
https://github.com/llvm/llvm-project/commit/57a1e0841847694a14462c4bb16f748176a386e4
Author: Krzysztof Drewniak <krzysdrewniak at gmail.com>
Date: 2025-03-26 (Wed, 26 Mar 2025)
Changed paths:
M mlir/docs/DefiningDialects/Operations.md
M mlir/include/mlir/IR/EnumAttr.td
M mlir/include/mlir/TableGen/EnumInfo.h
M mlir/lib/TableGen/EnumInfo.cpp
M mlir/lib/TableGen/Pattern.cpp
M mlir/test/Dialect/LLVMIR/func.mlir
M mlir/test/IR/attribute.mlir
M mlir/test/lib/Dialect/Test/TestEnumDefs.td
M mlir/test/mlir-tblgen/enums-gen.td
M mlir/tools/mlir-tblgen/EnumPythonBindingGen.cpp
M mlir/tools/mlir-tblgen/EnumsGen.cpp
M mlir/tools/mlir-tblgen/OpDocGen.cpp
M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
M mlir/utils/spirv/gen_spirv_dialect.py
Log Message:
-----------
[mlir] Decouple enum generation from attributes, adding EnumInfo and EnumCase
This commit pulls apart the inherent attribute dependence of classes
like EnumAttrInfo and EnumAttrCase, factoring them out into simpler
EnumCase and EnumInfo variants. This allows specifying the cases of an
enum without needing to make the cases, or the EnumInfo itself, a
subclass of SignlessIntegerAttrBase.
The existing classes are retained as subclasses of the new ones, both
for backwards compatibility and to allow attribute-specific
information.
In addition, the new BitEnum class changes its default printer/parser
behavior: cases when multiple keywords appear, like having both nuw
and nsw in overflow flags, will no longer be quoted by the operator<<,
and the FieldParser instance will now expect multiple keywords. All
instances of BitEnumAttr retain the old behavior.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list