summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-08-12 00:53:41 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-08-12 00:53:41 +0000
commit1068a78bd300160b20d35a53afd88faedf65ee8e (patch)
tree857be7164a671d4c4bf245bbcc3462016e62bff6 /lib
parentc52f27b275d2a18dcd48a424c953bd4336badb3c (diff)
Remove unused and undesirable reference from BindingDecl to DecompositionDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/DeclCXX.cpp5
-rw-r--r--lib/Sema/SemaDecl.cpp9
-rw-r--r--lib/Sema/SemaDeclCXX.cpp2
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp8
4 files changed, 7 insertions, 17 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 772ce10661..14df382697 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -2309,13 +2309,12 @@ StaticAssertDecl *StaticAssertDecl::CreateDeserialized(ASTContext &C,
void BindingDecl::anchor() {}
BindingDecl *BindingDecl::Create(ASTContext &C, DeclContext *DC,
- DecompositionDecl *Decomp,
SourceLocation IdLoc, IdentifierInfo *Id) {
- return new (C, DC) BindingDecl(DC, Decomp, IdLoc, Id);
+ return new (C, DC) BindingDecl(DC, IdLoc, Id);
}
BindingDecl *BindingDecl::CreateDeserialized(ASTContext &C, unsigned ID) {
- return new (C, ID) BindingDecl(nullptr, nullptr, SourceLocation(), nullptr);
+ return new (C, ID) BindingDecl(nullptr, SourceLocation(), nullptr);
}
void DecompositionDecl::anchor() {}
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6445dac7db..4a68d60a1e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -6107,12 +6107,9 @@ NamedDecl *Sema::ActOnVariableDeclarator(
NewVD = cast<VarDecl>(Res.get());
AddToScope = false;
} else if (D.isDecompositionDeclarator()) {
- auto *NewDD = DecompositionDecl::Create(Context, DC, D.getLocStart(),
- D.getIdentifierLoc(), R, TInfo,
- SC, Bindings);
- for (auto *B : Bindings)
- B->setDecompositionDecl(NewDD);
- NewVD = NewDD;
+ NewVD = DecompositionDecl::Create(Context, DC, D.getLocStart(),
+ D.getIdentifierLoc(), R, TInfo, SC,
+ Bindings);
} else
NewVD = VarDecl::Create(Context, DC, D.getLocStart(),
D.getIdentifierLoc(), II, R, TInfo, SC);
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index cecbee13ee..a1ef6b408f 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -791,7 +791,7 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D,
Diag(Old->getLocation(), diag::note_previous_definition);
}
- auto *BD = BindingDecl::Create(Context, DC, nullptr, B.NameLoc, B.Name);
+ auto *BD = BindingDecl::Create(Context, DC, B.NameLoc, B.Name);
PushOnScopeChains(BD, S, true);
Bindings.push_back(BD);
ParsingInitForAutoVars.insert(BD);
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 5c8aa7287e..208afa6de6 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -599,13 +599,7 @@ TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
}
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
- auto *NewDD =
- dyn_cast_or_null<DecompositionDecl>(SemaRef.FindInstantiatedDecl(
- D->getLocation(), D->getDecompositionDecl(), TemplateArgs));
- if (!NewDD)
- return nullptr;
-
- return BindingDecl::Create(SemaRef.Context, Owner, NewDD, D->getLocation(),
+ return BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
D->getIdentifier());
}