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: gcc at gcc dot gnu dot org, jsm28 at cam dot ac dot uk
- Subject: Re: Converting tm.h macros to functions
- From: mike stump <mrs at windriver dot com>
- Date: Mon, 18 Jun 2001 14:03:31 -0700 (PDT)
> Date: Sun, 17 Jun 2001 18:10:06 +0100 (BST)
> From: "Joseph S. Myers" <jsm28@cam.ac.uk>
> To: <gcc@gcc.gnu.org>
> * Where should the default versions of these functions go? In random
> source files, or in a new defaults.c?
defaults.c sounds nice...
> * How should a target indicate that it has its own version of one of these
> functions?
In the short term, maybe:
#define ASM_FOO_BAR(a) default_asm_foo_bar(a)
though, longer term, there should be a more elegant way of doing this.
Another possibility is to build a library file with names like:
asm_output_foo(), and the have the port define their own with the same
name to override, if they want, and if they don't, it will be pulled
out of the library.
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.
Here is an example of what should go into it, and why:
$ cat */*.h | grep TARGET_FF | sort | uniq -c | sort -nr
25 #define TARGET_FF 014
7 #define TARGET_FF 014
2 #define TARGET_FF 0xc
1 #define TARGET_FF 014
1 #define TARGET_FF '\f'
1 #define TARGET_FF 12
1 #define TARGET_FF 0xc /* '\f' */
1 #define TARGET_FF 014
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.