[all-commits] [llvm/llvm-project] c8b6e5: [mlir] Decouple enum generation from attributes, a...
Krzysztof Drewniak via All-commits
all-commits at lists.llvm.org
Thu Mar 20 23:45:08 PDT 2025
Branch: refs/heads/users/krzysz00/refactor-enum-enum-attr
Home: https://github.com/llvm/llvm-project
Commit: c8b6e563bb079538013cb7949c48c3b8fce5e79d
https://github.com/llvm/llvm-project/commit/c8b6e563bb079538013cb7949c48c3b8fce5e79d
Author: Krzysztof Drewniak <krzysdrewniak at gmail.com>
Date: 2025-03-20 (Thu, 20 Mar 2025)
Changed paths:
M mlir/include/mlir/IR/EnumAttr.td
M mlir/include/mlir/TableGen/Attribute.h
A mlir/include/mlir/TableGen/EnumInfo.h
M mlir/include/mlir/TableGen/Pattern.h
M mlir/lib/TableGen/Attribute.cpp
M mlir/lib/TableGen/CMakeLists.txt
A 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/LLVMIRConversionGen.cpp
M mlir/tools/mlir-tblgen/OpDocGen.cpp
M mlir/tools/mlir-tblgen/OpFormatGen.cpp
M mlir/tools/mlir-tblgen/RewriterGen.cpp
M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
M mlir/tools/mlir-tblgen/TosaUtilsGen.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