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: Converting tm.h macros to functions


mike stump wrote:-

> I think the most popular versions of every macro should be defaulted
> and shared.  They can can provide guidance to new port writers on how
> they should do the port.  It would be nice to increase the amount of
> bits that are shared.

If I understand what you're saying correctly, this already happens in
Mark's proposal - every item of "struct gcc_target" is defaulted, and
a port has to do something active to override it.

At present I'm going with "target.h" for the struct declaration, which
will end up being pulled in from almost every file as we add more
stuff to it, and "target-def.h" for the default initializers.

The bit I've already done has gotten rid of 3 separate copies of a
single routine from config/*/*, putting a single copy in tree.c where
it more properly fits in.  It's conditionally compiled, but I think
one conditional compilation is a lesser evil than 3 separate scattered
copies of a single non-trivial routine.

> Doing this, should simplify the complexity of the ports.
> 
> I'd like to see more work done to decrease the complexity and hair of
> the ports.

Me too - this kind of stuff helps beginners like me to start to
understand what's going on.  Until now, I've studiously avoided
working out what happens for configury and how config/*/* works;
there's no getting away from it now :-)

Neil.


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