Closed kpp closed 9 years ago
Correct solution would be to traverse the functions in the reverse order of topological sort. This will also help in writing Smalltalk-aware method inliner which would gain a huge performance speedup.
In case of LLVM we should inherit the CallGraphSCCPass.
It seems it was fixed in llvm 3.3+
Assume we have got 2 functions:
A calls B B calls A
When we patch methods we remove machine code for old functions.
Patching A -> A2 (still calls to old B) Patching B -> B2 (calls A2, but machine code for B is freed)
Code to reproduce the bug: