From 621b6d3bf7ef7293dd09e315f0a9d1238109d929 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Wed, 10 Dec 2014 23:32:57 +0000 Subject: [PATCH] Revert r223980 as it had wrong commit message. llvm-svn: 223984 --- clang/lib/Sema/SemaDeclAttr.cpp | 14 +------------- clang/test/CodeGen/attr-optnone.c | 2 +- clang/test/SemaCXX/attr-optnone.cpp | 3 --- clang/test/SemaCXX/pragma-optimize.cpp | 8 -------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 9cace20..ffb8b77 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3146,22 +3146,10 @@ static void handleAlwaysInlineAttr(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } -static void handleMinSizeAttr(Sema &S, Decl *D, - const AttributeList &Attr) { - if (checkAttrMutualExclusion(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(S, D, Attr)) return; - if (checkAttrMutualExclusion(S, D, Attr)) - return; D->addAttr(::new (S.Context) OptimizeNoneAttr(Attr.getRange(), S.Context, @@ -4352,7 +4340,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleExtVectorTypeAttr(S, scope, D, Attr); break; case AttributeList::AT_MinSize: - handleMinSizeAttr(S, D, Attr); + handleSimpleAttribute(S, D, Attr); break; case AttributeList::AT_OptimizeNone: handleOptimizeNoneAttr(S, D, Attr); diff --git a/clang/test/CodeGen/attr-optnone.c b/clang/test/CodeGen/attr-optnone.c index 020218a..2a6e0d1 100644 --- a/clang/test/CodeGen/attr-optnone.c +++ b/clang/test/CodeGen/attr-optnone.c @@ -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]+]] diff --git a/clang/test/SemaCXX/attr-optnone.cpp b/clang/test/SemaCXX/attr-optnone.cpp index e2fce8e..eaa5000 100644 --- a/clang/test/SemaCXX/attr-optnone.cpp +++ b/clang/test/SemaCXX/attr-optnone.cpp @@ -6,9 +6,6 @@ int bar() __attribute__((optnone)) __attribute__((noinline)); 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}} diff --git a/clang/test/SemaCXX/pragma-optimize.cpp b/clang/test/SemaCXX/pragma-optimize.cpp index b84d232..0a9f041 100644 --- a/clang/test/SemaCXX/pragma-optimize.cpp +++ b/clang/test/SemaCXX/pragma-optimize.cpp @@ -55,13 +55,6 @@ int __attribute__((always_inline)) baz(int z) { } // 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{{.*}} } -- 2.7.4