@@ -4131,16 +4131,18 @@ class BindingDecl : public ValueDecl {
41314131 // / binding).
41324132 Expr *Binding = nullptr ;
41334133
4134- BindingDecl (DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id)
4135- : ValueDecl(Decl::Binding, DC, IdLoc, Id, QualType()) {}
4134+ BindingDecl (DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id,
4135+ QualType T)
4136+ : ValueDecl(Decl::Binding, DC, IdLoc, Id, T) {}
41364137
41374138 void anchor () override ;
41384139
41394140public:
41404141 friend class ASTDeclReader ;
41414142
41424143 static BindingDecl *Create (ASTContext &C, DeclContext *DC,
4143- SourceLocation IdLoc, IdentifierInfo *Id);
4144+ SourceLocation IdLoc, IdentifierInfo *Id,
4145+ QualType T);
41444146 static BindingDecl *CreateDeserialized (ASTContext &C, GlobalDeclID ID);
41454147
41464148 // / Get the expression to which this declaration is bound. This may be null
@@ -4152,10 +4154,6 @@ class BindingDecl : public ValueDecl {
41524154 // / decomposition of.
41534155 ValueDecl *getDecomposedDecl () const { return Decomp; }
41544156
4155- // / Get the variable (if any) that holds the value of evaluating the binding.
4156- // / Only present for user-defined bindings for tuple-like types.
4157- VarDecl *getHoldingVar () const ;
4158-
41594157 // / Set the binding for this BindingDecl, along with its declared type (which
41604158 // / should be a possibly-cv-qualified form of the type of the binding, or a
41614159 // / reference to such a type).
@@ -4167,6 +4165,9 @@ class BindingDecl : public ValueDecl {
41674165 // / Set the decomposed variable for this BindingDecl.
41684166 void setDecomposedDecl (ValueDecl *Decomposed) { Decomp = Decomposed; }
41694167
4168+ VarDecl *getHoldingVar () const ;
4169+ static VarDecl *getHoldingVar (Expr *E);
4170+
41704171 static bool classof (const Decl *D) { return classofKind (D->getKind ()); }
41714172 static bool classofKind (Kind K) { return K == Decl::Binding; }
41724173};
@@ -4219,6 +4220,13 @@ class DecompositionDecl final
42194220
42204221 void printName (raw_ostream &OS, const PrintingPolicy &Policy) const override ;
42214222
4223+ // / Visit the variables (if any) that hold the values of evaluating the
4224+ // / binding. Only present for user-defined bindings for tuple-like types.
4225+ void VisitHoldingVars (llvm::function_ref<void (VarDecl *)> F) const ;
4226+
4227+ // Visit the concrete bindings. (workaround)
4228+ void VisitBindings (llvm::function_ref<void (BindingDecl *)> F) const ;
4229+
42224230 static bool classof (const Decl *D) { return classofKind (D->getKind ()); }
42234231 static bool classofKind (Kind K) { return K == Decomposition; }
42244232};
0 commit comments