summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-06-14 00:59:24 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-06-14 00:59:24 +0000
commit708c1ac077fbc0cb73d489b4f4df3b2718566b05 (patch)
tree74295f320320fc38d3a37726dbe2abb2069900c8 /lib/Transforms/Utils/InlineFunction.cpp
parent15cd80c16b4e63b99dcbe45d2baa9456d414aaca (diff)
downloadllvm-708c1ac077fbc0cb73d489b4f4df3b2718566b05.tar.gz
llvm-708c1ac077fbc0cb73d489b4f4df3b2718566b05.tar.bz2
llvm-708c1ac077fbc0cb73d489b4f4df3b2718566b05.tar.xz
Use Value::stripPointerCasts instead of reinventing part of the wheel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 3eeedab925..02a5685c31 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -734,15 +734,11 @@ static bool hasLifetimeMarkers(AllocaInst *AI) {
if (AI->getType() == Int8PtrTy)
return isUsedByLifetimeMarker(AI);
- // Do a scan to find all the bitcasts or GEPs to i8*.
+ // Do a scan to find all the casts to i8*.
for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); I != E;
++I) {
if (I->getType() != Int8PtrTy) continue;
- if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*I)) {
- if (!GEPI->hasAllZeroIndices()) continue;
- } else if (!isa<BitCastInst>(*I)) {
- continue;
- }
+ if (I->stripPointerCasts() != AI) continue;
if (isUsedByLifetimeMarker(*I))
return true;
}