[Mlir-commits] [mlir] [LLVMIR] Migrate away from PointerUnion::{is, get} (NFC) (PR #120530)

Nikita Popov llvmlistbot at llvm.org
Thu Dec 19 00:25:22 PST 2024


================
@@ -821,11 +821,11 @@ verifyStructIndices(Type baseGEPType, unsigned indexPos,
 
   return TypeSwitch<Type, LogicalResult>(baseGEPType)
       .Case<LLVMStructType>([&](LLVMStructType structType) -> LogicalResult {
-        if (!indices[indexPos].is<IntegerAttr>())
+        if (!isa<IntegerAttr>(indices[indexPos]))
           return emitOpError() << "expected index " << indexPos
                                << " indexing a struct to be constant";
 
-        int32_t gepIndex = indices[indexPos].get<IntegerAttr>().getInt();
+        int32_t gepIndex = cast<IntegerAttr>(indices[indexPos]).getInt();
----------------
nikic wrote:

Combine isa+cast to dyn_cast?

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


More information about the Mlir-commits mailing list