From 3d58f26929fa1c45bfeeba5230a83cf366f9d010 Mon Sep 17 00:00:00 2001 From: Arpith Chacko Jacob Date: Tue, 2 Feb 2016 04:00:47 +0000 Subject: [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 --- clang/lib/Basic/OpenMPKinds.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'clang/lib/Basic/OpenMPKinds.cpp') 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) { -- cgit v1.2.3