[llvm] 25d7fd3 - [Analysis] Remove unnecessary casts (NFC) (#146216)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 28 13:03:34 PDT 2025
Author: Kazu Hirata
Date: 2025-06-28T13:03:31-07:00
New Revision: 25d7fd35b20374b8e1037f5fd32340f7f6346319
URL: https://github.com/llvm/llvm-project/commit/25d7fd35b20374b8e1037f5fd32340f7f6346319
DIFF: https://github.com/llvm/llvm-project/commit/25d7fd35b20374b8e1037f5fd32340f7f6346319.diff
LOG: [Analysis] Remove unnecessary casts (NFC) (#146216)
PImpl is already of LazyValueInfoImpl *.
Added:
Modified:
llvm/lib/Analysis/LazyValueInfo.cpp
Removed:
################################################################################
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<LazyValueInfoImpl *>(PImpl);
+ return *PImpl;
}
-LazyValueInfoImpl *LazyValueInfo::getImpl() {
- if (!PImpl)
- return nullptr;
- return static_cast<LazyValueInfoImpl *>(PImpl);
-}
+LazyValueInfoImpl *LazyValueInfo::getImpl() { return PImpl; }
LazyValueInfo::~LazyValueInfo() { releaseMemory(); }
More information about the llvm-commits
mailing list