Revert "Teach AttachPreviousImpl to inherit MSInheritanceAttr attribute"

This reverts commit 7a527f1777.

It caused some buildbot failures:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/13600
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/20294
This commit is contained in:
Aaron Ballman 2020-08-21 12:42:10 -04:00
parent 7ed3286a51
commit 58c305f466
6 changed files with 0 additions and 61 deletions

View File

@ -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,
@ -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,
@ -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>

View File

@ -1,10 +0,0 @@
#ifndef FOO
#define FOO
class Foo {
public:
void step(int v);
Foo();
};
#endif

View File

@ -1,5 +0,0 @@
#include "a.h"
void bar() {
&Foo::step;
}

View File

@ -1 +0,0 @@
#include "a.h"

View File

@ -1,3 +0,0 @@
module "b" { header "b.h" }
module "c" { header "c.h" }

View File

@ -1,20 +0,0 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -triple x86_64-pc-windows-msvc-unknown -I%S\Inputs\inherit-attribute -fmodules-cache-path=%t \
// RUN: -fimplicit-module-maps -fmodules-local-submodule-visibility %s -ast-dump-all \
// RUN: | FileCheck %s
#include "b.h"
#include "c.h"
class Foo;
Foo f;
// CHECK: CXXRecordDecl {{.*}} imported in b {{.*}} Foo
// CHECK: MSInheritanceAttr {{[^()]*$}}
// CHECK: CXXRecordDecl {{.*}} prev {{.*}} imported in c {{.*}} Foo
// CHECK: MSInheritanceAttr {{.*}} Inherited {{[^()]*$}}
// CHECK: CXXRecordDecl {{.*}} <line:9:1, col:7> col:7 referenced class Foo
// CHECK: MSInheritanceAttr {{.*}} Inherited {{[^()]*$}}