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: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Converting tm.h macros to functions
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Mon, 18 Jun 2001 16:54:07 +0100 (BST)
- cc: Neil Booth <neil at daikokuya dot demon dot co dot uk>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
On Mon, 18 Jun 2001, Mark Mitchell wrote:
> target.h
> --------
>
> #define TARGET_INITIALIZER \
> { ASM_OUTPUT_INT }
>
> i386.c
> ------
>
> #define ASM_OUTPUT_INT ix86_asm_output_int
>
> struct target_t target = TARGET_INITIALIZER;
>
> I like this variant best, as it moves towards the direction of making
> the back-end a pluggable module.
I'd prefer to refine this a bit: have target.h as the public header for
the structure, and a separate target-def.h which defines the default for
ASM_OUTPUT_INT and defines TARGET_INITIALIZER, and only gets included in
the target .c files - to minimise where the macros are visible.
--
Joseph S. Myers
jsm28@cam.ac.uk