diff options
author | David Greene <greened@obbligato.org> | 2007-09-04 15:46:09 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2007-09-04 15:46:09 +0000 |
commit | b8f74793b9d161bc666fe27fc92fe112b6ec169b (patch) | |
tree | 3e79ac89138858c59c1f73af09b64527778ad944 /lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 382526239944023e435833ce759f536fec4e6225 (diff) |
Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 520af8750e..58a705d496 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -464,7 +464,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV) { Idxs.push_back(NullInt); for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) Idxs.push_back(GEPI->getOperand(i)); - NewPtr = new GetElementPtrInst(NewPtr, &Idxs[0], Idxs.size(), + NewPtr = new GetElementPtrInst(NewPtr, Idxs.begin(), Idxs.end(), GEPI->getName()+"."+utostr(Val), GEPI); } GEP->replaceAllUsesWith(NewPtr); @@ -698,7 +698,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, MI->getAlignment(), MI->getName(), MI); Value* Indices[2]; Indices[0] = Indices[1] = Constant::getNullValue(Type::Int32Ty); - Value *NewGEP = new GetElementPtrInst(NewMI, Indices, 2, + Value *NewGEP = new GetElementPtrInst(NewMI, Indices, Indices + 2, NewMI->getName()+".el0", MI); MI->replaceAllUsesWith(NewGEP); MI->eraseFromParent(); @@ -926,7 +926,7 @@ static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Ptr, GEPIdx.push_back(GEPI->getOperand(1)); GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end()); - Value *NGEPI = new GetElementPtrInst(NewPtr, &GEPIdx[0], GEPIdx.size(), + Value *NGEPI = new GetElementPtrInst(NewPtr, GEPIdx.begin(), GEPIdx.end(), GEPI->getName(), GEPI); GEPI->replaceAllUsesWith(NGEPI); GEPI->eraseFromParent(); |