diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-06-14 00:59:24 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-06-14 00:59:24 +0000 |
commit | 9711b5c70b1495b64bd74a16f91b07427881a0f9 (patch) | |
tree | 388542ac83bf10ae4a77ea1ea21d3f0947a4b40f | |
parent | 51dd0185d6dbecb66e1533e9a17d2ebeae42dce7 (diff) | |
download | bcm5719-llvm-9711b5c70b1495b64bd74a16f91b07427881a0f9.tar.gz bcm5719-llvm-9711b5c70b1495b64bd74a16f91b07427881a0f9.zip |
Use Value::stripPointerCasts instead of reinventing part of the wheel.
llvm-svn: 132954
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 3eeedab9250..02a5685c313 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/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; } |