From 346265e3bcee55bff42849683ec01506e67fc5c8 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 25 Sep 2015 10:37:12 +0000 Subject: [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'. OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. llvm-svn: 248569 --- clang/lib/Basic/OpenMPKinds.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'clang/lib/Basic/OpenMPKinds.cpp') diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp index 30ea09a9f59..ea99387cb94 100644 --- a/clang/lib/Basic/OpenMPKinds.cpp +++ b/clang/lib/Basic/OpenMPKinds.cpp @@ -128,6 +128,7 @@ unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind, case OMPC_capture: case OMPC_seq_cst: case OMPC_device: + case OMPC_threads: break; } llvm_unreachable("Invalid OpenMP simple clause kind"); @@ -212,6 +213,7 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, case OMPC_capture: case OMPC_seq_cst: case OMPC_device: + case OMPC_threads: break; } llvm_unreachable("Invalid OpenMP simple clause kind"); @@ -370,6 +372,16 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind, #define OPENMP_CANCEL_CLAUSE(Name) \ case OMPC_##Name: \ return true; +#include "clang/Basic/OpenMPKinds.def" + default: + break; + } + break; + case OMPD_ordered: + switch (CKind) { +#define OPENMP_ORDERED_CLAUSE(Name) \ + case OMPC_##Name: \ + return true; #include "clang/Basic/OpenMPKinds.def" default: break; @@ -385,7 +397,6 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind, case OMPD_taskwait: case OMPD_taskgroup: case OMPD_cancellation_point: - case OMPD_ordered: break; } return false; -- cgit v1.2.3