[LLVMdev] LLVM and C++

Eric Christopher echristo at apple.com
Wed Sep 24 11:33:25 PDT 2008


On Sep 24, 2008, at 7:31 AM, Andrii Vasyliev wrote:

> Hi
>
> I want to use LLVM to generate a code working with C++ objects.
>
> I've got basics of LLVM IR generation from Kaleidoscope and other  
> tutorials.
> Then I tried to llvm-dis'assemble llvm-gcc'ompiled C++ program and I  
> see
> how to generate all this strangely named functions and how to run
> constructors and destructors. So I can imagine how to generate C++
> compatible code with LLVM. But it seems to be a bit tricky...
> So I'm interested is there a simpler way?

The easiest way is to wrap construction/destruction/operations in C  
functions
and then call those - or compile them the .ll and inline them as  
appropriate
etc.

-eric



More information about the llvm-dev mailing list