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


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


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