[PATCH] Generate diagnostic checks for attribute subjects

Richard Smith richard at metafoo.co.uk
Tue Nov 26 14:35:15 PST 2013

Looks great! Just a couple of questions:

1) In CalculateDiagnostic, it looks like you sometimes pick a diagnostic
that's not an exact match for the subjects list. What cases do we hit where
we don't have an exact match, and have you considered extending the list to
cover those too? (I also wonder whether we can do better here -- maybe by
including Attr.td into DiagnosticSemaKinds.td and generating extra
diagnostics from Attr.td or similar -- but I don't want that blocking this

2) In GenerateAppertainsTo, you bail out for an attribute with custom
parsing. I find that surprising -- that flag affects how the attribute is
parsed into an AttributeList, but I don't see why it should have any
implications on subject checking. Checking SemaHandler here would make
sense to me, but that looks unnecessary. What's this for?

On Tue, Nov 26, 2013 at 12:51 PM, Aaron Ballman <aaron at aaronballman.com>wrote:

> This patch lays the basic groundwork for table generating the
> diagnostics for attribute subjects. It does this by making some
> modifications to the way subjects are listed in Attr.td, and updating
> the attr emitter to handle the new constructs.
> I have disabled some attribute subject lines on purpose in Attr.td;
> this part is a WIP with the goal being to restore those subjects
> incrementally. By commenting them out, it leaves the original behavior
> the same as before for those attributes and so those are not
> functionality changes.
> ~Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131126/d1f308ae/attachment.html>

More information about the cfe-commits mailing list