[Conversion] Migrate away from PointerUnion::{is,get} (NFC) (#122421)

Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.
This commit is contained in:
Kazu Hirata
2025-01-10 15:10:17 -08:00
committed by GitHub
parent 25b90c4ef6
commit 129ec84574
3 changed files with 13 additions and 14 deletions

View File

@@ -124,7 +124,7 @@ static Value getAsLLVMValue(OpBuilder &builder, Location loc,
return builder.create<LLVM::ConstantOp>(loc, intAttr).getResult();
}
return foldResult.get<Value>();
return cast<Value>(foldResult);
}
namespace {