[cfe-commits] r58438 - /cfe/trunk/include/clang/AST/Expr.h
Ted Kremenek
kremenek at apple.com
Thu Oct 30 10:45:53 PDT 2008
Author: kremenek
Date: Thu Oct 30 12:45:53 2008
New Revision: 58438
URL: http://llvm.org/viewvc/llvm-project?rev=58438&view=rev
Log:
Add iterator/reverse_iterator to InitListExpr for iteration over the subexpressions of an initializer list. This is basically the same as child_iterator except reverse iteration is possible (which will be used by GRExprEngine::VisitInitListExpr).
Modified:
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=58438&r1=58437&r2=58438&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Oct 30 12:45:53 2008
@@ -1476,6 +1476,15 @@
virtual child_iterator child_begin();
virtual child_iterator child_end();
+ typedef std::vector<Stmt *>::iterator iterator;
+ typedef std::vector<Stmt *>::reverse_iterator reverse_iterator;
+
+ iterator begin() { return InitExprs.begin(); }
+ iterator end() { return InitExprs.end(); }
+ reverse_iterator rbegin() { return InitExprs.rbegin(); }
+ reverse_iterator rend() { return InitExprs.rend(); }
+
+ // Serailization.
virtual void EmitImpl(llvm::Serializer& S) const;
static InitListExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
More information about the cfe-commits
mailing list