forked from OSchip/llvm-project
[OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma omp single'.
llvm-svn: 213040
This commit is contained in:
parent
ee9447cc0e
commit
74a05c9445
|
@ -107,7 +107,7 @@ OPENMP_SIMD_CLAUSE(safelen)
|
||||||
OPENMP_SIMD_CLAUSE(collapse)
|
OPENMP_SIMD_CLAUSE(collapse)
|
||||||
OPENMP_SIMD_CLAUSE(reduction)
|
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(private)
|
||||||
OPENMP_FOR_CLAUSE(lastprivate)
|
OPENMP_FOR_CLAUSE(lastprivate)
|
||||||
OPENMP_FOR_CLAUSE(firstprivate)
|
OPENMP_FOR_CLAUSE(firstprivate)
|
||||||
|
@ -124,7 +124,7 @@ OPENMP_SECTIONS_CLAUSE(firstprivate)
|
||||||
OPENMP_SECTIONS_CLAUSE(reduction)
|
OPENMP_SECTIONS_CLAUSE(reduction)
|
||||||
OPENMP_SECTIONS_CLAUSE(nowait)
|
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(private)
|
||||||
OPENMP_SINGLE_CLAUSE(firstprivate)
|
OPENMP_SINGLE_CLAUSE(firstprivate)
|
||||||
OPENMP_SINGLE_CLAUSE(copyprivate)
|
OPENMP_SINGLE_CLAUSE(copyprivate)
|
||||||
|
|
|
@ -1899,7 +1899,10 @@ StmtResult Sema::ActOnOpenMPSingleDirective(ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AStmt,
|
Stmt *AStmt,
|
||||||
SourceLocation StartLoc,
|
SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc) {
|
SourceLocation EndLoc) {
|
||||||
|
assert(AStmt && isa<CapturedStmt>(AStmt) && "Captured statement expected");
|
||||||
|
|
||||||
getCurFunction()->setHasBranchProtectedScope();
|
getCurFunction()->setHasBranchProtectedScope();
|
||||||
|
|
||||||
return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
|
return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,14 +215,6 @@ void foo() {
|
||||||
}
|
}
|
||||||
#pragma omp sections
|
#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 parallel
|
||||||
{
|
{
|
||||||
#pragma omp single // OK
|
#pragma omp single // OK
|
||||||
|
|
Loading…
Reference in New Issue