Skip to content

Commit 43fdd6e

Browse files
[memprof] Migrate away from PointerUnion::is (NFC) (#122622)
Note that PointerUnion::is 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> In this patch, I'm calling call().getBase() for an instance of PointerUnion. call() alone would return an instance of IndexCall, which wraps PointerUnion. Note that isa<> cannot directly accept an instance of IndexCall, at least without defining CastInfo. 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.
1 parent 3f1486f commit 43fdd6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3610,7 +3610,7 @@ IndexCallsiteContextGraph::cloneFunctionForCallsite(
36103610
// Confirm this matches the CloneNo provided by the caller, which is based on
36113611
// the number of function clones we have.
36123612
assert(CloneNo ==
3613-
(Call.call().is<AllocInfo *>()
3613+
(isa<AllocInfo *>(Call.call().getBase())
36143614
? Call.call().dyn_cast<AllocInfo *>()->Versions.size()
36153615
: Call.call().dyn_cast<CallsiteInfo *>()->Clones.size()));
36163616
// Walk all the instructions in this function. Create a new version for

0 commit comments

Comments
 (0)