[LLVMdev] [Oink-devel] Status of Elsa->LLVM

Daniel Wilkerson daniel.wilkerson at gmail.com
Sat Dec 22 21:04:30 PST 2007


On Dec 22, 2007 7:58 PM, Richard Pennington <rich at pennware.com> wrote:
> Chris Lattner wrote:
> > On Dec 22, 2007, at 2:40 AM, Richard Pennington wrote:
> >
> >> Does Elsa provide an advantage over g++? For me, understanding it is a
> >> big plus. ;-) In addition, Elsa has a Berkeley-like license which I
> >> prefer.
> >
> > Ok.  If you're not planning on extending the front-end,
> > understandability doesn't really matter ;-).  I get where you're
> > coming from though!

Chris, I wonder if perhaps you might want to give that sentence more
thought.  In order to generate code I am sure you want to do static
analysis of your program and that requires looking at the AST.  Scott
says that the gcc internals are very dynamic: this basically means
that there are lots of "if" statements you have to write in order to
traverse the code and figure out what kind of thing you are looking
at.  Such data-structures are inefficient and error-prone: the C++
(meta-level) type-checker cannot help you as much.  Our internal
data-structures have static fields for each semantic component of an
AST node; they are generated from our own custom Domain Specific
Language for Abstract Syntax Trees.  This allows you to automate all
kinds of things and then have the C++ compiler (that compiles your
meta language, which is of course also C++) type-check what you did.

Oh Rich, do you know about LoweredASTVisitor?  Have you looked at how
the whole-program data-flow analysis is done in Oink?  You really
should give me a call.

Daniel



More information about the llvm-dev mailing list