This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Converting tm.h macros to functions
- To: mike stump <mrs at windriver dot com>
- Subject: Re: Converting tm.h macros to functions
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Tue, 19 Jun 2001 06:49:56 +0100
- Cc: gcc at gcc dot gnu dot org, jsm28 at cam dot ac dot uk
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.