This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 03 Sep 2013 21:12:07 -0400
- Subject: Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy
- Authentication-results: sourceware.org; auth=none
- References: <1377793216-22549-1-git-send-email-dmalcolm at redhat dot com> <alpine dot LNX dot 2 dot 00 dot 1308301532490 dot 9949 at wotan dot suse dot de> <1377890482 dot 29222 dot 32 dot camel at surprise> <alpine dot LNX dot 2 dot 00 dot 1309021310510 dot 9949 at wotan dot suse dot de>
On Mon, 2013-09-02 at 13:44 +0200, Michael Matz wrote:
> 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 . The manual GTY parts give me the creeps, but I
> think I expressed that already :)
>  http://frakked.de/~matz/kdecore.cc.gz
>  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.