[LLVMdev] Your question about LLVM

Dan Gohman gohman at apple.com
Mon Oct 10 11:07:04 PDT 2011


On Oct 8, 2011, at 12:24 AM, Joachim Durchholz wrote:

> Am 07.10.2011 19:28, schrieb Dan Gohman:
>> Translating from Java to LLVM IR and then back to Java would
>> probably not be very practical.
> 
> That's not what I'm aiming for. I want
> 
>   MyHLL -> MyCompiler -> MyIR1 -> MyTransformer -> MyIR2 -> Backend
> 
> Where "Backend" could be a code generator for the JVM, CLR, or something 
> LLVM-based.
> It would be nice if I could have
> 
>   ... -> MyIR2 -> LLVM -> JVM/CLR/native
> 
> since that would take some passes out of MyTransformer. I'm not sure how 
> useful LLVM would be in such a scenario.
> Essentially, my question is how much I can leverage out of LLVM (with 
> the usual caveats, of course - being more like Haskell than C++, I guess 
> LLVM isn't built for that, but it might still be worth it).

To get an idea of the feasibility of translating LLVM IR to Java or CLR,
look at existing C to Java translators. An LLVM IR to Java translator
would face most of the same challenges, as well as some new challanges.

Dan




More information about the llvm-dev mailing list