[PATCH] Distinguishing between user-written and implicit attributes

Aaron Ballman aaron at aaronballman.com
Wed Jan 15 18:17:45 PST 2014


This patch implements the ability to distinguish between attributes
explicitly written at the request of the user, and attributes
implicitly generated to assist in bookkeeping by the compiler. It
additionally removes the optional nature of the spelling list index
when creating attributes. These two things go hand in hand because the
spelling of the attribute is semantically important in some cases.

All attributes now receive a table-generated factory function named
CreateImplicit. This function creates a new instance of the attribute,
and flags it as being implicitly created. This attribute is then
inserted into the AST as normal, but consumers of the AST are able to
check whether the attribute was implicitly generated, if it suits
them. Currently, no AST consumer cares (outside of the AST dumper, for
testing purposes), but the expectation is that this will change.

If the attribute has distinct spellings (where distinct is defined as
"differing in more than just spelling varieties and leading/trailing
underscores), it also receives a Spelling enumeration. This allows
spelling-specific implicit attributes to be created without relying on
fragile mechanisms.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Implicit.patch
Type: application/octet-stream
Size: 33280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140115/012fff74/attachment.obj>


More information about the cfe-commits mailing list