From: Ted Kremenek Date: Tue, 21 Aug 2007 20:29:50 +0000 (+0000) Subject: Added reverse iterators for the body of CompountStmt. These are useful for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ce854736dd196e2304f554ebeac8b43c89cf9e2;p=clang Added reverse iterators for the body of CompountStmt. These are useful for CFG construction (among other potential uses). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41248 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index c2d46ab781..7eefd7fc56 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -122,7 +122,16 @@ public: const_body_iterator body_begin() const { return Body.begin(); } const_body_iterator body_end() const { return Body.end(); } const Stmt *body_back() const { return Body.back(); } - + + typedef llvm::SmallVector::reverse_iterator reverse_body_iterator; + reverse_body_iterator body_rbegin() { return Body.rbegin(); } + reverse_body_iterator body_rend() { return Body.rend(); } + + typedef llvm::SmallVector::const_reverse_iterator + const_reverse_body_iterator; + const_reverse_body_iterator body_rbegin() const { return Body.rbegin(); } + const_reverse_body_iterator body_rend() const { return Body.rend(); } + void push_back(Stmt *S) { Body.push_back(S); } static bool classof(const Stmt *T) {