This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Recursion Optimization


> From: Mark Mitchell <mark@codesourcery.com>
> Date: Mon, 16 Aug 1999 23:19:32 -0700

> Not directly.  But, in the long term, it is my opinion that the C
> front-end and the C++ front-end should merge, or at least share a
> tremendous amount of common code.

:-) Well, more of the later than the former.  I don't think the first
is realistic.  The second one can do by identifying common things and
moving the code out to a common area, full documenting it and
describing the semantics of it, and changing the frontends to use it.

I see no reason why extremely large swaths of code can't be shared.
Unfortunately, there isn't enough attention payed to high level common
semantics I think to allow for this type of unification.

This happens at lower levels fairly well (rtl and down), but trees and
up, it seems like more could be done.


Let me give one simple example.  The symbol table.  The one in C++ is
powerful, have tons of interesting semantics, is probably a proper
super set of most other langauges, and yet, there is almost zero
sharing (I think the hash function is shared).  This includes
peripheral routines like symbol lookup.

I think in time, we need to migrate more routines from frontends (now
that we actually have more than 2 of them :-)) to the midend, and in
so doing collapse and unify them.  I think we should do it lazily and
only when two or more frontends actually need the semantics.

If someone wanted to try their hand at it, we could vote and nominate
a bit of functionality, and the person could try it out.  I don't
think it would be that hard, just have to pay attention to detail and
be able to unify to seemingly disparate sets of code.  Though, I
imagine the interfaces would also need to be cleansed of impurities
(hey, I am sure we have some of those in C++) and various code
jiggered with so that it would fit.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]