[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
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index ccb3cd3..fe13344 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -90,6 +90,8 @@
return static_cast<const OMPNumTasksClause *>(C);
case OMPC_final:
return static_cast<const OMPFinalClause *>(C);
+ case OMPC_priority:
+ return static_cast<const OMPPriorityClause *>(C);
case OMPC_default:
case OMPC_proc_bind:
case OMPC_safelen:
@@ -117,7 +119,6 @@
case OMPC_threads:
case OMPC_simd:
case OMPC_map:
- case OMPC_priority:
case OMPC_nogroup:
case OMPC_hint:
case OMPC_defaultmap:
@@ -255,6 +256,12 @@
return child_range(&Condition, &Condition + 1);
}
+OMPClause::child_range OMPPriorityClause::used_children() {
+ if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt()))
+ return child_range(C, C + 1);
+ return child_range(&Priority, &Priority + 1);
+}
+
OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num,
unsigned NumLoops,
SourceLocation StartLoc,