[PATCH] Removing the notion of an attribute parameter

Richard Smith richard at metafoo.co.uk
Fri Aug 30 17:06:37 PDT 2013


Can you confirm my understanding:
 * for attributes that don't have an 'identifier, expression...' form, we
use getArgAsExpr and get an assert if the argument is not an expression.
 * for attributes that might have an 'identifier, expression...' form, the
parser will sometimes give us an 'expression...' form instead, so those
cases always check isArgExpr.

(Given that, it seems surprising to me that alias, weakref, and the
'handleAttrWithMessage' need the isArgExpr check. But it looks like that's
because we have some confusion over whether a StringArgument represents a
string literal or an identifier, and I don't want this patch blocked on
sorting that out!)

You have "else if" after an "if" that returns in a few places in
SemaDeclAttr. We prefer to drop the 'else' in this case. Otherwise, LGTM.


On Fri, Aug 30, 2013 at 3:57 PM, Aaron Ballman <aaron at aaronballman.com>wrote:

> This patch consolidates the notion of a GNU attribute parameter with
> the argument list.  This makes for considerably easier error reporting
> in the long run since the attribute arguments specified in the td file
> match the arguments passed in via the AttributeList.
>
> It accomplishes this by using a PointerUnion of identifier information
> and expressions.  While the patch is pretty large, the vast majority
> of the changes come from using this discriminated union where we used
> to look for a parameter or an expression specifically.
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130830/f9449d77/attachment.html>


More information about the cfe-commits mailing list