New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.
Updates to all clients.
llvm-svn: 40660
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp
index 4968fc9..d5201b8 100644
--- a/llvm/lib/Transforms/Scalar/ADCE.cpp
+++ b/llvm/lib/Transforms/Scalar/ADCE.cpp
@@ -194,7 +194,7 @@
// The function cannot unwind. Convert it to a call with a branch
// after it to the normal destination.
SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
- CallInst *NewCall = new CallInst(F, &Args[0], Args.size(), "", II);
+ CallInst *NewCall = new CallInst(F, Args.begin(), Args.end(), "", II);
NewCall->takeName(II);
NewCall->setCallingConv(II->getCallingConv());
II->replaceAllUsesWith(NewCall);