mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43141 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user