This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Putting C++ code into gcc front end
Neil Booth <neil at daikokuya dot co dot uk> writes:
> Pop S?bastian wrote:-
>
> > On Thu, Mar 06, 2003 at 05:53:42PM -0800, Per Bothner wrote:
> > > Personally, I'd love to re-write all of Gcc in C++,
> > > starting with using inheritance for tree nodes, so
> > > we can actually get some static type-checking.
>
> Really, why does everything have to be shoehorned into being a tree?
> Decls, expressions, scopes / symbol tables, statements etc should
> all be their own data type. We can get perfectly good type checking
> in C if we don't insist the universe is made up of trees.
>
> cpplib hasn't made everything a tree. There's no reason for everything
> to be a tree in the front ends either.
Yes, I completely agree. In particular, we currently represent types
and statements/expressions using trees, and I believe it's never the
case that you can substitute one for the other (and what would that
mean, anyway?); so why don't we have completely distinct type_tree and
expr_tree data structures?
Of course, this has been mentioned several times before, and no-one's
produced a patch...
--
- Geoffrey Keating <geoffk at geoffk dot org>