diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-18 08:07:34 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-18 08:07:34 +0000 |
commit | 87933c7ced4fb99bb9cf6cea4d87cec2825aea7c (patch) | |
tree | 1f887097058b418c1cfd5c261b11a4d126d142ed /clang/lib/Sema/SemaOpenMP.cpp | |
parent | fbbc0b8cece96d7377a1b52d59daa15465f7db09 (diff) | |
download | bcm5719-llvm-87933c7ced4fb99bb9cf6cea4d87cec2825aea7c.tar.gz bcm5719-llvm-87933c7ced4fb99bb9cf6cea4d87cec2825aea7c.zip |
[OPENMP 4.0] Add 'if' clause for 'cancel' directive.
Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive.
llvm-svn: 247976
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index ed58e475fe7..3865f2773f9 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -2245,11 +2245,11 @@ StmtResult Sema::ActOnOpenMPExecutableDirective( Res = ActOnOpenMPCancellationPointDirective(StartLoc, EndLoc, CancelRegion); break; case OMPD_cancel: - assert(ClausesWithImplicit.empty() && - "No clauses are allowed for 'omp cancel' directive"); assert(AStmt == nullptr && "No associated statement allowed for 'omp cancel' directive"); - Res = ActOnOpenMPCancelDirective(StartLoc, EndLoc, CancelRegion); + Res = ActOnOpenMPCancelDirective(ClausesWithImplicit, StartLoc, EndLoc, + CancelRegion); + AllowedNameModifiers.push_back(OMPD_cancel); break; case OMPD_target_data: Res = ActOnOpenMPTargetDataDirective(ClausesWithImplicit, AStmt, StartLoc, @@ -4909,7 +4909,8 @@ Sema::ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, CancelRegion); } -StmtResult Sema::ActOnOpenMPCancelDirective(SourceLocation StartLoc, +StmtResult Sema::ActOnOpenMPCancelDirective(ArrayRef<OMPClause *> Clauses, + SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion) { if (CancelRegion != OMPD_parallel && CancelRegion != OMPD_for && @@ -4927,7 +4928,8 @@ StmtResult Sema::ActOnOpenMPCancelDirective(SourceLocation StartLoc, return StmtError(); } DSAStack->setParentCancelRegion(/*Cancel=*/true); - return OMPCancelDirective::Create(Context, StartLoc, EndLoc, CancelRegion); + return OMPCancelDirective::Create(Context, StartLoc, EndLoc, Clauses, + CancelRegion); } OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, |