This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add gimple subclasses for every gimple code (was Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3))
- From: Michael Matz <matz at suse dot de>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Andrew MacLeod <amacleod at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Nov 2013 16:32:39 +0100 (CET)
- Subject: Re: [PATCH] Add gimple subclasses for every gimple code (was 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> <52741EE2 dot 3030100 at redhat dot com> <1383671947 dot 5282 dot 93 dot camel at surprise>
Hi,
On Tue, 5 Nov 2013, David Malcolm wrote:
> Here's a followup patch which ensures that every gimple code has its own
> subclass, by adding empty subclasses derived from the GSS_-based
> subclasses as appropriate (I don't bother for gimple codes that already
> have their own subclass due to having their own GSS layout). I also
> copied the comments from gimple.def into gimple.h, so that Doxygen picks
> up on the descriptions and uses them to describe each subclass.
I don't like that. The empty classes are just useless, they imply a
structure that isn't really there, some of the separate gimple codes are
basically selectors of specific subtypes of a generic concept, without
additional data or methods; creating a type for those is confusing.
Generally I don't like complicating the type system without good reasons
(as in actually also making use of the complicated types). The fewer
types the better IMO.
Ciao,
Michael.