[OPENMP50]Add if clause in simd directive.
According to OpenMP 5.0, if clause can be used in simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.
diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp
index 4e6c677..b1e623b 100644
--- a/clang/lib/Basic/OpenMPKinds.cpp
+++ b/clang/lib/Basic/OpenMPKinds.cpp
@@ -447,7 +447,8 @@
}
bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
- OpenMPClauseKind CKind) {
+ OpenMPClauseKind CKind,
+ unsigned OpenMPVersion) {
assert(DKind <= OMPD_unknown);
assert(CKind <= OMPC_unknown);
switch (DKind) {
@@ -462,6 +463,8 @@
}
break;
case OMPD_simd:
+ if (OpenMPVersion < 50 && CKind == OMPC_if)
+ return false;
switch (CKind) {
#define OPENMP_SIMD_CLAUSE(Name) \
case OMPC_##Name: \