[Mlir-commits] [mlir] [TableGen] Use getValue instead of getInt for enum attributes (PR #144030)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Jun 20 02:56:30 PDT 2025


================
@@ -39,8 +39,9 @@ class EnumCase<string sym, int intVal, string strVal, int widthVal> {
 class IntEnumAttrCaseBase<I intType, string sym, string strVal, int intVal> :
     EnumCase<sym, intVal, strVal, intType.bitwidth>,
     SignlessIntegerAttrBase<intType, "case " # strVal> {
-  let predicate =
-    CPred<"::llvm::cast<::mlir::IntegerAttr>($_self).getInt() == " # intVal>;
+  let predicate = CPred<
+      "::llvm::cast<::mlir::IntegerAttr>($_self).getValue().eq(::llvm::APInt("#intType
----------------
ftynse wrote:

Nit: you can use `[{ }]` for multi-line code blocks to make them more readable.

https://github.com/llvm/llvm-project/pull/144030


More information about the Mlir-commits mailing list