[llvm] [llvm] Migrate away from PointerUnion::dyn_cast (NFC) (PR #123692)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 00:17:35 PST 2025


================
@@ -3542,7 +3542,7 @@ void ModuleCallsiteContextGraph::updateAllocationCall(
 
 void IndexCallsiteContextGraph::updateAllocationCall(CallInfo &Call,
                                                      AllocationType AllocType) {
-  auto *AI = Call.call().dyn_cast<AllocInfo *>();
+  auto *AI = dyn_cast_if_present<AllocInfo *>(Call.call());
----------------
nikic wrote:

Given the following assert, this should be just cast<>.

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


More information about the llvm-commits mailing list