diff options
author | David Greene <greened@obbligato.org> | 2007-08-01 03:43:44 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2007-08-01 03:43:44 +0000 |
commit | b1c4a7b210b9a8aa98fcffae8a84a0a20860ec7a (patch) | |
tree | 1c9794c86069c19f235104ec8c2a6f91405552d2 /lib/Transforms/Utils | |
parent | 1a9e67782d0a837f629e519817b77a657f0bf55f (diff) | |
download | external_llvm-b1c4a7b210b9a8aa98fcffae8a84a0a20860ec7a.zip external_llvm-b1c4a7b210b9a8aa98fcffae8a84a0a20860ec7a.tar.gz external_llvm-b1c4a7b210b9a8aa98fcffae8a84a0a20860ec7a.tar.bz2 |
New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.
Updates to all clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/CodeExtractor.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index aaf9986..90642f1 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -393,7 +393,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer, } // Emit the call to the function - CallInst *call = new CallInst(newFunction, ¶ms[0], params.size(), + CallInst *call = new CallInst(newFunction, params.begin(), params.end(), NumExitBlocks > 1 ? "targetBlock" : ""); codeReplacer->getInstList().push_back(call); diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index d72c018..551ca7f 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -212,7 +212,7 @@ bool LowerInvoke::insertCheapEHSupport(Function &F) { std::vector<Value*> CallArgs(II->op_begin()+3, II->op_end()); // Insert a normal call instruction... CallInst *NewCall = new CallInst(II->getCalledValue(), - &CallArgs[0], CallArgs.size(), "", II); + CallArgs.begin(), CallArgs.end(), "", II); NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); II->replaceAllUsesWith(NewCall); @@ -269,7 +269,7 @@ void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo, // Insert a normal call instruction. std::vector<Value*> CallArgs(II->op_begin()+3, II->op_end()); CallInst *NewCall = new CallInst(II->getCalledValue(), - &CallArgs[0], CallArgs.size(), "", + CallArgs.begin(), CallArgs.end(), "", II); NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); @@ -542,7 +542,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) { Idx.push_back(ConstantInt::get(Type::Int32Ty, 0)); Idx[0] = new GetElementPtrInst(BufPtr, &Idx[0], 2, "JmpBuf", UnwindBlock); Idx[1] = ConstantInt::get(Type::Int32Ty, 1); - new CallInst(LongJmpFn, &Idx[0], Idx.size(), "", UnwindBlock); + new CallInst(LongJmpFn, Idx.begin(), Idx.end(), "", UnwindBlock); new UnreachableInst(UnwindBlock); // Set up the term block ("throw without a catch"). diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 6c34d02..470daf3 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1374,7 +1374,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { // Insert the call now... SmallVector<Value*,8> Args(II->op_begin()+3, II->op_end()); CallInst *CI = new CallInst(II->getCalledValue(), - &Args[0], Args.size(), II->getName(), BI); + Args.begin(), Args.end(), II->getName(), BI); CI->setCallingConv(II->getCallingConv()); // If the invoke produced a value, the Call now does instead II->replaceAllUsesWith(CI); @@ -1748,7 +1748,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { // Insert the call now... SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end()); CallInst *CI = new CallInst(II->getCalledValue(), - &Args[0], Args.size(), + Args.begin(), Args.end(), II->getName(), BI); CI->setCallingConv(II->getCallingConv()); // If the invoke produced a value, the Call does now instead. |