Search code examples
c++shared-librariesllvmjitllvm-ir

LLVM Framework: load IR files, link libraries


I am writing a simple JIT compiler using LLVM framework. There's some nontrivial functionality, so that its generation became very complicated, as it uses a couple of dynamic libraries. So my questions are following:

  • Is there a way to load an LLVM IR source via llvm::Builder/any other class
  • Is there a way to tell LLVM, that at runtime some dynamic library ought to be linked, before execution...

The first question is more insteresting, as I already know how to require linkage from C/C++ applications, so I can generate LLVM IR code via Clang, but it comes up to the first question asked


Solution

  • Huh, there is an llvm/linker... Who could think so? :)