Thank you very much Aaron! :)<br><br>On Saturday, February 22, 2014, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks! I've applied your changes in r201941. I did have to change the<br>
codegen test so that it had a target triple, otherwise it was failing<br>
for me on Windows due to name mangling differences.<br>
<br>
~Aaron<br>
<br>
On Fri, Feb 21, 2014 at 8:52 PM, Marcello Maggioni <<a>hayarms@gmail.com</a>> wrote:<br>
> Hi Aaron,<br>
> thanks for your comments! I addressed your concerns in these 2 new patches.<br>
> The answers are inline<br>
><br>
> 2014-02-21 23:04 GMT+00:00 Aaron Ballman <<a>aaron@aaronballman.com</a>>:<br>
><br>
>> A few mostly minor comments below:<br>
>><br>
>> > diff --git a/docs/AttributeReference.rst b/docs/AttributeReference.rst<br>
>> > index 1d41cb3..3d718a4 100644<br>
>> > --- a/docs/AttributeReference.rst<br>
>> > +++ b/docs/AttributeReference.rst<br>
>> > @@ -558,6 +558,50 @@ caveats to this use of name mangling:<br>
>> ><br>
>> >  Query for this feature with<br>
>> > ``__has_extension(attribute_overloadable)``.<br>
>> ><br>
>> > +noduplicate<br>
>> > +-----------<br>
>> > +.. csv-table:: Supported Syntaxes<br>
>> > +   :header: "GNU", "C++11", "__declspec", "Keyword"<br>
>> > +<br>
>> > +   "X","X","",""<br>
>> > +<br>
>> > +The ``noduplicate`` attribute can be placed on function declarations to<br>
>> > control<br>
>> > +which overload whether function calls to this function can be<br>
>> > duplicated<br>
>> > +or not as a result of optimizations. This is required for the<br>
>> > implementation<br>
>> > +of functions with certain special requirements, like the OpenCL<br>
>> > "barrier",<br>
>> > +function that, depending on the hardware, might require to be run<br>
>> > concurrently<br>
>> > +by all the threads that are currently executing in lockstep on the<br>
>> > hardware.<br>
>> > +For example this attribute applied on the function "nodupfunc"<br>
>> > +avoids that this code:<br>
>> > +<br>
>> > +.. code-block:: c<br>
>> > +<br>
>> > +  void nodupfunc() __attribute__((noduplicate));<br>
>> > +  // Setting it as a C++11 attribute is also valid<br>
>> > +  // void nodupfunc() [[clang::noduplicate]];<br>
>> > +  void foo();<br>
>> > +  void bar();<br>
>> > +<br>
>> > +  nodupfunc();<br>
>> > +  if (a > n) {<br>
>> > +    foo();<br>
>> > +  } else {<br>
>> > +    bar();<br>
>> > +  }<br>
>> > +<br>
>> > +gets possibly modified by some optimization into code similar to this:<br>
>> > +<br>
>> > +.. code-block:: c<br>
>> > +<br>
>> > +  if (a > n) {<br>
>> > +    nodupfunc();<br>
>> > +    foo();<br>
>> > +  } else {<br>
>> > +    nodupfunc();<br>
>> > +    bar();<br>
>> > +  }<br>
>> > +<br>
>> > +where the barrier call is duplicated and sinked into the two branches<br>
>> > of the condition.<br>
>> ><br>
>> >  Variable Attributes<br>
>> >  ===================<br>
>> > diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td<br>
>> > index 3b70c4c..1368812 100644<br>
>> > --- a/include/clang/Basic/Attr.td<br>
>> > +++ b/include/clang/Basic/Attr.td<br>
>> > @@ -803,6 +803,12 @@ def NoDebug : InheritableAttr {<br>
>> >    let Documentation = [Undocumented];<br>
>> >  }<br>
>> ><br>
>> > +def NoDuplicate : InheritableAttr {<br>
>> > +  let Spellings = [GNU<"noduplicate">, CXX11<"clang", "noduplicate">];<br>
>> > +  let Subjects = SubjectList<[Function]>;<br>
>> > +  let Documentation = [NoDuplicateDocs];<br>
>> > +}<br>
>> > +<br>
>> >  def NoInline : InheritableAttr {<br>
>> >    let Spellings = [GCC<"noinline">, Declspec<"noinline">];<br>
>> >    let Subjects = SubjectList<[Function]>;<br>
>> > diff --git a/include/clang/Basic/AttrDocs.td<br>
>> > b/include/clang/Basic/AttrDocs.td<br>
>> > index a2476e4..d60de82 100644<br>
>> > --- a/include/clang/Basic/AttrDocs.td<br>
>> > +++ b/include/clang/Basic/AttrDocs.td<br>
>> > @@ -268,6 +268,49 @@ Query for thi</blockquote>