summaryrefslogtreecommitdiff
path: root/lib/AST/OpenMPClause.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/OpenMPClause.cpp')
-rw-r--r--lib/AST/OpenMPClause.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/AST/OpenMPClause.cpp b/lib/AST/OpenMPClause.cpp
index ccb3cd3436..fe1334469d 100644
--- a/lib/AST/OpenMPClause.cpp
+++ b/lib/AST/OpenMPClause.cpp
@@ -90,6 +90,8 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) {
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 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) {
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 @@ OMPClause::child_range OMPFinalClause::used_children() {
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,