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

Delesley Hutchins delesley at google.com
Fri Jan 17 14:40:07 PST 2014


LGTM.  Nice cleanup!



On Fri, Jan 17, 2014 at 9:47 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> 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



-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315



More information about the cfe-commits mailing list