summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-18 18:49:29 +0000
committerChris Lattner <sabre@nondot.org>2007-10-18 18:49:29 +0000
commit9715d9fb59e579ed3087e39ea9d99b7c126774e7 (patch)
tree9aa98911f34f42afad3e6902392c8e6a2f54bc2d /llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
parent5616a608df4228f599c0cf1c9a40f5f68e879f0d (diff)
downloadbcm5719-llvm-9715d9fb59e579ed3087e39ea9d99b7c126774e7.tar.gz
bcm5719-llvm-9715d9fb59e579ed3087e39ea9d99b7c126774e7.zip
Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :( llvm-svn: 43141
Diffstat (limited to 'llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index dd5d668bc17..8dd09256136 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -168,7 +168,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) {
CallSite CS = CallSite::get(Fn.use_back());
Instruction *Call = CS.getInstruction();
- // Loop over the operands, dropping extraneous ones at the end of the list.
+ // Pass all the same arguments.
Args.assign(CS.arg_begin(), CS.arg_begin()+NumArgs);
Instruction *New;
@@ -185,13 +185,13 @@ bool DAE::DeleteDeadVarargs(Function &Fn) {
Args.clear();
if (!Call->use_empty())
- Call->replaceAllUsesWith(Constant::getNullValue(Call->getType()));
+ Call->replaceAllUsesWith(New);
New->takeName(Call);
// Finally, remove the old call from the program, reducing the use-count of
// F.
- Call->getParent()->getInstList().erase(Call);
+ Call->eraseFromParent();
}
// Since we have now created the new function, splice the body of the old
OpenPOWER on IntegriCloud