LLVM: How to access JIT API at runtime & edit myself?
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.
精彩评论