mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
When loop extraction succeeds, make sure to map the function pointers over
to avoid dangling references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12470 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -268,6 +268,17 @@ static bool ExtractLoops(BugDriver &BD,
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
delete ToOptimizeLoopExtracted;
|
delete ToOptimizeLoopExtracted;
|
||||||
|
|
||||||
|
// All of the Function*'s in the MiscompiledFunctions list are in the old
|
||||||
|
// module. Make sure to update them to point to the corresponding functions
|
||||||
|
// in the new module.
|
||||||
|
for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i) {
|
||||||
|
Function *OldF = MiscompiledFunctions[i];
|
||||||
|
Function *NewF =
|
||||||
|
ToNotOptimize->getFunction(OldF->getName(), OldF->getFunctionType());
|
||||||
|
MiscompiledFunctions[i] = NewF;
|
||||||
|
}
|
||||||
|
|
||||||
BD.setNewProgram(ToNotOptimize);
|
BD.setNewProgram(ToNotOptimize);
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user