On Wed, Apr 22, 2020 at 12:58:52PM +0200, Richard Biener wrote: > On Wed, 22 Apr 2020, Jakub Jelinek wrote: > > > On Wed, Apr 22, 2020 at 11:45:19AM +0100, Richard Sandiford wrote: > > > Given what was said on irc about DECL_NAME not necessarily being > > > significant for DECL_ARTIFICIAL decls, would it be better to drop > > > this part of the check? > > > > My preference was have it as narrow as possible for the time being, > > because we are shortly before release. > > We can replace it with an assertion or whatever later. > > Perhaps even the predicate should check for non-NULL and non-zero > > TYPE_SIZE (TREE_TYPE (field)). > > Btw, do we ever have more than one of those? The predicate doesn't
I think there can be at most one in each TYPE_FIELDS chain, but fields of that can have it in their TYPE_FIELDS of their TREE_TYPEs too of course. > check if the field is the "first" one (does it reliably appear > before non-FIELD_DECLs and thus is it always == TYPE_FIELDS (DECL_CONTEXT > (field))?) I don't think anything guarantees that, in C++ I think usually the methods appear first and there can be all kinds of other things in the chain (e.g. using declarations etc.). Jakub