diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-11 20:35:31 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-11 20:35:31 +0000 |
| commit | 8526031c5b984f3389089654cc410f314d533fd7 (patch) | |
| tree | 8b3a2563925b729c6494092dc40126c4255bf3ec /clang/lib/Sema | |
| parent | f002fcb2ad64a75a2f0aea3eb067614f4681284b (diff) | |
| download | bcm5719-llvm-8526031c5b984f3389089654cc410f314d533fd7.tar.gz bcm5719-llvm-8526031c5b984f3389089654cc410f314d533fd7.zip | |
[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Fixed the processing of the unsupported VLAs in the reduction clauses.
Used targetDiag if the diagnostics can be delayed and emit it
immediately if the target does not support VLAs and we're parsing target
directive with the reduction clauses.
llvm-svn: 365821
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 3a02b6ae02f..b669929e655 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -12140,10 +12140,14 @@ static bool actOnOMPReductionKindClause( if ((OASE && !ConstantLengthOASE) || (!OASE && !ASE && D->getType().getNonReferenceType()->isVariablyModifiedType())) { - if (!Context.getTargetInfo().isVLASupported() && - S.shouldDiagnoseTargetSupportFromOpenMP()) { - S.Diag(ELoc, diag::err_omp_reduction_vla_unsupported) << !!OASE; - S.Diag(ELoc, diag::note_vla_unsupported); + if (!Context.getTargetInfo().isVLASupported()) { + if (isOpenMPTargetExecutionDirective(Stack->getCurrentDirective())) { + S.Diag(ELoc, diag::err_omp_reduction_vla_unsupported) << !!OASE; + S.Diag(ELoc, diag::note_vla_unsupported); + } else { + S.targetDiag(ELoc, diag::err_omp_reduction_vla_unsupported) << !!OASE; + S.targetDiag(ELoc, diag::note_vla_unsupported); + } continue; } // For arrays/array sections only: |

