summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-01 16:32:47 +0000
committerArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-01 16:32:47 +0000
commitf1958627d9cc6fde9fba025af2ed4c1566d1da04 (patch)
treeac60309f7f96099c7df60a89283219a53bd8c7d8 /clang/lib/Basic
parent04bf91a8c1c6faaedf3f20dff6b795cc13e1071e (diff)
downloadbcm5719-llvm-f1958627d9cc6fde9fba025af2ed4c1566d1da04.tar.gz
bcm5719-llvm-f1958627d9cc6fde9fba025af2ed4c1566d1da04.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: 259366
Diffstat (limited to 'clang/lib/Basic')
-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