summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-31 20:08:52 +0000
committerChris Lattner <sabre@nondot.org>2007-01-31 20:08:52 +0000
commitfbbe92f5fdcdde9a8eb331c90fff0a3bfb539e2b (patch)
treed62faf3923f71a0eff0bc419a17479d678888563 /lib/Transforms/Scalar
parentaf3e4d4bee2519962fb1f5dabece364df522f508 (diff)
downloadllvm-fbbe92f5fdcdde9a8eb331c90fff0a3bfb539e2b.tar.gz
llvm-fbbe92f5fdcdde9a8eb331c90fff0a3bfb539e2b.tar.bz2
llvm-fbbe92f5fdcdde9a8eb331c90fff0a3bfb539e2b.tar.xz
remove temporary vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp3
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
-rw-r--r--lib/Transforms/Scalar/LowerGC.cpp15
3 files changed, 9 insertions, 13 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index c11d249f1f..30435df860 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -197,8 +197,7 @@ void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN,
std::string Name = PN->getName(); PN->setName("");
Value *PreInc =
new GetElementPtrInst(PN->getIncomingValue(PreheaderIdx),
- std::vector<Value*>(1, NewPhi), Name,
- InsertPos);
+ NewPhi, Name, InsertPos);
PN->replaceAllUsesWith(PreInc);
}
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index a47ecd0023..aec61ab076 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -6418,8 +6418,8 @@ Instruction *InstCombiner::visitBitCast(CastInst &CI) {
// If we found a path from the src to dest, create the getelementptr now.
if (SrcElTy == DstElTy) {
- std::vector<Value*> Idxs(NumZeros+1, ZeroUInt);
- return new GetElementPtrInst(Src, Idxs);
+ SmallVector<Value*, 8> Idxs(NumZeros+1, ZeroUInt);
+ return new GetElementPtrInst(Src, &Idxs[0], Idxs.size());
}
}
}
diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp
index a98981359d..7c88aa2902 100644
--- a/lib/Transforms/Scalar/LowerGC.cpp
+++ b/lib/Transforms/Scalar/LowerGC.cpp
@@ -229,10 +229,7 @@ bool LowerGC::runOnFunction(Function &F) {
Constant *One = ConstantInt::get(Type::Int32Ty, 1);
// Get a pointer to the prev pointer.
- std::vector<Value*> Par;
- Par.push_back(Zero);
- Par.push_back(Zero);
- Value *PrevPtrPtr = new GetElementPtrInst(AI, Par, "prevptrptr", IP);
+ Value *PrevPtrPtr = new GetElementPtrInst(AI, Zero, Zero, "prevptrptr", IP);
// Load the previous pointer.
Value *PrevPtr = new LoadInst(RootChain, "prevptr", IP);
@@ -240,12 +237,12 @@ bool LowerGC::runOnFunction(Function &F) {
new StoreInst(PrevPtr, PrevPtrPtr, IP);
// Set the number of elements in this record.
- Par[1] = ConstantInt::get(Type::Int32Ty, 1);
- Value *NumEltsPtr = new GetElementPtrInst(AI, Par, "numeltsptr", IP);
+ Value *NumEltsPtr = new GetElementPtrInst(AI, Zero, One, "numeltsptr", IP);
new StoreInst(ConstantInt::get(Type::Int32Ty, GCRoots.size()), NumEltsPtr,IP);
+ Value* Par[4];
+ Par[0] = Zero;
Par[1] = ConstantInt::get(Type::Int32Ty, 2);
- Par.resize(4);
const PointerType *PtrLocTy =
cast<PointerType>(GCRootInt->getFunctionType()->getParamType(0));
@@ -256,13 +253,13 @@ bool LowerGC::runOnFunction(Function &F) {
// Initialize the meta-data pointer.
Par[2] = ConstantInt::get(Type::Int32Ty, i);
Par[3] = One;
- Value *MetaDataPtr = new GetElementPtrInst(AI, Par, "MetaDataPtr", IP);
+ Value *MetaDataPtr = new GetElementPtrInst(AI, Par, 4, "MetaDataPtr", IP);
assert(isa<Constant>(GCRoots[i]->getOperand(2)) && "Must be a constant");
new StoreInst(GCRoots[i]->getOperand(2), MetaDataPtr, IP);
// Initialize the root pointer to null on entry to the function.
Par[3] = Zero;
- Value *RootPtrPtr = new GetElementPtrInst(AI, Par, "RootEntPtr", IP);
+ Value *RootPtrPtr = new GetElementPtrInst(AI, Par, 4, "RootEntPtr", IP);
new StoreInst(Null, RootPtrPtr, IP);
// Each occurrance of the llvm.gcroot intrinsic now turns into an