This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>, Jeff Law <law at redhat dot com>, David Malcolm <dmalcolm at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Andrew MacLeod <amacleod at redhat dot com>
- Date: Wed, 6 Nov 2013 13:23:30 +0000
- Subject: Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- Authentication-results: sourceware.org; auth=none
- References: <5271CBF9 dot 2070005 at redhat dot com> <1383236801-13234-1-git-send-email-dmalcolm at redhat dot com> <527960A8 dot 7030107 at redhat dot com> <CAFiYyc2okBUaSpm61XkeNv04ps4oofRcqu5G0yFmYhAs6FYzqg at mail dot gmail dot com> <527A21DB dot 301 at codesourcery dot com> <CAFiYyc0aX4a_oO_EPogK3V_4Pyp=Et+q7+jb_wgEbt5s8yfxyA at mail dot gmail dot com> <20131106114253 dot GY27813 at tucnak dot zalov dot cz>
On Wed, 6 Nov 2013, Jakub Jelinek wrote:
> On Wed, Nov 06, 2013 at 12:31:00PM +0100, Richard Biener wrote:
> > > Maybe we need to revisit it? As one of those who were not in favour of
> > > the C++ move, can I ask you guys to step back for a moment and think
> > > about - what do all of these changes buy us, exactly? Imagine the state
> > > at the end, where everything is converted and supposedly the temporary
> > > ugliness is gone, what have we gained over the code as it is now?
> > as_a gains us less runtime checking and more static type checking
> > which is good.
> But that really affects --enable-checking=yes builds (and only cases where
> things aren't inlined). If the price for that is uglier and less readable
> code, then the price is just too high.
I see static type checking as being about preventing certain sorts of bugs
getting in the compiler at all, rather than about saving time on runtime
checks for --enable-checking=yes.
I don't have advice on the gimple case. But certainly trees and RTL could
both do with more static typing. There, I'm thinking of different types
of objects (types, expressions, ...) logically being completely separate
static types, not inheriting from a common "tree" base class at all. But
if inheritance and as_a can be used as intermediate steps to allow an
incremental transition to completely separate static types, where
otherwise the whole source tree would need converting at once, that seems
reasonable to me. (I have no comments about what things should look like
in cases where completely separate static types don't make sense but there
is still some sort of inheritance structure.)
Joseph S. Myers