summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/OpenMPKinds.cpp
diff options
context:
space:
mode:
authorArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-02 04:00:47 +0000
committerArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-02 04:00:47 +0000
commit3d58f26929fa1c45bfeeba5230a83cf366f9d010 (patch)
treec58db2955f588efd88321e6e3a758fade619acfe /clang/lib/Basic/OpenMPKinds.cpp
parenta4499e9f73f10b2f29dc2d104ab6b3dc0df16d8c (diff)
downloadbcm5719-llvm-3d58f26929fa1c45bfeeba5230a83cf366f9d010.tar.gz
bcm5719-llvm-3d58f26929fa1c45bfeeba5230a83cf366f9d010.zip
[OpenMP] Prevent nesting of target constructs within target code execution regions.
Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259464
Diffstat (limited to 'clang/lib/Basic/OpenMPKinds.cpp')
-rw-r--r--clang/lib/Basic/OpenMPKinds.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp
index e66a3e331e6..523e603ee90 100644
--- a/clang/lib/Basic/OpenMPKinds.cpp
+++ b/clang/lib/Basic/OpenMPKinds.cpp
@@ -576,8 +576,15 @@ bool clang::isOpenMPParallelDirective(OpenMPDirectiveKind DKind) {
// TODO add next directives.
}
-bool clang::isOpenMPTargetDirective(OpenMPDirectiveKind DKind) {
- return DKind == OMPD_target; // TODO add next directives.
+bool clang::isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind) {
+ // TODO add next directives.
+ return DKind == OMPD_target || DKind == OMPD_target_parallel;
+}
+
+bool clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) {
+ // TODO add target update directive check.
+ return DKind == OMPD_target_data || DKind == OMPD_target_enter_data ||
+ DKind == OMPD_target_exit_data;
}
bool clang::isOpenMPTeamsDirective(OpenMPDirectiveKind DKind) {
OpenPOWER on IntegriCloud