From 5733e3512b833c48c77e95f18c7148e2a7042832 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 18 Jul 2015 17:09:36 +0000 Subject: [AST] Remove StmtRange in favor of an iterator_range. StmtRange was just a convenient wrapper for two StmtIterators before we had real range support. This removes some of the implicit conversions StmtRange had leading to slightly more verbose code but also should make more obvious what's going on. No functional change intended. llvm-svn: 242615 --- clang/lib/Sema/SemaOpenMP.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index e11ab82f88c..90b8f712af7 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -3377,11 +3377,11 @@ StmtResult Sema::ActOnOpenMPSectionsDirective(ArrayRef Clauses, BaseStmt = CS->getCapturedStmt(); if (auto C = dyn_cast_or_null(BaseStmt)) { auto S = C->children(); - if (!S) + if (S.begin() == S.end()) return StmtError(); // All associated statements must be '#pragma omp section' except for // the first one. - for (Stmt *SectionStmt : ++S) { + for (Stmt *SectionStmt : llvm::make_range(std::next(S.begin()), S.end())) { if (!SectionStmt || !isa(SectionStmt)) { if (SectionStmt) Diag(SectionStmt->getLocStart(), @@ -3535,11 +3535,11 @@ Sema::ActOnOpenMPParallelSectionsDirective(ArrayRef Clauses, BaseStmt = CS->getCapturedStmt(); if (auto C = dyn_cast_or_null(BaseStmt)) { auto S = C->children(); - if (!S) + if (S.begin() == S.end()) return StmtError(); // All associated statements must be '#pragma omp section' except for // the first one. - for (Stmt *SectionStmt : ++S) { + for (Stmt *SectionStmt : llvm::make_range(std::next(S.begin()), S.end())) { if (!SectionStmt || !isa(SectionStmt)) { if (SectionStmt) Diag(SectionStmt->getLocStart(), -- cgit v1.2.3