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


Mark et al. wrote:
> > 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.
> 
> Sure.  I was mostly just trying to show how to get around the
> "adding a function means everything has to change" problem.
> 
> I see building interfaces like this as one of the absolutely best things
> we can do to increase the reliability of GCC, and to make it easier
> for us to develop the compiler.

If you are willing to consider using AutoGen to put together pieces
like this, it becomes quite easy to extend functionality without having
to go back and hack older definitions.  Unlike CPP macros, the
expansions
are entirely programmable.  The only reason I never bothered to suggest
replacing the gen*.c programs, however, is that the conversion requires
this weirdo tool that nobody knows about....You would wind up with the
problem of either distributing generated source or requiring this tool.
I don't know how far you can go with it.

Regards,
	Bruce


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