summaryrefslogtreecommitdiff
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorMike Rice <michael.p.rice@intel.com>2021-10-25 15:03:42 -0700
committerMike Rice <michael.p.rice@intel.com>2021-10-28 07:44:27 -0700
commitb663278e084c9fff51275a670631784d3b9f730f (patch)
treeeafc08b2a17314b00a875eef6ee8ad145a26a0a7 /clang/lib/Basic
parentbf87294cd4fa5781aa2fc0954e117712befedf87 (diff)
downloadllvm-omp-loop.tar.gz
[OpenMP] Initial parsing/sema for the 'omp loop' constructomp-loop
Adds basic parsing/sema/serialization support for the #pragma omp loop directive. Differential Revision: https://reviews.llvm.org/D112499
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/OpenMPKinds.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp
index d9ddb7ea0fc3..5b01bf863bb0 100644
--- a/clang/lib/Basic/OpenMPKinds.cpp
+++ b/clang/lib/Basic/OpenMPKinds.cpp
@@ -474,7 +474,7 @@ bool clang::isOpenMPLoopDirective(OpenMPDirectiveKind DKind) {
DKind == OMPD_target_teams_distribute_parallel_for ||
DKind == OMPD_target_teams_distribute_parallel_for_simd ||
DKind == OMPD_target_teams_distribute_simd || DKind == OMPD_tile ||
- DKind == OMPD_unroll;
+ DKind == OMPD_unroll || DKind == OMPD_loop;
}
bool clang::isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind) {
@@ -577,6 +577,10 @@ bool clang::isOpenMPDistributeDirective(OpenMPDirectiveKind Kind) {
Kind == OMPD_target_teams_distribute_simd;
}
+bool clang::isOpenMPGenericLoopDirective(OpenMPDirectiveKind Kind) {
+ return Kind == OMPD_loop;
+}
+
bool clang::isOpenMPPrivate(OpenMPClauseKind Kind) {
return Kind == OMPC_private || Kind == OMPC_firstprivate ||
Kind == OMPC_lastprivate || Kind == OMPC_linear ||
@@ -675,6 +679,10 @@ void clang::getOpenMPCaptureRegions(
CaptureRegions.push_back(OMPD_teams);
CaptureRegions.push_back(OMPD_parallel);
break;
+ case OMPD_loop:
+ // TODO: 'loop' may require different capture regions depending on the bind
+ // clause or the parent directive when there is no bind clause. Use
+ // OMPD_unknown for now.
case OMPD_simd:
case OMPD_for:
case OMPD_for_simd: