[LLVMdev] Newbie questions

Chris Lattner sabre at nondot.org
Mon Apr 24 09:21:46 PDT 2006


On Sun, 23 Apr 2006, Archie Cobbs wrote:
>> It's actually missing quite a bit.  It is missing too much to support 
>> programs that use System.Out, for example.  Alkis is definitely the person 
>> to talk to if you're interested in it.
>
> Thanks.. I'm actually more interested in what would be involved to
> hook up LLVM to an existing JVM. In particular JCVM (http://jcvm.sf.net).
> JCVM analyzes bytecode using Soot, emits C code, compiles that with GCC,
> and then loads executable code from the resulting ELF files.. given this
> design, using LLVM/modules instead of Soot/GCC/ELF would not be very much
> different, but would allow more cool things to happen.

Okay.

> The main barrier to this idea for me are (besides the usual: limited time
> for fun projects) is understanding how it could work. In particular, how
> would one bridge the C vs. C++ gap. JCVM is written in C, and I have lots
> of C and Java experience, but zero with C++. Dumb question: can a C program
> link with and invoke C++ libraries? Or perhaps a little C++ starter program
> is all that is needed, then the existing code can be used via extern "C"?
> Alternately, if there were Java JNI wrappers, I could invoke those... Etc.

C programs certainly can use C++ libraries, as you say, with extern "C".

I don't know how well  JCVM would work with llvm-java, I guess you'd have 
to try it and see.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list