Skip to content

Commit e0c5a85

Browse files
[memprof] Migrate away from PointerUnion::dyn_cast (NFC) (#124505)
Note that PointerUnion::dyn_cast has 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> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses cast because we know which alternative to expect in the ternary expression.
1 parent 5d24341 commit e0c5a85

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,10 +3598,9 @@ IndexCallsiteContextGraph::cloneFunctionForCallsite(
35983598
// The next clone number is the current size of versions array.
35993599
// Confirm this matches the CloneNo provided by the caller, which is based on
36003600
// the number of function clones we have.
3601-
assert(CloneNo ==
3602-
(isa<AllocInfo *>(Call.call())
3603-
? Call.call().dyn_cast<AllocInfo *>()->Versions.size()
3604-
: Call.call().dyn_cast<CallsiteInfo *>()->Clones.size()));
3601+
assert(CloneNo == (isa<AllocInfo *>(Call.call())
3602+
? cast<AllocInfo *>(Call.call())->Versions.size()
3603+
: cast<CallsiteInfo *>(Call.call())->Clones.size()));
36053604
// Walk all the instructions in this function. Create a new version for
36063605
// each (by adding an entry to the Versions/Clones summary array), and copy
36073606
// over the version being called for the function clone being cloned here.

0 commit comments

Comments
 (0)