summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-10-16 18:09:37 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-10-16 18:09:37 +0000
commit31ba47646ba40b7892492bb227d85de0d6733e07 (patch)
tree3ac0882ad64f4e4b95c95a8bea50ad098c9da4bc /clang/lib/Sema/SemaOpenMP.cpp
parent8cc6d42e8d6c0c133e4d5d46e918e5e2ae0781c6 (diff)
downloadbcm5719-llvm-31ba47646ba40b7892492bb227d85de0d6733e07.tar.gz
bcm5719-llvm-31ba47646ba40b7892492bb227d85de0d6733e07.zip
[OPENMP]Allow priority clause in combined task-based directives.
The expression of the priority clause must be captured in the combined task-based directives, like 'parallel master taskloop' directive. llvm-svn: 375026
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index b3f711bc7fa..3000469b0c9 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -4591,16 +4591,9 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
case OMPC_schedule:
break;
case OMPC_grainsize:
- // Do not analyze if no parent parallel directive.
- if (isOpenMPParallelDirective(DSAStack->getCurrentDirective()))
- break;
- continue;
case OMPC_num_tasks:
- // Do not analyze if no parent parallel directive.
- if (isOpenMPParallelDirective(DSAStack->getCurrentDirective()))
- break;
- continue;
case OMPC_final:
+ case OMPC_priority:
// Do not analyze if no parent parallel directive.
if (isOpenMPParallelDirective(DSAStack->getCurrentDirective()))
break;
@@ -4609,7 +4602,6 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
case OMPC_device:
case OMPC_num_teams:
case OMPC_thread_limit:
- case OMPC_priority:
case OMPC_hint:
case OMPC_collapse:
case OMPC_safelen:
@@ -10788,6 +10780,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
case OMPC_grainsize:
case OMPC_num_tasks:
case OMPC_final:
+ case OMPC_priority:
switch (DKind) {
case OMPD_task:
case OMPD_taskloop:
@@ -10888,7 +10881,6 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
case OMPC_threads:
case OMPC_simd:
case OMPC_map:
- case OMPC_priority:
case OMPC_nogroup:
case OMPC_hint:
case OMPC_defaultmap:
@@ -15937,14 +15929,19 @@ OMPClause *Sema::ActOnOpenMPPriorityClause(Expr *Priority,
SourceLocation LParenLoc,
SourceLocation EndLoc) {
Expr *ValExpr = Priority;
+ Stmt *HelperValStmt = nullptr;
+ OpenMPDirectiveKind CaptureRegion = OMPD_unknown;
// OpenMP [2.9.1, task Constrcut]
// The priority-value is a non-negative numerical scalar expression.
- if (!isNonNegativeIntegerValue(ValExpr, *this, OMPC_priority,
- /*StrictlyPositive=*/false))
+ if (!isNonNegativeIntegerValue(
+ ValExpr, *this, OMPC_priority,
+ /*StrictlyPositive=*/false, /*BuildCapture=*/true,
+ DSAStack->getCurrentDirective(), &CaptureRegion, &HelperValStmt))
return nullptr;
- return new (Context) OMPPriorityClause(ValExpr, StartLoc, LParenLoc, EndLoc);
+ return new (Context) OMPPriorityClause(ValExpr, HelperValStmt, CaptureRegion,
+ StartLoc, LParenLoc, EndLoc);
}
OMPClause *Sema::ActOnOpenMPGrainsizeClause(Expr *Grainsize,
OpenPOWER on IntegriCloud