[cfe-dev] clang leveraging Elsa?
Chris Lattner
clattner at apple.com
Wed Oct 3 11:42:16 PDT 2007
On Oct 1, 2007, at 1:00 PM, Taras Glek wrote:
> I just found out about clang from the LLVM 2.1 announcement. It's
> great
> to see someone working on a C++ front-end with an emphasis on
> source2source and static analysis. I've been writing tools for that
> using the Elsa frontend for the past year.
Nifty!
> Elsa is further along in development (fairly complete in that it can
> parse most of the C/C++ code that gcc3.4 accepts). Have the clang
> developers considered reusing parts of the elsa? I haven't noticed a
> mention of elsa in the list archives.
We have. The killer problem is that Elsa's implementation will not
allow us to achieve the performance goals of the clang project. In
addition, Elsa doesn't solve the hard part of C++ parsing (the
semantic analysis and type checking), isn't built as a reusable
library (in the way clang aims to be), doesn't get the corner cases
of the languages it parses correct, etc.
While we could extend Elsa to complete its support for C++ and polish
the corner cases, fixing the performance issues would require a
complete redesign. As such, reusing elsa is a non-starter. :(
> Elsa comes with an extensive testsuite and has some design
> similarities
> to clang as described in the clang Internals manual.
When we get that far, I expect clang to extensively leverage the
available test suites, including the GCC test suite, elsa, as well as
just building tons of open source software.
> I am very interested in clang since it will be a C/C++/ObjC frontend
> that's suitable for source analysis that also serves as a frontend
> to a
> production compiler.
> My biggest gripe with Elsa is that isn't developed in a transparent
> fashion. It also occasionally has bugs that would be caught if it
> were
> used as a frontend for a compiler.
clang is definitely developed in the open and welcomes contributors.
However, our C++ support is basically non-existent (and we don't have
anyone really working on it), so Elsa is probably a better solution
to C++ parsing issues in the short term. Over the next couple years,
I expect the clang C++ support to come up to the point where it is
both industrial quality and useful for a broad variety of clients.
It also has much better ObjC support than elsa ;-)
-Chris
More information about the cfe-dev
mailing list