mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Minor tweaks
llvm-svn: 16929
This commit is contained in:
parent
0a12c99e3a
commit
58435df175
@ -263,7 +263,7 @@ unsigned Function::getIntrinsicID() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Value *MemIntrinsic::StripPointerCasts(Value *Ptr) {
|
||||
Value *IntrinsicInst::StripPointerCasts(Value *Ptr) {
|
||||
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) {
|
||||
if (CE->getOpcode() == Instruction::Cast) {
|
||||
if (isa<PointerType>(CE->getOperand(0)->getType()))
|
||||
@ -281,11 +281,11 @@ Value *MemIntrinsic::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 = CE->getNumOperands(); i != e; ++i)
|
||||
if (!isa<Constant>(CE->getOperand(i)) ||
|
||||
!cast<Constant>(CE->getOperand(i))->isNullValue())
|
||||
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(CE->getOperand(0));
|
||||
return StripPointerCasts(GEP->getOperand(0));
|
||||
}
|
||||
return Ptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user