diff options
author | Kelvin Li <kkwli0@gmail.com> | 2016-07-01 14:30:25 +0000 |
---|---|---|
committer | Kelvin Li <kkwli0@gmail.com> | 2016-07-01 14:30:25 +0000 |
commit | fd8b5748f113adb7357b181e595b96c14baaf224 (patch) | |
tree | 6d139558ef5153e919becf5b1eb3dbb849067021 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | c5a47bb9c1ff4fcd46c04373b6b81a4b5e36dfa2 (diff) | |
download | bcm5719-llvm-fd8b5748f113adb7357b181e595b96c14baaf224.tar.gz bcm5719-llvm-fd8b5748f113adb7357b181e595b96c14baaf224.zip |
[OpenMP] Issue warning if a simd construct nested inside another simd
construct
llvm-svn: 274352
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 21ccfd04789..ec67bcaf881 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -2940,15 +2940,19 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, ShouldBeInTargetRegion, ShouldBeInTeamsRegion } Recommend = NoRecommend; - if (isOpenMPSimdDirective(ParentRegion) && CurrentRegion != OMPD_ordered && - CurrentRegion != OMPD_simd) { + if (isOpenMPSimdDirective(ParentRegion) && CurrentRegion != OMPD_ordered) { // OpenMP [2.16, Nesting of Regions] // OpenMP constructs may not be nested inside a simd region. // OpenMP [2.8.1,simd Construct, Restrictions] - // An ordered construct with the simd clause is the only OpenMP construct - // that can appear in the simd region. - SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_simd); - return true; + // An ordered construct with the simd clause is the only OpenMP + // construct that can appear in the simd region. + // Allowing a SIMD consruct nested in another SIMD construct is an + // extension. The OpenMP 4.5 spec does not allow it. Issue a warning + // message. + SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd) + ? diag::err_omp_prohibited_region_simd + : diag::warn_omp_nesting_simd); + return CurrentRegion != OMPD_simd; } if (ParentRegion == OMPD_atomic) { // OpenMP [2.16, Nesting of Regions] |