This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Target FUNCTION_{PRO,EPI}LOGUE question
- To: Joern Rennecke <amylaar at redhat dot com>
- Subject: Re: Target FUNCTION_{PRO,EPI}LOGUE question
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 2 Jul 2001 22:17:43 +0100
- Cc: Jeff Sturm <jsturm at one-point dot com>, Fergus Henderson <fjh at cs dot mu dot oz dot au>,"Joseph S. Myers" <jsm28 at cam dot ac dot uk>, gcc at gcc dot gnu dot org
Joern Rennecke wrote:-
> > I don't follow... why does a compiler pass benefit from function-centric
> > rather than type-centric coding?
>
> If you made the compiler type-centric, you'd explode a switch with some
> 100 cases and maybe 30 code fragments into 100 little functions, with
> excruciatingly long and / or completely incomprehensible names, scattered
> all over the compiler.
> Repeat multiple times for each optimization pass.
>
> That is object oriented spaghetti.
Well, don't do it that way then!
You could create a /tree directory, perhaps, with one file per tree
type, and define all the member functions in there. Everything can be
static, and with short names. See current target work for an example
on how this can be done easily and cleanly. I fail to see how it can
be considered worse than the current way.
Neil.