summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-09-10 20:19:58 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-09-10 20:19:58 +0000
commit7a54d76fa540f88ffe45f9e9eeca958dea369719 (patch)
tree0821fec9880b78d58cb7650e4813283639b5874b /clang/lib/Sema/SemaOpenMP.cpp
parent38e033bf33e8a8261d1d4497524fe75ef3486a9a (diff)
downloadbcm5719-llvm-7a54d76fa540f88ffe45f9e9eeca958dea369719.tar.gz
bcm5719-llvm-7a54d76fa540f88ffe45f9e9eeca958dea369719.zip
[OPENMP5.0]Allow teams directive outside of the target directives.
According to OpenMP 5.0, teams directives are allowed not only in the target context, but also in the implicit parallel regions. llvm-svn: 371553
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 9d3d3a50775..f7adf211de5 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -3876,7 +3876,10 @@ static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack,
// OpenMP [2.16, Nesting of Regions]
// If specified, a teams construct must be contained within a target
// construct.
- NestingProhibited = ParentRegion != OMPD_target;
+ NestingProhibited =
+ (SemaRef.LangOpts.OpenMP <= 45 && ParentRegion != OMPD_target) ||
+ (SemaRef.LangOpts.OpenMP >= 50 && ParentRegion != OMPD_unknown &&
+ ParentRegion != OMPD_target);
OrphanSeen = ParentRegion == OMPD_unknown;
Recommend = ShouldBeInTargetRegion;
}
OpenPOWER on IntegriCloud