Hi, On Thu, 7 Nov 2013, Alec Teal wrote:
> > > 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. > How would you do this? How would I do what? Making use of new types? Well, like the opportunity that David already identified in tree-switching, I'd introduce the new type together with a patch to that pass to make use of it. Further I'd try to think about how that new type represents a concept, how that would be generalized, and how it would fit in a really designed type hierarchy of gimple statements. Then I would try to think about interaction of those new types with others we already have, in particular containers (should those become specialized as well? I would say no from my gut, but that question does need some pondering). > The types are different even if there is no actual difference, much like > there are different gimple codes in the first place. He is trying to > create a bijection between what we did have and what we now have Yes, I understood that, and that's IMO the wrong way to introduce new types. It really deserves some more than "we have these dozen gimple codes, let's create a dozen new types". So, while a bijection between codes and types is simple to create, I'm pretty sure that's not the best mapping. > so nothing breaks. Currently nothing is broken, so that's certainly not the reason to introduce new types. Ciao, Michael.