aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/Expr.cpp6
-rw-r--r--lib/AST/ParentMap.cpp2
-rw-r--r--lib/AST/StmtDumper.cpp6
-rw-r--r--lib/AST/StmtProfile.cpp3
4 files changed, 7 insertions, 10 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
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp
index 87f8f36e6e..eca351aec8 100644
--- a/lib/AST/ParentMap.cpp
+++ b/lib/AST/ParentMap.cpp
@@ -21,7 +21,7 @@ using namespace clang;
typedef llvm::DenseMap<Stmt*, Stmt*> MapTy;
static void BuildParentMap(MapTy& M, Stmt* S) {
- for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I!=E; ++I)
+ for (Stmt::child_range I = S->children(); I; ++I)
if (*I) {
M[*I] = S;
BuildParentMap(M, *I);
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 5def7d9a0b..e5e759d9ef 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/lib/AST/StmtDumper.cpp
@@ -59,9 +59,9 @@ namespace {
Visit(S);
// Print out children.
- Stmt::child_iterator CI = S->child_begin(), CE = S->child_end();
- if (CI != CE) {
- while (CI != CE) {
+ Stmt::child_range CI = S->children();
+ if (CI) {
+ while (CI) {
OS << '\n';
DumpSubTree(*CI++);
}
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp
index 707cac4edf..b96ffe8a48 100644
--- a/lib/AST/StmtProfile.cpp
+++ b/lib/AST/StmtProfile.cpp
@@ -68,8 +68,7 @@ namespace {
void StmtProfiler::VisitStmt(Stmt *S) {
ID.AddInteger(S->getStmtClass());
- for (Stmt::child_iterator C = S->child_begin(), CEnd = S->child_end();
- C != CEnd; ++C)
+ for (Stmt::child_range C = S->children(); C; ++C)
Visit(*C);
}