<div dir="ltr">I'm not sure I got your idea. <span style="font-size:16px">AttrHasAttributeImpl.inc works perfectly with new namespaces but it is not enough that's why I was forced to change </span><span style="font-size:16px">AttrParserStringSwitches.inc. (in fact I changed TableGen of course.)</span><div><span style="font-size:16px">It seems I don't understand something that's why it'd be better if you implement the fix by yourself.</span></div><div><span style="font-size:16px"><br></span></div><div><span style="font-size:16px"> Andrew V. Tischenko</span><span style="font-size:16px"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-10 20:53 GMT+03:00 Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Aug 10, 2015 at 4:43 AM, Андрей Тищенко<br>
<<a href="mailto:andrew.v.tischenko@gmail.com">andrew.v.tischenko@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
><br>
> Sorry for my previous email: there was some issue with my email system.<br>
><br>
> Hope you don't have any problems with reading my message now.<br>
><br>
><br>
> Aaron,<br>
><br>
><br>
><br>
> Not long ago I met a problem related to clang attributes implementation. I<br>
> tried to add a new CXX11 attribute with separated namespace like here:<br>
><br>
><br>
><br>
> def FooAligned : InheritableAttr {<br>
><br>
>   let Spellings = [CXX11<"_Foo_attrs", "aligned">];<br>
><br>
>   ….<br>
><br>
><br>
><br>
> But I was not able to do it because name “aligned” was used in another<br>
> well-known attribute. After some research I found that the problem was in<br>
> file “AttrParserStringSwitches.inc” generated by TableGen. Its content was<br>
> unaware about namespaces. As result my new “aligned” attribute was mentioned<br>
> like here:<br>
><br>
><br>
><br>
> #if defined(CLANG_ATTR_IDENTIFIER_ARG_LIST)<br>
><br>
> ….<br>
><br>
> .Case("aligned", true)<br>
><br>
> ….<br>
><br>
> #endif // CLANG_ATTR_IDENTIFIER_ARG_LIST<br>
><br>
><br>
><br>
> and there was real ambiguity in selection of proper attribute: GNU::aligned,<br>
> CXX11::aligned or CXX11:: _Foo_attrs::aligned.<br>
><br>
><br>
><br>
> The simplest way to resolve the issue is to change the new attribute name<br>
> but why should I do it if I use the unique namespace?<br>
<br>
</div></div>Since the attribute is in its own namespace, it *really* should not<br>
have to be unique. That's a bug.<br>
<span class=""><br>
> In my case I created a special patch allowing me to generate full qualified<br>
> names of attributes inside CLANG_ATTR_IDENTIFIER_ARG_LIST section:<br>
><br>
><br>
><br>
> #if defined(CLANG_ATTR_IDENTIFIER_ARG_LIST)<br>
><br>
> ….<br>
><br>
> .Case("CXX11:: _Foo_attrs::aligned", true)<br>
><br>
> ….<br>
><br>
> #endif // CLANG_ATTR_IDENTIFIER_ARG_LIST<br>
><br>
><br>
><br>
> My problem was resolved with this patch.<br>
><br>
> Is it interesting for anybody?<br>
><br>
> Should I create the corresponding bug record in Bugzilla?<br>
><br>
> Do you like to review my patch?<br>
><br>
> What about other sections inside “AttrParserStringSwitches.inc” using<br>
> unqualified attribute names?<br>
<br>
</span>I would be interested in reviewing your patch if you would like to go<br>
through the process. If you would prefer not to, or don't have the<br>
time, etc, I am happy to spend a bit of effort on this as well. I<br>
don't think AttrParserStringSwitches.inc should have fully-qualified<br>
names in the string switch cases. Instead, it should be modeled<br>
(slightly) after AttrHasAttributeImpl.inc where it accepts the syntax<br>
used as well as the scope and attribute name.<br>
<br>
Thanks!<br>
<br>
~Aaron<br>
<br>
><br>
><br>
><br>
> Andrew V. Tischenko<br>
><br>
><br>
</blockquote></div><br></div></div>