Jakub Jelinek:
On Sun, Nov 06, 2011 at 01:12:21PM +0100, Paolo Bonzini wrote: > What about adding a macro indirection to more functions (like you > did with SET_HARD_REG_BIT and friends), so that pass-by-value can be > changed to pass-by-reference without affecting all the uses > throughout the compiler?Or keep HARD_REG_SET type as is and just use a new struct type which contains HARD_REG_SET or HARD_REG_SET * in it. struct hard_reg_set_ptr; void (*live_on_entry) (struct hard_reg_set_ptr *); in the target* headers and struct hard_reg_set_ptr { HARD_REG_SET *set; };
All these variants don't address the the interface problem we's get in the target hooks. A type used in a target hook should be compatible with all targets simultaneously. A long * or a void * would be OK, but if you point to a HARD_REG_SET or something containing it, you have to consider the one-definition rule when it eventally comes to linking/and or loading multiple or alternative backends into the compiler.
