Hi,
On Mon, 12 Aug 2019, Martin Liška wrote:
> > You seem to need it only to have the possibility of virtual functions,
> > i.e. fancy callbacks. AFAICS you only have one derived class, i.e. a
> > simple distinction of two cases. What do you think about encoding the
> > additional new (ICF) case in the (existing) 'flags' argument to
> > operand_equal_p (and in case the ICF flag is set simply call the
> > "callback" directly)?
>
> That's possible. I can add two more callbacks to the operand_equal_p
> function (hash_operand_valueize and operand_equal_valueize).
That's premature; why provide callbacks when it's always either NULL or
a single value? What I meant is put code like this into operand_equal_p:
if (flags & OE_FOR_ICF)
op0 = oep_icf_valueize (op0);
...
Less indirection, less confusion.
Ciao,
Michael.