mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 20:34:58 +00:00
Use Value::stripPointerCasts instead of reinventing part of the wheel.
llvm-svn: 132954
This commit is contained in:
parent
5b03baf002
commit
c473e8f0e2
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user