[LLVMdev] LLVM & Incremental Compilation

Chris Lattner sabre at nondot.org
Sun Jan 16 10:40:00 PST 2005


On Sun, 16 Jan 2005, Tim Macfarlane wrote:
> Hi people!
> I'm looking for a back-end compiler for a language project of mine, LLVM
> looks promising, but I'd like to clear a few things up first:
>
> 1. What relation does LLVM bear with GCC; why would somebody use LLVM
> for a compiler back-end over GCC (aside from the Virtual Machine)? How
> do the goals of GCC and LLVM differ as compiler toolkits?

There are many differences in goals and implementation.  LLVM does use a 
hacked on version of GCC for it's C and C++ parsers, but does not rely on 
it for anything else.  GCC has advantages over LLVM (more target support 
etc), and LLVM has advantages over GCC (JIT compilation, easier to work 
with, interprocedural optimization, can use it to build non GPL tools, 
...).  This is really a big question that has many nuances, but that is at 
least part of it.

> 2. How conducive to Incremental Compilation is LLVM? I would like to be
> able to compile and execute code in the same process immediately. An
> example of this would be in an interactive programming environment, or a
> Common Lisp style of compilation.

That is no problem.  You can take a look at the llvm/examples/* 
directories, there are examples that build LLVM code on the fly and 
execute it.

> 3. Is LLVM able to support advanced runtime features as continuations,
> garbage collection and resuming exception handling. Would there be
> anything in LLVM that would prevent these sorts of features? Is there
> anything in the LLVM runtime that is assumed (dynamic typing, etc). Or
> is LLVM as it's title sugests: Low-Level, so it won't get in your way?

I believe that the only thing that we are presently missing is guaranteed 
tail calls, but it will be added in the near future.  LLVM does not assume 
anything about your runtime, as you say, it doesn't get in your way. :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list