mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-02 10:32:56 +00:00
simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a10b29b84b
commit
1a34b7bf9a
@ -307,11 +307,8 @@ Value *IntrinsicInst::StripPointerCasts(Value *Ptr) {
|
||||
if (isa<PointerType>(CI->getOperand(0)->getType()))
|
||||
return StripPointerCasts(CI->getOperand(0));
|
||||
} else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
|
||||
for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i)
|
||||
if (!isa<Constant>(GEP->getOperand(i)) ||
|
||||
!cast<Constant>(GEP->getOperand(i))->isNullValue())
|
||||
return Ptr;
|
||||
return StripPointerCasts(GEP->getOperand(0));
|
||||
if (GEP->hasAllZeroIndices())
|
||||
return StripPointerCasts(GEP->getOperand(0));
|
||||
}
|
||||
return Ptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user