This is the mail archive of the 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 0/6] Convert gimple to a C++ class hierarchy

On Mon, 2013-09-02 at 13:44 +0200, Michael Matz wrote:
> Hi,
> On Fri, 30 Aug 2013, David Malcolm wrote:
> > > And the manual GTY markers are so not maintainable in the long run, 
> > > gengtype or something else really needs to be taught to create them 
> > > automatically.
> > 
> > Apart from the GTY aspect, how do people feel about the patch series?
> Generally I like it, the parts I don't like are common to all the 
> C++ification patches [2].  The manual GTY parts give me the creeps, but I 
> think I expressed that already :)
> Ciao,
> Michael.
> [1] 
> [2] In this series it's the is_a/has_a/dyn_cast uglification,
>     -  gcc_gimple_checking_assert (gimple_has_mem_ops (g));
>     -  g->gsmembase.vuse = vuse;
>     +  gimple_statement_with_memory_ops *mem_ops_stmt =
>     +    as_a <gimple_statement_with_memory_ops> (g);
>     +  mem_ops_stmt->vuse = vuse;
>     I can't really say I find this shorter, easier to read, more
>     expressive or even safer than what was there before.  And the 
>     repetition for adding the helpers for const and non-const types
>     all the time doesn't make it better.
Part of this is the verbose struct names.  I mentioned getting rid of
the "_statement" part of the typenames, I think I'll do that.

The other part is that the accessor functions become redundant, and that
you'd be able to do the cast once, and then use all of the various
fields of a gimple_whatever, bypassing the getters/setters.

>     (Btw: something for your helper script: it's customary to put the
>     '=' to the next line; I know there is precedent for your variant,
>     but '=' on next line is prevalent)
Thanks; I'll fix that.

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