diff options
author | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:20:19 +0000 |
---|---|---|
committer | Ben Langmuir <ben.langmuir@intel.com> | 2013-05-03 19:20:19 +0000 |
commit | dc5be4f54d6415cb88b2f8a7c5bc9011e332b9b8 (patch) | |
tree | c0601b4fba10524868f196d5ee845dec53db48f6 /include/clang/AST/Stmt.h | |
parent | 0f2fc5ff49cb9abd6c6972ffd6db066295672867 (diff) | |
download | clang-dc5be4f54d6415cb88b2f8a7c5bc9011e332b9b8.tar.gz |
Serialization for captured statements
Add serialization for captured statements and captured decls. Also add
a const_capture_iterator to CapturedStmt.
Test contributed by Wei Pan
Differential Revision: http://llvm-reviews.chandlerc.com/D727
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Stmt.h')
-rw-r--r-- | include/clang/AST/Stmt.h | 11 |
1 files changed, 9 insertions, 2 deletions
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 |