[llvm-dev] Reuse llvm::ExecutionEngine

Gaier, Bjoern via llvm-dev llvm-dev at lists.llvm.org
Tue May 7 04:47:59 PDT 2019


Dear LLVM-Mailing-List,

I'm using the llvm::EngineBuilder to create an instance of the llvm::ExecutionEngine, I then JIT my code, take the addresses I need and delete the llvm::ExecutionEngine. But now I started to wonder, if I could reuse that instance for a new module again?

I first tried calling llvm::EngineBuilder without setting a Module, I planned to add it later - but when I do this the "create" function will crash.

Another test I ran was calling "removeModule" of the llvm::ExecutionEngine  after the call to finalizeObject. Then I added the same module again and ran finalizeObject again. The result was weird, I suddenly became error messages about the relocation - I take this came because I applied a memory mapping in the first run.

So to make it short: Is the llvm::ExecutionEngine designed for a reuse or is it better to create a new instance again?

Kind greetings
Björn
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190507/fd7f9978/attachment.html>


More information about the llvm-dev mailing list