2

I am currently evaluating possible tools to generate machine code ahead-of-time and dynamically for a toy compiler project.

The compiler should be able to translate the source code into a runnable byte code so that code can be added later dynamically to the running byte code.

I am wondering whether this is possible with LLVM, i.e. is it possible to extend (or modify) LLVM byte code that is run by the LLVM JIT-compiler/interpreter lli?

Marc
  • 4,327
  • 4
  • 30
  • 46
  • It is possible indeed, but you may want to build llvm as a dynamic library then. – SK-logic Oct 10 '11 at 08:50
  • You mean writing my own VM (say, in C++) that uses llvm's ExecutionEngine? – Marc Oct 11 '11 at 06:30
  • that's another option (it'll be no more than 10 lines of code anyway). And of course you can link `lli` with the rest of LLVM libraries dynamically, this way your generated code will be able to use the same LLVM API – SK-logic Oct 11 '11 at 07:27

0 Answers0