eliminate temporary vectors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-01-31 04:40:53 +00:00
parent 2b9a5daf7c
commit 55eb1c47de
3 changed files with 25 additions and 17 deletions

View File

@ -173,9 +173,10 @@ void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN,
/*empty*/;
if (isa<SequentialType>(*GTI)) {
// Pull the last index out of the constant expr GEP.
std::vector<Value*> CEIdxs(CE->op_begin()+1, CE->op_end()-1);
SmallVector<Value*, 8> CEIdxs(CE->op_begin()+1, CE->op_end()-1);
Constant *NCE = ConstantExpr::getGetElementPtr(CE->getOperand(0),
CEIdxs);
&CEIdxs[0],
CEIdxs.size());
GetElementPtrInst *NGEPI =
new GetElementPtrInst(NCE, Constant::getNullValue(Type::Int32Ty),
NewAdd, GEPI->getName(), GEPI);