[LLVMdev] Convert C++ to C. What is 0x0p+0 ?

Reid Spencer rspencer at reidspencer.com
Sun Nov 5 20:16:59 PST 2006


Hi Napi,

On Mon, 2006-11-06 at 12:17 +0800, Mohd-Hanafiah Abdullah wrote:
> On Sun, 2006-11-05 at 19:06 -0800, Reid Spencer wrote:
> ...
> > As for the __main function, its a gcc library call required by the
> > compiler for program startup.  The details vary but the call is needed.
> > Amongst other things it will probably initialize your C++ static
> > constructors. 
> 
> Hi Reid:
> 
> I'm not using gcc for this purpose but another C compiler called AMPC.
> It compiles C code into Java Bytecode.  What I'm missing is the C++ to
> JVM portion which I'm trying to use LLVM for converting C++ to C then
> pass it through AMPC to get the Java Bytecode.

Okay, cool :)

> One question is does the resulting C code produced by llc will call C++
> functions/methods still? 

Yes.

>  It would be good if only C library functions
> are called since I already have the standard C library compiled by AMPC
> in the bytecode format.

If you use the stdc++ library in your source code then you'll need to
compile that with AMPC as well (after siphoning it through llvm).

> 
> Thanks.

You're welcome.

Reid.




More information about the llvm-dev mailing list