[PATCH] Improve attributes printing.
richard at metafoo.co.uk
Sat Mar 16 18:01:36 PDT 2013
On Thu, Mar 14, 2013 at 10:16 AM, Michael Han <fragmentshaders at gmail.com>wrote:
> Thanks, this sounds good.
> Rather than passing an enum value to 'printPretty' that indicates where
> the attributes are, how about passing an enum value to it that indicates
> the syntax of the attribute so when we ask all attributes to print
> themselves, only the specified syntax(es) will be printed out?
I don't think that will work out so well -- it'd require the declaration
printer etc. to know about all forms of attribute, and in general the
attribute syntax isn't sufficient to know where the attribute should go
(for instance, the 'final' keyword attribute goes at the end of the
declaration, but the '_Noreturn' keyword attribute goes at the start, and
the 'alignas' keyword attribute goes after the identifier).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits