[cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

Michael Han fragmentshaders at gmail.com
Fri Jan 11 15:53:44 PST 2013


Hi,

Attached patch is to fix PR14922. Currently when print an attribute the GNU
syntax will always be used, even if the attribute has no GNU syntax.The fix
is to pass the syntax flag when constructing the Attr node and take that
into consideration when printing the attribute. The name of actual
attribute gets printed is read from table gen definition file so there is
still some limitations, for example, when an attribute has multiple
spellings, the first spelling is used; and the namespace of the attribute
(in case it's a C++11 attribute) is not printed. I test the patch locally
in my project which has access to Clang AST but I am not sure how to write
a stand alone test to test the attribute pretty print.  After this patch
gets in I'll send another patch which updates the SemaDeclAttr to pass the
actual syntax flag from AttributeList to Attr.

Thanks!
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130111/19cd4b3c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attr-print.patch
Type: application/octet-stream
Size: 4725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130111/19cd4b3c/attachment.obj>


More information about the cfe-commits mailing list