[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp InstructionCombining.cpp LowerGC.cpp
Chris Lattner
sabre at nondot.org
Mon Feb 12 18:11:20 PST 2007
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.103 -> 1.104
InstructionCombining.cpp updated: 1.630 -> 1.631
LowerGC.cpp updated: 1.21 -> 1.22
---
Log message:
Eliminate use of ctors that take vectors.
---
Diffs of the changes: (+8 -7)
ADCE.cpp | 5 +++--
InstructionCombining.cpp | 4 ++--
LowerGC.cpp | 6 +++---
3 files changed, 8 insertions(+), 7 deletions(-)
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.103 llvm/lib/Transforms/Scalar/ADCE.cpp:1.104
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.103 Sat Feb 10 19:23:03 2007
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Mon Feb 12 20:10:56 2007
@@ -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 @@
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);
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.630 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.631
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.630 Mon Feb 12 16:56:41 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 12 20:10:56 2007
@@ -7352,10 +7352,10 @@
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
NC = new InvokeInst(Callee, II->getNormalDest(), II->getUnwindDest(),
- Args, Caller->getName(), Caller);
+ &Args[0], Args.size(), Caller->getName(), Caller);
cast<InvokeInst>(II)->setCallingConv(II->getCallingConv());
} else {
- NC = new CallInst(Callee, Args, Caller->getName(), Caller);
+ NC = new CallInst(Callee, &Args[0], Args.size(), Caller->getName(), Caller);
if (cast<CallInst>(Caller)->isTailCall())
cast<CallInst>(NC)->setTailCall();
cast<CallInst>(NC)->setCallingConv(cast<CallInst>(Caller)->getCallingConv());
Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.21 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22
--- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.21 Mon Feb 5 15:19:13 2007
+++ llvm/lib/Transforms/Scalar/LowerGC.cpp Mon Feb 12 20:10:56 2007
@@ -314,10 +314,10 @@
NewBB->getInstList().remove(CI);
// Create a new invoke instruction.
+ std::vector<Value*> Args(CI->op_begin()+1, CI->op_end());
+
Value *II = new InvokeInst(CI->getCalledValue(), NewBB, Cleanup,
- std::vector<Value*>(CI->op_begin()+1,
- CI->op_end()),
- CI->getName(), CBB);
+ &Args[0], Args.size(), CI->getName(), CBB);
CI->replaceAllUsesWith(II);
delete CI;
}
More information about the llvm-commits
mailing list