[PATCH] Support default integer attribute arguments

Richard Smith richard at metafoo.co.uk
Wed Nov 20 15:59:51 PST 2013


LGTM. I assume you reversed the visitation order for superclasses to visit
the most-derived class first?


On Wed, Nov 20, 2013 at 3:55 PM, Aaron Ballman <aaron at aaronballman.com>wrote:

> Attr.td has the notion of a DefaultIntArgument that currently does
> nothing special. This patch adds table generator support such that
> attributes which use the DefaultIntArgument type are given a static
> const class member that names the default value.  Eg)
>
> let Args = [DefaultIntArgument<"Priority", 65535>];
>
> Would give the generated attribute class a public member:
>
> static const int DefaultPriority = 65535;
>
> This can then be used in place of magic numbers elsewhere (and
> consequently, this patch removes a few such FIXMEs).
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131120/d41e9cd5/attachment.html>


More information about the cfe-commits mailing list