diff options
author | John McCall <rjmccall@apple.com> | 2011-02-13 04:07:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-13 04:07:26 +0000 |
commit | 7502c1d3ce8bb97bcc4f7bebef507040bd93b26f (patch) | |
tree | a8483d8d96d4c459027291b90fad493b985313cb /lib/AST/Expr.cpp | |
parent | 0d70d71ccbc4f7f59cadb759f61b7172a149676c (diff) |
Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 6280d633aa..884a184b52 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1594,9 +1594,7 @@ static Expr::CanThrowResult MergeCanThrow(Expr::CanThrowResult CT1, static Expr::CanThrowResult CanSubExprsThrow(ASTContext &C, const Expr *CE) { Expr *E = const_cast<Expr*>(CE); Expr::CanThrowResult R = Expr::CT_Cannot; - Expr::child_iterator I, IE; - for (llvm::tie(I, IE) = E->children(); - I != IE && R != Expr::CT_Can; ++I) { + for (Expr::child_range I = E->children(); I && R != Expr::CT_Can; ++I) { R = MergeCanThrow(R, cast<Expr>(*I)->CanThrow(C)); } return R; @@ -2593,7 +2591,7 @@ DesignatedInitExpr::DesignatedInitExpr(ASTContext &C, QualType Ty, this->Designators = new (C) Designator[NumDesignators]; // Record the initializer itself. - child_iterator Child = child_begin(); + child_range Child = children(); *Child++ = Init; // Copy the designators and their subexpressions, computing |