[llvm] e0c5a85 - [memprof] Migrate away from PointerUnion::dyn_cast (NFC) (#124505)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 10:35:40 PST 2025
Author: Kazu Hirata
Date: 2025-01-27T10:35:37-08:00
New Revision: e0c5a8553d62124c983e3d8bdc3ea31ed1ea0b96
URL: https://github.com/llvm/llvm-project/commit/e0c5a8553d62124c983e3d8bdc3ea31ed1ea0b96
DIFF: https://github.com/llvm/llvm-project/commit/e0c5a8553d62124c983e3d8bdc3ea31ed1ea0b96.diff
LOG: [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.
Added:
Modified:
llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index 1966ce29083716..03e2e7089202de 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -3598,10 +3598,9 @@ IndexCallsiteContextGraph::cloneFunctionForCallsite(
// The next clone number is the current size of versions array.
// Confirm this matches the CloneNo provided by the caller, which is based on
// the number of function clones we have.
- assert(CloneNo ==
- (isa<AllocInfo *>(Call.call())
- ? Call.call().dyn_cast<AllocInfo *>()->Versions.size()
- : Call.call().dyn_cast<CallsiteInfo *>()->Clones.size()));
+ assert(CloneNo == (isa<AllocInfo *>(Call.call())
+ ? cast<AllocInfo *>(Call.call())->Versions.size()
+ : cast<CallsiteInfo *>(Call.call())->Clones.size()));
// Walk all the instructions in this function. Create a new version for
// each (by adding an entry to the Versions/Clones summary array), and copy
// over the version being called for the function clone being cloned here.
More information about the llvm-commits
mailing list