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] PR32901: handle assignment...(and PR34465 and PR34448)


> > Hmm, I don't much like this part.  This function is supposed to just 
> > gimplify the constructor.  The tests for NOTIFY_TEMP_CREATION are simple 
> > enough to be hoisted into a single predicate for 
> > gimplify_modify_expr_rhs to use.
> > 
> > Otherwise, this one function grows in complexity and it already is a bit 
> > convoluted.
> 
> Could just a name change of the function help?  The thing is that
> both the predicate and the actual gimplification of the CONSTRUCTOR needs
> to compute a lot of stuff (categorize_ctor_elements itself sets 4 different
> things, then num_type_elements, further cleared adjustments, size,
> alignment), so if we have an predicate and gimplify_init_constructor as
> separate functions, we'd either need to duplicate a lot of stuff, or e.g.
> have some helper function which precomputes a lot of stuff into some temp
> structure, from which the predicate and gimplify_init_constructor then use it.

Exactly, what Jakub said. :).

I originally tried to factor this code out into a separate function, but
the current solution seemed a lot cleaner.

Aldy


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