diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2015-01-19 05:20:46 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-01-19 05:20:46 +0000 |
| commit | 3255bf3aacbb71d1a52f3d0951af87717e0ee30a (patch) | |
| tree | 8bcd7b0cd19c85ef6659877b19c2cf663df98e5c /clang/lib/Sema | |
| parent | b93d3dbc1fc963834d51168d34a76815d2906391 (diff) | |
| download | bcm5719-llvm-3255bf3aacbb71d1a52f3d0951af87717e0ee30a.tar.gz bcm5719-llvm-3255bf3aacbb71d1a52f3d0951af87717e0ee30a.zip | |
[OPENMP] Disable copyprivate an nowait clauses in 'single' directive.
The copyprivate clause must not be used with the nowait clause in single
directive.
llvm-svn: 226429
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 0d349068860..cd03f996102 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -3048,6 +3048,23 @@ StmtResult Sema::ActOnOpenMPSingleDirective(ArrayRef<OMPClause *> Clauses, getCurFunction()->setHasBranchProtectedScope(); + // OpenMP [2.7.3, single Construct, Restrictions] + // The copyprivate clause must not be used with the nowait clause. + OMPClause *Nowait = nullptr; + OMPClause *Copyprivate = nullptr; + for (auto *Clause : Clauses) { + if (Clause->getClauseKind() == OMPC_nowait) + Nowait = Clause; + else if (Clause->getClauseKind() == OMPC_copyprivate) + Copyprivate = Clause; + if (Copyprivate && Nowait) { + Diag(Copyprivate->getLocStart(), + diag::err_omp_single_copyprivate_with_nowait); + Diag(Nowait->getLocStart(), diag::note_omp_nowait_clause_here); + return StmtError(); + } + } + return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt); } |

