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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Frits van Bommel 2011-07-25 15:13:01 +00:00
parent ddfb69cd47
commit 2eb40f6d86
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;