From ba1a750f1dc11baba3c3b7c238ca5f1fcce25060 Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 7 Aug 2007 16:57:55 +0000 Subject: [PATCH] Make this code more efficient git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40899 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-upgrade/UpgradeParser.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y index 8fe549830d4..251cc77ded6 100644 --- a/tools/llvm-upgrade/UpgradeParser.y +++ b/tools/llvm-upgrade/UpgradeParser.y @@ -1723,11 +1723,12 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in, while (!F->use_empty()) { CallInst* CI = cast(F->use_back()); - SmallVector Args; - Args.push_back(new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI)); - Args.push_back(new AllocaInst(ArgTy, 0, "vacopy.fix.2", CI)); + Value *Args[2] = { + new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI), + new AllocaInst(ArgTy, 0, "vacopy.fix.2", CI) + }; new StoreInst(CI->getOperand(1), Args[1], CI); - new CallInst(NF, Args.begin(), Args.end(), "", CI); + new CallInst(NF, Args, Args + 2, "", CI); Value* foo = new LoadInst(Args[0], "vacopy.fix.3", CI); CI->replaceAllUsesWith(foo); CI->getParent()->getInstList().erase(CI);