mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
I don't know how, but I managed to goof the revert. Remove function that should
have been removed in r101231. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101232 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3715e45da5
commit
3c594ff290
@ -894,43 +894,6 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DAE::RemoveDeadParamsFromCallersOf(Function *F) {
|
||||
// Don't modify fully live functions
|
||||
if (LiveFunctions.count(F))
|
||||
return false;
|
||||
|
||||
// Make a list of the dead arguments.
|
||||
SmallVector<int, 10> ArgDead;
|
||||
unsigned i = 0;
|
||||
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
|
||||
I != E; ++I, ++i) {
|
||||
RetOrArg Arg = CreateArg(F, i);
|
||||
if (!LiveValues.count(Arg))
|
||||
ArgDead.push_back(i);
|
||||
}
|
||||
if (ArgDead.empty())
|
||||
return false;
|
||||
|
||||
bool MadeChange = false;
|
||||
for (Function::use_iterator I = F->use_begin(), E = F->use_end();
|
||||
I != E; ++I) {
|
||||
CallSite CS = CallSite::get(*I);
|
||||
if (CS.getInstruction() && CS.isCallee(I)) {
|
||||
for (unsigned i = 0, e = ArgDead.size(); i != e; ++i) {
|
||||
Value *A = CS.getArgument(ArgDead[i]);
|
||||
if (!isa<UndefValue>(A)) {
|
||||
++NumParametersEliminated;
|
||||
MadeChange = true;
|
||||
CS.setArgument(ArgDead[i], UndefValue::get(A->getType()));
|
||||
RecursivelyDeleteTriviallyDeadInstructions(A);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MadeChange;
|
||||
}
|
||||
|
||||
bool DAE::runOnModule(Module &M) {
|
||||
bool Changed = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user