This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 'treelang' and GCC function-at-a-time mode
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 28 Dec 2001 03:42:17 +1100
- Subject: Re: 'treelang' and GCC function-at-a-time mode
- References: <1009154565.2928.0.camel@steven>
On 24-Dec-2001, Steven Bosscher <s.bosscher@student.tudelft.nl> wrote:
> From what I understand so far, the idea of this mode is to use the tree
> structures that used to be the C AST as a new IR.
Right, except IMHO those tree structures needed by other languages should
probably be changed to not be C-specific (i.e. moved from c-common.def to
tree.def).
> I should try to make
> my front-end build a whole tree for each function and translate that
> tree to RTL, instead of generating and translating trees piece-by-piece
> (per statement).
Right.
> I first tried to figure out how the existing front-ends work. People
> told me to look at the C and C++ front ends, but I never did any GCC
> hacking before so even that has proved to be too difficult for me :-)
Well, you could try looking at the functions finish_function(),
c_expand_body(), and c_expand_statement(), which handle the conversion
of trees to RTL. The code which actually builds the trees is spread
around a bit, but first look at the documentation of the tree structures
c-common.def, and then grep for calls to build_stmt().
> Next front-end I grepped in was 'treelang', which is supposed to be an
> example front end. But apparently it does not use function-at-a-time
> mode:
Correct (or at least it was last time I looked).
> (If I'm right, perhaps this front-end is not a very good example!)
Improvements always welcome... ;-)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.