mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-29 13:32:33 +00:00
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
This commit is contained in:
parent
15cd80c16b
commit
708c1ac077
@ -734,15 +734,11 @@ static bool hasLifetimeMarkers(AllocaInst *AI) {
|
|||||||
if (AI->getType() == Int8PtrTy)
|
if (AI->getType() == Int8PtrTy)
|
||||||
return isUsedByLifetimeMarker(AI);
|
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;
|
for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); I != E;
|
||||||
++I) {
|
++I) {
|
||||||
if (I->getType() != Int8PtrTy) continue;
|
if (I->getType() != Int8PtrTy) continue;
|
||||||
if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*I)) {
|
if (I->stripPointerCasts() != AI) continue;
|
||||||
if (!GEPI->hasAllZeroIndices()) continue;
|
|
||||||
} else if (!isa<BitCastInst>(*I)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (isUsedByLifetimeMarker(*I))
|
if (isUsedByLifetimeMarker(*I))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user