Eliminate use of ctors that take vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34219 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-02-13 02:10:56 +00:00
parent e433919686
commit 93e985f1b1
12 changed files with 60 additions and 59 deletions

View File

@@ -25,6 +25,7 @@
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Compiler.h"
@@ -188,8 +189,8 @@ bool ADCE::doADCE() {
if (AA.onlyReadsMemory(F)) {
// The function cannot unwind. Convert it to a call with a branch
// after it to the normal destination.
std::vector<Value*> Args(II->op_begin()+3, II->op_end());
CallInst *NewCall = new CallInst(F, Args, "", II);
SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
CallInst *NewCall = new CallInst(F, &Args[0], Args.size(), "", II);
NewCall->takeName(II);
NewCall->setCallingConv(II->getCallingConv());
II->replaceAllUsesWith(NewCall);