From: Quentin Colombet Date: Mon, 29 Oct 2012 18:28:57 +0000 (+0000) Subject: Revert commit r166946 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e68ef0e4c3892b80d9fec77b5d477cd54e90db9;p=clang Revert commit r166946 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166957 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 4a5f1e727f..738b460b5a 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -341,11 +341,6 @@ def Final : InheritableAttr { let SemaHandler = 0; } -def ForceSizeOpt : InheritableAttr { - let Spellings = [GNU<"forcesizeopt">]; - let Subjects = [Function]; -} - def Format : InheritableAttr { let Spellings = [GNU<"format">]; let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">, diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 523e2d2624..9617de8eb7 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -583,9 +583,6 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, if (D->hasAttr()) F->addFnAttr(llvm::Attributes::OptimizeForSize); - if (D->hasAttr()) - F->addFnAttr(llvm::Attributes::ForceSizeOpt); - if (isa(D) || isa(D)) F->setUnnamedAddr(true); diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 992cafce74..df4757e4d2 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1523,20 +1523,6 @@ static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) { Str->getString())); } -static void handleForceSizeOptAttr(Sema &S, Decl *D, const AttributeList &Attr) { - // Check the attribute arguments. - if (!checkAttributeNumArgs(S, Attr, 0)) - return; - - if (!isa(D)) { - S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) - << Attr.getName() << ExpectedFunction; - return; - } - - D->addAttr(::new (S.Context) ForceSizeOptAttr(Attr.getRange(), S.Context)); -} - static void handleColdAttr(Sema &S, Decl *D, const AttributeList &Attr) { // Check the attribute arguments. if (!checkAttributeNumArgs(S, Attr, 0)) @@ -4299,9 +4285,6 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ExtVectorType: handleExtVectorTypeAttr(S, scope, D, Attr); break; - case AttributeList::AT_ForceSizeOpt: - handleForceSizeOptAttr(S, D, Attr); - break; case AttributeList::AT_Format: handleFormatAttr (S, D, Attr); break; case AttributeList::AT_FormatArg: handleFormatArgAttr (S, D, Attr); break; case AttributeList::AT_CUDAGlobal: handleGlobalAttr (S, D, Attr); break; diff --git a/test/CodeGen/attr-forcesizeopt.c b/test/CodeGen/attr-forcesizeopt.c index 693e7ccbad..c4e6c4ad81 100644 --- a/test/CodeGen/attr-forcesizeopt.c +++ b/test/CodeGen/attr-forcesizeopt.c @@ -24,8 +24,3 @@ int test2() { // OTHER-NOT: forcesizeopt // OTHER: ret } - -int test3() __attribute__((forcesizeopt)) { -// Oz: @test3{{.*}}forcesizeopt -// OTHER: @test3{{.*}}forcesizeopt -}