[cfe-dev] [LLVMdev] LLVM targeting HLLs

Eric Christopher echristo at apple.com
Mon Jan 24 14:04:13 PST 2011


On Jan 24, 2011, at 2:01 PM, David Given wrote:

> I am interested in using LLVM to translate C and C++ into high-level
> language code. (As an update to an earlier project of mine, Clue, which
> used the Sparse compiler library to do this: it targets Lua, Javascript,
> Perl 5, C, Java and Common Lisp, with a disturbing amount of success.
> See http://cluecc.sourceforge.net for details.)
> 
> The obvious place to start on this is the C backend, except in these 2.8
> days the C backend is so hedged about with caveats I'm rather wary of
> basing anything on it. I also recall seeing comments here that it's due
> for a rewrite from scratch, and that various people were looking into
> it. Can anyone go into more detail as to what exactly is wrong with the
> C backend, and whether this rewrite is happening?
> 
> The other thing I could do is to use the LLVMTargetMachine and treat my
> HLL as a low-level machine; this gets me a certain amount of good stuff
> like register allocation and more optimisations, but the documentation
> is still pretty basic (e.g.
> http://wiki.llvm.org/Absolute_Minimum_Backend is three short paragraphs)
> and I'm not certain as to whether LLVMTargetMachine is suitable. For
> example: my HLL can largely be treated as a register machine with an
> arbitrary number of registers. Can LLVMTargetMachine handle this?

You could create a different code generator from clang or use the rewriting
machinery?

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110124/247da82c/attachment.html>


More information about the cfe-dev mailing list