Dlang dynamic compilation

Ivan Butygin via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Nov 24 12:00:11 PST 2016


There are a lot of questions how this feature should interact 
with PGO/coverage analysis/debug info generation.

And current prototype is very hacky.
I generate special thunk for runtime compiled function to call it 
instead of original function:
https://github.com/Hardcode84/ldc/commit/ccbb40eae0bef263b70ff54181ca04f62dbfd9a9#diff-e48140f4aefdf187e6406905c4c9e84cR76
https://github.com/Hardcode84/ldc/commit/ccbb40eae0bef263b70ff54181ca04f62dbfd9a9#diff-92cc634886bf8dc6f1a79b6177ba0fd2R535

To replace calls I first created wrapper instead of accessing 
getIrFunc()->func directly:
https://github.com/Hardcode84/ldc/commit/b92ef902cc27ad062698ab178d1a985f7ec8d332

And then just do a very stupid hack to replace returned function:
https://github.com/Hardcode84/ldc/commit/ccbb40eae0bef263b70ff54181ca04f62dbfd9a9#diff-51d8532dc9b4eedb04dfd406b3aa3bf1R59

I need some more intelligent way to replace functions with thunks.


More information about the digitalmars-d-ldc mailing list