[PATCH] Removing the "specialness" from thread-safety attribute parsing

Aaron Ballman aaron at aaronballman.com
Fri Jan 17 09:47:00 PST 2014


The thread safety attributes get a bit of special treatment hard-coded
into the parser which this patch removes. Specifically, some
thread-safety attributes are allowed to appear on function definitions
when late parsed even though they have a GNU-style attribute spelling
and that's usually disallowed.

This patch removes that "specialness" by making it a declarative
construct in Attr.td; there's a new attribute subject node called
FunctionDefinition which is treated as a FunctionDecl for diagnostic
purposes, but passes information along to the AttributeList object so
that it understands it can appear on a function definition. This is
then used in the places where IsThreadSafetyAttribute was being used.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FunctionDefn.patch
Type: application/octet-stream
Size: 11513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140117/290eb0a9/attachment.obj>


More information about the cfe-commits mailing list