From: Alexey Bataev Date: Tue, 15 Jul 2014 02:55:09 +0000 (+0000) Subject: [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d3367813baf055450524f15c6b95a2a50878af4;p=clang [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213040 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index f64b13765d..85295b4c78 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -107,7 +107,7 @@ OPENMP_SIMD_CLAUSE(safelen) OPENMP_SIMD_CLAUSE(collapse) OPENMP_SIMD_CLAUSE(reduction) -// TODO more clauses allowed for directive 'omp for'. +// Clauses allowed for directive 'omp for'. OPENMP_FOR_CLAUSE(private) OPENMP_FOR_CLAUSE(lastprivate) OPENMP_FOR_CLAUSE(firstprivate) @@ -124,7 +124,7 @@ OPENMP_SECTIONS_CLAUSE(firstprivate) OPENMP_SECTIONS_CLAUSE(reduction) OPENMP_SECTIONS_CLAUSE(nowait) -// TODO more clauses allowed for directive 'omp single'. +// Clauses allowed for directive 'omp single'. OPENMP_SINGLE_CLAUSE(private) OPENMP_SINGLE_CLAUSE(firstprivate) OPENMP_SINGLE_CLAUSE(copyprivate) diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index f065014887..0dfec26692 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -1899,7 +1899,10 @@ StmtResult Sema::ActOnOpenMPSingleDirective(ArrayRef Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc) { + assert(AStmt && isa(AStmt) && "Captured statement expected"); + getCurFunction()->setHasBranchProtectedScope(); + return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt); } diff --git a/test/OpenMP/nesting_of_regions.cpp b/test/OpenMP/nesting_of_regions.cpp index f56cc0ec8b..c2e252673f 100644 --- a/test/OpenMP/nesting_of_regions.cpp +++ b/test/OpenMP/nesting_of_regions.cpp @@ -215,14 +215,6 @@ void foo() { } #pragma omp sections { -#pragma omp section - { -#pragma omp single // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}} - bar(); - } - } -#pragma omp sections - { #pragma omp parallel { #pragma omp single // OK