diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-18 20:18:17 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-18 20:18:17 +0000 |
commit | 746b78de7812bc785fbb5207b788348040b23fa7 (patch) | |
tree | c187f7d587cd10c98623cf5df56ec91c3289fdce /lib/Sema/SemaDeclAttr.cpp | |
parent | 6cfc2d490caedf2aa783f086cf71f4bab807974a (diff) | |
download | clang-746b78de7812bc785fbb5207b788348040b23fa7.tar.gz |
Revert r332470 (and corresponding tests in r332492).
This regressed our support for __attribute__((section)). See added test file
for example of code broken by this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 7e64b2369b..e4532a7e67 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2853,13 +2853,6 @@ static void handleVecTypeHint(Sema &S, Decl *D, const AttributeList &AL) { SectionAttr *Sema::mergeSectionAttr(Decl *D, SourceRange Range, StringRef Name, unsigned AttrSpellingListIndex) { - // Explicit or partial specializations do not inherit - // the code_seg attribute from the primary template. - if (const auto *FD = dyn_cast<FunctionDecl>(D)){ - if (FD->isFunctionTemplateSpecialization()) - return nullptr; - } - if (SectionAttr *ExistingAttr = D->getAttr<SectionAttr>()) { if (ExistingAttr->getName() == Name) return nullptr; @@ -2949,27 +2942,6 @@ static void handleTargetAttr(Sema &S, Decl *D, const AttributeList &AL) { D->addAttr(NewAttr); } -static void handleCodeSegAttr(Sema &S, Decl *D, const AttributeList &AL) { - StringRef Str; - SourceLocation LiteralLoc; - if (!S.checkStringLiteralArgumentAttr(AL, 0, Str, &LiteralLoc)) - return; - if (!S.checkSectionName(LiteralLoc, Str)) - return; - if (const auto *ExistingAttr = D->getAttr<SectionAttr>()) { - if (!ExistingAttr->isImplicit()) { - S.Diag(AL.getLoc(), - ExistingAttr->getName() == Str - ? diag::warn_duplicate_codeseg_attribute - : diag::err_conflicting_codeseg_attribute); - return; - } - D->dropAttr<SectionAttr>(); - } - D->addAttr(::new (S.Context) SectionAttr( - AL.getRange(), S.Context, Str, AL.getAttributeSpellingListIndex())); -} - static void handleCleanupAttr(Sema &S, Decl *D, const AttributeList &AL) { Expr *E = AL.getArgAsExpr(0); SourceLocation Loc = E->getExprLoc(); @@ -6325,9 +6297,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_Uuid: handleUuidAttr(S, D, AL); break; - case AttributeList::AT_CodeSeg: - handleCodeSegAttr(S, D, AL); - break; case AttributeList::AT_MSInheritance: handleMSInheritanceAttr(S, D, AL); break; |