]> granicus.if.org Git - clang/commitdiff
[OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp...
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 15 Jul 2014 02:55:09 +0000 (02:55 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 15 Jul 2014 02:55:09 +0000 (02:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213040 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/OpenMPKinds.def
lib/Sema/SemaOpenMP.cpp
test/OpenMP/nesting_of_regions.cpp

index f64b13765d765ff8b1dfcf32c8350155bac1a3fc..85295b4c7848877639cbf8a9881c375e7d1599c7 100644 (file)
@@ -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)
index f0650148873ad406615a2ee46685558a82f0e7fe..0dfec2669203d39edc0edabb90e3f8220bf0a78d 100644 (file)
@@ -1899,7 +1899,10 @@ StmtResult Sema::ActOnOpenMPSingleDirective(ArrayRef<OMPClause *> Clauses,
                                             Stmt *AStmt,
                                             SourceLocation StartLoc,
                                             SourceLocation EndLoc) {
+  assert(AStmt && isa<CapturedStmt>(AStmt) && "Captured statement expected");
+
   getCurFunction()->setHasBranchProtectedScope();
+
   return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
 }
 
index f56cc0ec8bbe2f97a4083fd6335818fea27a42cf..c2e252673f1dc05866e6d48853bdd4ead7f25d4a 100644 (file)
@@ -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