[Mlir-commits] [mlir] [mlir] Improve EnumProp, making it take an EnumInfo (PR #132349)

Jakub Kuderski llvmlistbot at llvm.org
Fri Apr 11 20:42:31 PDT 2025


================
@@ -588,6 +588,8 @@ class EnumProp<EnumInfo enumInfo> : Property<enumInfo.cppType, enumInfo.summary>
     uint64_t rawValue;
     if (::mlir::failed($_reader.readVarInt(rawValue)))
       return ::mlir::failure();
+    if (rawValue >= std::numeric_limits<uint}] # enum.bitwidth # [{_t>::max())
----------------
kuhar wrote:

Either calculate `2^N -1` or use `std::make_unsigned_t<std::underlying_type_t<enum.cppType>>`

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


More information about the Mlir-commits mailing list