[llvm-commits] [llvm] r40899 - /llvm/trunk/tools/llvm-upgrade/UpgradeParser.y
David Greene
greened at obbligato.org
Tue Aug 7 09:57:55 PDT 2007
Author: greened
Date: Tue Aug 7 11:57:55 2007
New Revision: 40899
URL: http://llvm.org/viewvc/llvm-project?rev=40899&view=rev
Log:
Make this code more efficient
Modified:
llvm/trunk/tools/llvm-upgrade/UpgradeParser.y
Modified: llvm/trunk/tools/llvm-upgrade/UpgradeParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-upgrade/UpgradeParser.y?rev=40899&r1=40898&r2=40899&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-upgrade/UpgradeParser.y (original)
+++ llvm/trunk/tools/llvm-upgrade/UpgradeParser.y Tue Aug 7 11:57:55 2007
@@ -1723,11 +1723,12 @@
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
- SmallVector<Value *, 2> 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);
More information about the llvm-commits
mailing list