<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 3:12 PM, Paul Robinson <span dir="ltr"><<a href="mailto:paul_robinson@playstation.sony.com" target="_blank">paul_robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: probinson<br>
Date: Wed Dec 10 17:12:37 2014<br>
New Revision: 223980<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=223980&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=223980&view=rev</a><br>
Log:<br>
Rename a couple of preprocessor symbols to be more descriptive. NFC.<br>
Review feedback from recent changes to GetSVN.cmake.<br></blockquote><div><br></div><div>This commit message doesn't seem to match the commit contents.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp<br>
    cfe/trunk/test/CodeGen/attr-optnone.c<br>
    cfe/trunk/test/SemaCXX/attr-optnone.cpp<br>
    cfe/trunk/test/SemaCXX/pragma-optimize.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=223980&r1=223979&r2=223980&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=223980&r1=223979&r2=223980&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Dec 10 17:12:37 2014<br>
@@ -3146,10 +3146,22 @@ static void handleAlwaysInlineAttr(Sema<br>
                               Attr.getAttributeSpellingListIndex()));<br>
 }<br>
<br>
+static void handleMinSizeAttr(Sema &S, Decl *D,<br>
+                              const AttributeList &Attr) {<br>
+  if (checkAttrMutualExclusion<OptimizeNoneAttr>(S, D, Attr))<br>
+    return;<br>
+<br>
+  D->addAttr(::new (S.Context)<br>
+             MinSizeAttr(Attr.getRange(), S.Context,<br>
+                         Attr.getAttributeSpellingListIndex()));<br>
+}<br>
+<br>
 static void handleOptimizeNoneAttr(Sema &S, Decl *D,<br>
                                    const AttributeList &Attr) {<br>
   if (checkAttrMutualExclusion<AlwaysInlineAttr>(S, D, Attr))<br>
     return;<br>
+  if (checkAttrMutualExclusion<MinSizeAttr>(S, D, Attr))<br>
+    return;<br>
<br>
   D->addAttr(::new (S.Context)<br>
              OptimizeNoneAttr(Attr.getRange(), S.Context,<br>
@@ -4340,7 +4352,7 @@ static void ProcessDeclAttribute(Sema &S<br>
     handleExtVectorTypeAttr(S, scope, D, Attr);<br>
     break;<br>
   case AttributeList::AT_MinSize:<br>
-    handleSimpleAttribute<MinSizeAttr>(S, D, Attr);<br>
+    handleMinSizeAttr(S, D, Attr);<br>
     break;<br>
   case AttributeList::AT_OptimizeNone:<br>
     handleOptimizeNoneAttr(S, D, Attr);<br>
<br>
Modified: cfe/trunk/test/CodeGen/attr-optnone.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-optnone.c?rev=223980&r1=223979&r2=223980&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-optnone.c?rev=223980&r1=223979&r2=223980&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGen/attr-optnone.c (original)<br>
+++ cfe/trunk/test/CodeGen/attr-optnone.c Wed Dec 10 17:12:37 2014<br>
@@ -9,7 +9,7 @@ __attribute__((always_inline))<br>
 int test2() { return 0; }<br>
 // OPTSIZE: @test2{{.*}}[[ATTR2:#[0-9]+]]<br>
<br>
-__attribute__((optnone)) __attribute__((minsize))<br>
+__attribute__((optnone))<br>
 int test3() { return 0; }<br>
 // PRESENT-DAG: @test3{{.*}}[[ATTR3:#[0-9]+]]<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/attr-optnone.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-optnone.cpp?rev=223980&r1=223979&r2=223980&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-optnone.cpp?rev=223980&r1=223979&r2=223980&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/attr-optnone.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/attr-optnone.cpp Wed Dec 10 17:12:37 2014<br>
@@ -6,6 +6,9 @@ int bar() __attribute__((optnone)) __att<br>
 int baz() __attribute__((always_inline)) __attribute__((optnone)); // expected-error{{'always_inline' and 'optnone' attributes are not compatible}}<br>
 int quz() __attribute__((optnone)) __attribute__((always_inline)); // expected-error{{'optnone' and 'always_inline' attributes are not compatible}}<br>
<br>
+int bay() __attribute__((minsize)) __attribute__((optnone)); // expected-error{{'minsize' and 'optnone' attributes are not compatible}}<br>
+int quy() __attribute__((optnone)) __attribute__((minsize)); // expected-error{{'optnone' and 'minsize' attributes are not compatible}}<br>
+<br>
 __forceinline __attribute__((optnone)) int bax(); // expected-error{{'__forceinline' and 'optnone' attributes are not compatible}}<br>
 __attribute__((optnone)) __forceinline int qux(); // expected-error{{'optnone' and '__forceinline' attributes are not compatible}}<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/pragma-optimize.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/pragma-optimize.cpp?rev=223980&r1=223979&r2=223980&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/pragma-optimize.cpp?rev=223980&r1=223979&r2=223980&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/pragma-optimize.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/pragma-optimize.cpp Wed Dec 10 17:12:37 2014<br>
@@ -55,6 +55,13 @@ int __attribute__((always_inline)) baz(i<br>
 }<br>
 // CHECK-DAG: @_Z3bazi{{.*}} [[ATTRBAZ:#[0-9]+]]<br>
<br>
+// This function definition will not be decorated with `optnone` because the<br>
+// attribute would conflict with `minsize`.<br>
+int __attribute__((minsize)) bax(int z) {<br>
+    return foo(z, 2);<br>
+}<br>
+// CHECK-DAG: @_Z3baxi{{.*}} [[ATTRBAX:#[0-9]+]]<br>
+<br>
 #pragma clang optimize on<br>
<br>
 // The function "int wombat(int param)" created by the macro is not<br>
@@ -144,6 +151,7 @@ int yet_another_normal(int x) {<br>
 // Check that the other functions do NOT have optnone.<br>
 // CHECK-DAG-NOT: attributes [[ATTRFOO]] = { {{.*}}optnone{{.*}} }<br>
 // CHECK-DAG-NOT: attributes [[ATTRBAZ]] = { {{.*}}optnone{{.*}} }<br>
+// CHECK-DAG-NOT: attributes [[ATTRBAX]] = { {{.*}}optnone{{.*}} }<br>
 // CHECK-DAG-NOT: attributes [[ATTRWOMBAT]] = { {{.*}}optnone{{.*}} }<br>
 // CHECK-DAG-NOT: attributes [[ATTRCONTAINER]] = { {{.*}}optnone{{.*}} }<br>
 // CHECK-DAG-NOT: attributes [[ATTRTWICE]] = { {{.*}}optnone{{.*}} }<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>