r223984 - Revert r223980 as it had wrong commit message.

Paul Robinson paul_robinson at playstation.sony.com
Wed Dec 10 15:32:57 PST 2014


Author: probinson
Date: Wed Dec 10 17:32:57 2014
New Revision: 223984

URL: http://llvm.org/viewvc/llvm-project?rev=223984&view=rev
Log:
Revert r223980 as it had wrong commit message.

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
    cfe/trunk/test/CodeGen/attr-optnone.c
    cfe/trunk/test/SemaCXX/attr-optnone.cpp
    cfe/trunk/test/SemaCXX/pragma-optimize.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=223984&r1=223983&r2=223984&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Dec 10 17:32:57 2014
@@ -3146,22 +3146,10 @@ static void handleAlwaysInlineAttr(Sema
                               Attr.getAttributeSpellingListIndex()));
 }
 
-static void handleMinSizeAttr(Sema &S, Decl *D,
-                              const AttributeList &Attr) {
-  if (checkAttrMutualExclusion<OptimizeNoneAttr>(S, D, Attr))
-    return;
-
-  D->addAttr(::new (S.Context)
-             MinSizeAttr(Attr.getRange(), S.Context,
-                         Attr.getAttributeSpellingListIndex()));
-}
-
 static void handleOptimizeNoneAttr(Sema &S, Decl *D,
                                    const AttributeList &Attr) {
   if (checkAttrMutualExclusion<AlwaysInlineAttr>(S, D, Attr))
     return;
-  if (checkAttrMutualExclusion<MinSizeAttr>(S, D, Attr))
-    return;
 
   D->addAttr(::new (S.Context)
              OptimizeNoneAttr(Attr.getRange(), S.Context,
@@ -4352,7 +4340,7 @@ static void ProcessDeclAttribute(Sema &S
     handleExtVectorTypeAttr(S, scope, D, Attr);
     break;
   case AttributeList::AT_MinSize:
-    handleMinSizeAttr(S, D, Attr);
+    handleSimpleAttribute<MinSizeAttr>(S, D, Attr);
     break;
   case AttributeList::AT_OptimizeNone:
     handleOptimizeNoneAttr(S, D, Attr);

Modified: cfe/trunk/test/CodeGen/attr-optnone.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-optnone.c?rev=223984&r1=223983&r2=223984&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/attr-optnone.c (original)
+++ cfe/trunk/test/CodeGen/attr-optnone.c Wed Dec 10 17:32:57 2014
@@ -9,7 +9,7 @@ __attribute__((always_inline))
 int test2() { return 0; }
 // OPTSIZE: @test2{{.*}}[[ATTR2:#[0-9]+]]
 
-__attribute__((optnone))
+__attribute__((optnone)) __attribute__((minsize))
 int test3() { return 0; }
 // PRESENT-DAG: @test3{{.*}}[[ATTR3:#[0-9]+]]
 

Modified: cfe/trunk/test/SemaCXX/attr-optnone.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-optnone.cpp?rev=223984&r1=223983&r2=223984&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-optnone.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-optnone.cpp Wed Dec 10 17:32:57 2014
@@ -6,9 +6,6 @@ int bar() __attribute__((optnone)) __att
 int baz() __attribute__((always_inline)) __attribute__((optnone)); // expected-error{{'always_inline' and 'optnone' attributes are not compatible}}
 int quz() __attribute__((optnone)) __attribute__((always_inline)); // expected-error{{'optnone' and 'always_inline' attributes are not compatible}}
 
-int bay() __attribute__((minsize)) __attribute__((optnone)); // expected-error{{'minsize' and 'optnone' attributes are not compatible}}
-int quy() __attribute__((optnone)) __attribute__((minsize)); // expected-error{{'optnone' and 'minsize' attributes are not compatible}}
-
 __forceinline __attribute__((optnone)) int bax(); // expected-error{{'__forceinline' and 'optnone' attributes are not compatible}}
 __attribute__((optnone)) __forceinline int qux(); // expected-error{{'optnone' and '__forceinline' attributes are not compatible}}
 

Modified: cfe/trunk/test/SemaCXX/pragma-optimize.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/pragma-optimize.cpp?rev=223984&r1=223983&r2=223984&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/pragma-optimize.cpp (original)
+++ cfe/trunk/test/SemaCXX/pragma-optimize.cpp Wed Dec 10 17:32:57 2014
@@ -55,13 +55,6 @@ int __attribute__((always_inline)) baz(i
 }
 // CHECK-DAG: @_Z3bazi{{.*}} [[ATTRBAZ:#[0-9]+]]
 
-// This function definition will not be decorated with `optnone` because the
-// attribute would conflict with `minsize`.
-int __attribute__((minsize)) bax(int z) {
-    return foo(z, 2);
-}
-// CHECK-DAG: @_Z3baxi{{.*}} [[ATTRBAX:#[0-9]+]]
-
 #pragma clang optimize on
 
 // The function "int wombat(int param)" created by the macro is not
@@ -151,7 +144,6 @@ int yet_another_normal(int x) {
 // Check that the other functions do NOT have optnone.
 // CHECK-DAG-NOT: attributes [[ATTRFOO]] = { {{.*}}optnone{{.*}} }
 // CHECK-DAG-NOT: attributes [[ATTRBAZ]] = { {{.*}}optnone{{.*}} }
-// CHECK-DAG-NOT: attributes [[ATTRBAX]] = { {{.*}}optnone{{.*}} }
 // CHECK-DAG-NOT: attributes [[ATTRWOMBAT]] = { {{.*}}optnone{{.*}} }
 // CHECK-DAG-NOT: attributes [[ATTRCONTAINER]] = { {{.*}}optnone{{.*}} }
 // CHECK-DAG-NOT: attributes [[ATTRTWICE]] = { {{.*}}optnone{{.*}} }





More information about the cfe-commits mailing list