patch: Re: rfc: auto-casted vector types

Jim Wilson wilson@redhat.com
Tue Feb 18 06:04:00 GMT 2003


Zack suggested using a target hook.  To add a target hook, you add a new
field to the gcc_target structure in target.h, you add a new target macro
for that field to target-def.h which defaults to 0, you add that macro
to TARGET_INITIALIZER in the same file, and then you add a define to the
rs6000.c file to override the default target macro.  In c-typeck.c, you
would then use (*targetm.new_field) instead of a macro.  I haven't done
this myself, so I could have missed something.  There are lots of existing
examples to look at, so it shouldn't be hard to figure out.

Jim



More information about the Gcc-patches mailing list