On Mon, 28 Feb 2005, Dave Korn wrote:
>   Hmmm, actually, I would say that moving these macro definitions into the
> cpu.c files is a fairly mechanical and trivial transformation.  Given:

WRONG!

> ${CPU}.h:
> #define GO_IF_LEGITIMATE_ADDRESS(MODE,X,ADDR) \
>   if ( .... some very hairy conditional depending on REG_OK_STRICT ) \
>     goto ADDR;
>
> you just redefine it as
>
> ${CPU}.h
> #define GO_IF_LEGITIMATE_ADDRESS(MODE,X,ADDR) \
>   if (${CPU}_go_if_legitimate_address ((MODE), (X), (REG_OK_STRICT)) \
>     goto ADDR;
>
> ${CPU}.c
> int ${CPU}_go_if_legitimate_address (enum machine_mode mode, rtx x, int
> reg_ok_strict)
> {
>   return ( ... same conditional s/REG_OK_STRICT/reg_ok_strict/g );
> }

And then, much later on, perhaps not even from the GCC
test-suite, you find that a helper macro of a helper macro used
in the GO_IF_LEGITIMATE_ADDRESS (said helper macro still being
defined in cpu.h) is dependent on REG_OK_STRICT.

As a port mauthor/maintainer, you do this *once*.  Then you stay
alert about moving REG_OK_STRICT-dependent things into cpu.c.

brgds, H-P

Reply via email to