summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-31 19:59:55 +0000
committerChris Lattner <sabre@nondot.org>2007-01-31 19:59:55 +0000
commit699d144a4b726e11d5e72e23ab9b7b665ca9341f (patch)
tree6eb9d7a0fded2d2b41aa6365f667b689dbf0a0bb /lib/Transforms/IPO/SimplifyLibCalls.cpp
parentc0dbec7e1038ee60b8525eb1e8e3eaa6a839bd5b (diff)
downloadllvm-699d144a4b726e11d5e72e23ab9b7b665ca9341f.tar.gz
llvm-699d144a4b726e11d5e72e23ab9b7b665ca9341f.tar.bz2
llvm-699d144a4b726e11d5e72e23ab9b7b665ca9341f.tar.xz
eliminate temporary vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/SimplifyLibCalls.cpp')
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index e4eb6e42c1..3ace4b365f 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -505,10 +505,8 @@ public:
// Now that we have the destination's length, we must index into the
// destination's pointer to get the actual memcpy destination (end of
// the string .. we're concatenating).
- std::vector<Value*> idx;
- idx.push_back(strlen_inst);
GetElementPtrInst* gep =
- new GetElementPtrInst(dest,idx,dest->getName()+".indexed",ci);
+ new GetElementPtrInst(dest, strlen_inst, dest->getName()+".indexed", ci);
// We have enough information to now generate the memcpy call to
// do the concatenation for us.
@@ -596,9 +594,8 @@ public:
// strchr(s,c) -> offset_of_in(c,s)
// (if c is a constant integer and s is a constant string)
if (char_found) {
- std::vector<Value*> indices;
- indices.push_back(ConstantInt::get(Type::Int64Ty,offset));
- GetElementPtrInst* GEP = new GetElementPtrInst(ci->getOperand(1),indices,
+ Value* Idx = ConstantInt::get(Type::Int64Ty,offset);
+ GetElementPtrInst* GEP = new GetElementPtrInst(ci->getOperand(1), Idx,
ci->getOperand(1)->getName()+".strchr",ci);
ci->replaceAllUsesWith(GEP);
} else {