diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Decl.h | 7 | ||||
-rw-r--r-- | include/clang/AST/Stmt.h | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 6c8c5051fe..ea6479ad28 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -3185,10 +3185,14 @@ private: public: static CapturedDecl *Create(ASTContext &C, DeclContext *DC, unsigned NumParams); + static CapturedDecl *CreateDeserialized(ASTContext &C, unsigned ID, + unsigned NumParams); Stmt *getBody() const { return Body; } void setBody(Stmt *B) { Body = B; } + unsigned getNumParams() const { return NumParams; } + ImplicitParamDecl *getParam(unsigned i) const { assert(i < NumParams); return getParams()[i]; @@ -3217,6 +3221,9 @@ public: static CapturedDecl *castFromDeclContext(const DeclContext *DC) { return static_cast<CapturedDecl *>(const_cast<DeclContext *>(DC)); } + + friend class ASTDeclReader; + friend class ASTDeclWriter; }; /// \brief Describes a module import declaration, which makes the contents diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 6e5fae4f3c..da83220988 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -1975,6 +1975,7 @@ public: assert(!capturesThis() && "No variable available for 'this' capture"); return VarAndKind.getPointer(); } + friend class ASTStmtReader; }; private: @@ -2001,6 +2002,8 @@ private: Capture *getStoredCaptures() const; + void setCapturedStmt(Stmt *S) { getStoredStmts()[NumCaptures] = S; } + public: static CapturedStmt *Create(ASTContext &Context, Stmt *S, ArrayRef<Capture> Captures, @@ -2026,10 +2029,12 @@ public: bool capturesVariable(const VarDecl *Var) const; /// \brief An iterator that walks over the captures. - typedef const Capture *capture_iterator; + typedef Capture *capture_iterator; + typedef const Capture *const_capture_iterator; /// \brief Retrieve an iterator pointing to the first capture. - capture_iterator capture_begin() const { return getStoredCaptures(); } + capture_iterator capture_begin() { return getStoredCaptures(); } + const_capture_iterator capture_begin() const { return getStoredCaptures(); } /// \brief Retrieve an iterator pointing past the end of the sequence of /// captures. @@ -2069,6 +2074,8 @@ public: } child_range children(); + + friend class ASTStmtReader; }; } // end namespace clang |