This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH 5/9] Come up with an abstraction.


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.

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