Skip to content

Commit

Permalink
Revert "Teach AttachPreviousImpl to inherit MSInheritanceAttr attribute"
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronBallman committed Aug 21, 2020
1 parent 7ed3286 commit 58c305f
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 61 deletions.
22 changes: 0 additions & 22 deletions clang/lib/Serialization/ASTReaderDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ namespace clang {
static Decl *getMostRecentDeclImpl(...);
static Decl *getMostRecentDecl(Decl *D);

static void mergeInheritableAttributes(ASTReader &Reader, Decl *D,
Decl *Previous);

template <typename DeclT>
static void attachPreviousDeclImpl(ASTReader &Reader,
Redeclarable<DeclT> *D, Decl *Previous,
Expand Down Expand Up @@ -3514,19 +3511,6 @@ Decl *ASTReader::getMostRecentExistingDecl(Decl *D) {
return ASTDeclReader::getMostRecentDecl(D->getCanonicalDecl());
}

void ASTDeclReader::mergeInheritableAttributes(ASTReader &Reader, Decl *D,
Decl *Previous) {
InheritableAttr *NewAttr = nullptr;
ASTContext &Context = Reader.getContext();
const auto *IA = Previous->getAttr<MSInheritanceAttr>();

if (IA && !D->hasAttr<MSInheritanceAttr>()) {
NewAttr = cast<InheritableAttr>(IA->clone(Context));
NewAttr->setInherited(true);
D->addAttr(NewAttr);
}
}

template<typename DeclT>
void ASTDeclReader::attachPreviousDeclImpl(ASTReader &Reader,
Redeclarable<DeclT> *D,
Expand Down Expand Up @@ -3685,12 +3669,6 @@ void ASTDeclReader::attachPreviousDecl(ASTReader &Reader, Decl *D,
if (auto *TD = dyn_cast<TemplateDecl>(D))
inheritDefaultTemplateArguments(Reader.getContext(),
cast<TemplateDecl>(Previous), TD);

// If any of the declaration in the chain contains an Inheritable attribute,
// it needs to be added to all the declarations in the redeclarable chain.
// FIXME: Only the logic of merging MSInheritableAttr is present, it should
// be extended for all inheritable attributes.
mergeInheritableAttributes(Reader, D, Previous);
}

template<typename DeclT>
Expand Down
10 changes: 0 additions & 10 deletions clang/test/Modules/Inputs/inherit-attribute/a.h

This file was deleted.

5 changes: 0 additions & 5 deletions clang/test/Modules/Inputs/inherit-attribute/b.h

This file was deleted.

1 change: 0 additions & 1 deletion clang/test/Modules/Inputs/inherit-attribute/c.h

This file was deleted.

3 changes: 0 additions & 3 deletions clang/test/Modules/Inputs/inherit-attribute/module.modulemap

This file was deleted.

20 changes: 0 additions & 20 deletions clang/test/Modules/inherit-attribute.cpp

This file was deleted.

0 comments on commit 58c305f

Please sign in to comment.