mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-28 23:52:54 +00:00
When loop extraction succeeds, make sure to map the function pointers over
to avoid dangling references. llvm-svn: 12470
This commit is contained in:
parent
e2b4b9ca3f
commit
e45504d887
@ -268,6 +268,17 @@ static bool ExtractLoops(BugDriver &BD,
|
||||
exit(1);
|
||||
}
|
||||
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);
|
||||
MadeChange = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user