summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/OpenMPClause.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-10-14 20:44:34 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-10-14 20:44:34 +0000
commitd88c7dec2187a68109f3c020cc86685e7b2183d5 (patch)
tree079d5455b72c031ef8c2cdbda12b8df4f887e785 /clang/lib/AST/OpenMPClause.cpp
parentbfaa1082e126d922efbf5364f469f23ea1598da8 (diff)
downloadbcm5719-llvm-d88c7dec2187a68109f3c020cc86685e7b2183d5.tar.gz
bcm5719-llvm-d88c7dec2187a68109f3c020cc86685e7b2183d5.zip
[OPNEMP]Allow num_tasks clause in combined task-based directives.
The expression of the num_tasks clause must be captured in the combined task-based directives, like 'parallel master taskloop' directive. llvm-svn: 374819
Diffstat (limited to 'clang/lib/AST/OpenMPClause.cpp')
-rw-r--r--clang/lib/AST/OpenMPClause.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index b97607f8c60..c1aeaf6a6be 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -86,6 +86,8 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) {
return static_cast<const OMPDeviceClause *>(C);
case OMPC_grainsize:
return static_cast<const OMPGrainsizeClause *>(C);
+ case OMPC_num_tasks:
+ return static_cast<const OMPNumTasksClause *>(C);
case OMPC_default:
case OMPC_proc_bind:
case OMPC_final:
@@ -116,7 +118,6 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) {
case OMPC_map:
case OMPC_priority:
case OMPC_nogroup:
- case OMPC_num_tasks:
case OMPC_hint:
case OMPC_defaultmap:
case OMPC_unknown:
@@ -241,6 +242,12 @@ OMPClause::child_range OMPGrainsizeClause::used_children() {
return child_range(&Grainsize, &Grainsize + 1);
}
+OMPClause::child_range OMPNumTasksClause::used_children() {
+ if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt()))
+ return child_range(C, C + 1);
+ return child_range(&NumTasks, &NumTasks + 1);
+}
+
OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num,
unsigned NumLoops,
SourceLocation StartLoc,
OpenPOWER on IntegriCloud