[PATCH] Range accessors for tablegenning attributes

Richard Smith richard at metafoo.co.uk
Thu May 1 17:06:54 PDT 2014


On Wed, Apr 30, 2014 at 11:14 AM, Aaron Ballman <aaron at aaronballman.com>wrote:

> This patch creates a range accessor for attributes during tablegen, in
> addition to the iterators we already produce. It also updates a lot of
> iterator usages to be range usages.
>
> For the most part, there should be nothing contentious here, with one
> exception. In order to generate an accessor with a sensible
> identifier, we may need to pluralize the identifier. Eg)
> callableState_begin()/callableState_end() --> callableStates(), but
> args_begin()/args_end() --> args().
>
> I "solved" this with a poor-man's pluralizer that makes assumptions
> (which I've documented), but I think this is acceptable since this is
> only for use within variadic argument objects when tablegenning
> attributes. But I figured it was worth putting out as a patch to see
> if there were objections or better ideas.


The only variadic attribute argument that is not called 'Args' is called
'CallableState', and I think it would be clearer to rename that one
'CallableStates' (independent of any range-related changes). Then you can
get rid of the pluralization mechanism entirely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140501/9ea86188/attachment.html>


More information about the cfe-commits mailing list