From d70feb8cd347abde76d3be538ae6eff194c060e3 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 27 Jun 2025 22:56:16 -0700 Subject: [PATCH] [Analysis] Remove unnecessary casts (NFC) PImpl is already of LazyValueInfoImpl *. --- llvm/lib/Analysis/LazyValueInfo.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 2a562484fc374..922f25de54e9d 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1745,14 +1745,10 @@ LazyValueInfoImpl &LazyValueInfo::getOrCreateImpl(const Module *M) { Intrinsic::getDeclarationIfExists(M, Intrinsic::experimental_guard); PImpl = new LazyValueInfoImpl(AC, DL, GuardDecl); } - return *static_cast(PImpl); + return *PImpl; } -LazyValueInfoImpl *LazyValueInfo::getImpl() { - if (!PImpl) - return nullptr; - return static_cast(PImpl); -} +LazyValueInfoImpl *LazyValueInfo::getImpl() { return PImpl; } LazyValueInfo::~LazyValueInfo() { releaseMemory(); }