Shorten some expressions by using ArrayRef::slice().

llvm-svn: 135910
This commit is contained in:
Frits van Bommel 2011-07-25 15:13:01 +00:00
parent 920738256c
commit 775ac35cf1
2 changed files with 2 additions and 4 deletions

View File

@ -407,8 +407,7 @@ InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
}
GetElementPtrInst *Result =
GetElementPtrInst::Create(GEPOps[0],
makeArrayRef(GEPOps.begin() + 1, GEPOps.end()),
GetElementPtrInst::Create(GEPOps[0], makeArrayRef(GEPOps).slice(1),
InVal->getName()+".phi.trans.insert",
PredBB->getTerminator());
Result->setIsInBounds(GEP->isInBounds());

View File

@ -229,8 +229,7 @@ Instruction *InstCombiner::FoldPHIArgGEPIntoPHI(PHINode &PN) {
Value *Base = FixedOperands[0];
GetElementPtrInst *NewGEP =
GetElementPtrInst::Create(Base, makeArrayRef(FixedOperands.begin() + 1,
FixedOperands.end()));
GetElementPtrInst::Create(Base, makeArrayRef(FixedOperands).slice(1));
if (AllInBounds) NewGEP->setIsInBounds();
NewGEP->setDebugLoc(FirstInst->getDebugLoc());
return NewGEP;