[PATCH 1/2] add staticly checked label_nuses accessors

Jeff Law law@redhat.com
Thu Sep 11 20:59:00 GMT 2014

On 09/05/14 15:57, David Malcolm wrote:
> One other aspect of my approach is that (believe it or not) I'm trying
> to minimize the size of the changes, to avoid introducing pain when
> backporting bugfixes from trunk to the branches.
Right.  I believe and know you're trying to avoid unnecessary pain :-)

> My goal here is type-safety, with readability as a secondary benefit.
Agreed.  However, consistency with access is also important.  But, yes, 
we're really focused on moving on type safety here.

> think it's a good idea for us to add methods that let us replace e.g.
> XEXP (x, 0) accessors with descriptive names, and have been doing so,
> and I prefer doing this as methods for new code.
As you undoubtly know, there's some resistance to that ;-)  But in cases 
where we can carve off things easily (like the list stuff) converting to 
members, at least IMHO, is much cleaner.  But I think we're a long way 
from converting RTL as a whole.

  However, when the
> accessor already has a descriptive name, like LABEL_NUSES, I think it's
> enough to convert them to inline functions and tighten up the params and
> return type to express things.  I'm not sure the cost/benefit of
> *additionally* converting them to be methods is worth it, given that it
> means changing the spelling at every callsite.
My feelings as well.


More information about the Gcc-patches mailing list