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(); }