开发者

LLVM: How to access JIT API at runtime & edit myself?

开发者 https://www.devze.com 2023-02-16 21:34 出处:网络
could you suggest if that\'s possible to access LLVM JIT API from the pro开发者_如何转开发gram being executed? My goal is to be able to manipulate(add/update/remove) classes, methods and data on the f

could you suggest if that's possible to access LLVM JIT API from the pro开发者_如何转开发gram being executed? My goal is to be able to manipulate(add/update/remove) classes, methods and data on the fly.

Preferably, I would stay with Clang. Any ideas are welcome.


This seems to be pretty easy stuff. In the JIT you can provide a mapping between any external function to the arbitrary address. So, basically you'll just define some function in your IR being JITed, bind it to the address in the outside world and this will make a trick for you.

In particular, http://llvm.org/doxygen/classllvm_1_1ExecutionEngine.html#a805704b52a327cc6b37aebf9cba14169 is the function you should use here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号