This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- From: Ian Lance Taylor <iant at google dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: 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: Tue, 5 Nov 2013 15:23:30 -0800
- 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> <1383688624 dot 5282 dot 111 dot camel at surprise> <52796D38 dot 2010602 at redhat dot com>
On Tue, Nov 5, 2013 at 2:12 PM, Jeff Law <law@redhat.com> wrote:
>
> I can't speak for Andrew, but my experience with this kind of object type
> casting in a large C++ project is that it's a red flag for a design problem.
I'm going to chime in to say that I think it's a pretty typical way to
represent a compiler IR in C++. There is a base type that a lot of
code uses, but there is also a real type, and the way to get to that
real type is to use a cast. We could do it all with virtual
functions, but those carry a different cost. In effect, using virtual
functions increases the size of the code field from 16 bits to 64
bits. It adds up.
Also this seems to be a pretty direct version of the data structures
we already have.
Ian