r213040 - [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'.
Alexey Bataev
a.bataev at hotmail.com
Mon Jul 14 19:55:09 PDT 2014
Author: abataev
Date: Mon Jul 14 21:55:09 2014
New Revision: 213040
URL: http://llvm.org/viewvc/llvm-project?rev=213040&view=rev
Log:
[OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'.
Modified:
cfe/trunk/include/clang/Basic/OpenMPKinds.def
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/test/OpenMP/nesting_of_regions.cpp
Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=213040&r1=213039&r2=213040&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Mon Jul 14 21:55:09 2014
@@ -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)
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=213040&r1=213039&r2=213040&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Mon Jul 14 21:55:09 2014
@@ -1899,7 +1899,10 @@ StmtResult Sema::ActOnOpenMPSingleDirect
Stmt *AStmt,
SourceLocation StartLoc,
SourceLocation EndLoc) {
+ assert(AStmt && isa<CapturedStmt>(AStmt) && "Captured statement expected");
+
getCurFunction()->setHasBranchProtectedScope();
+
return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
}
Modified: cfe/trunk/test/OpenMP/nesting_of_regions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=213040&r1=213039&r2=213040&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/nesting_of_regions.cpp (original)
+++ cfe/trunk/test/OpenMP/nesting_of_regions.cpp Mon Jul 14 21:55:09 2014
@@ -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
More information about the cfe-commits
mailing list