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: Target FUNCTION_{PRO,EPI}LOGUE question


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.


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