[LLVMdev] How to call C++ code from LLVM

Eli Friedman eli.friedman at gmail.com
Thu Jun 18 17:19:02 PDT 2009

On Thu, Jun 18, 2009 at 3:57 PM, Jules Jacobs<julesjacobs at gmail.com> wrote:
> How can I call C++ libraries (LLVM & Qt for example) from a language that's
> implemented on top of LLVM?

You can call them the same way a C++ file compiled with llvm-g++ would
call them.  Essentially, it's complicated enough that you probably
don't want to do it for any interface of non-trivial size; I would
suggest compiling C++ snippets to bitcode with llvm-g++ and linking
them into your program.

For LLVM in particular, though, you can use the C bindings, which are
much more straightforward to use for this sort of thing.


More information about the llvm-dev mailing list