mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 08:51:43 +00:00
simplify some code
llvm-svn: 36427
This commit is contained in:
parent
cf27f9705f
commit
cb6020a638
@ -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…
Reference in New Issue
Block a user