@@ -1524,6 +1524,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPBlockConstruct &x) {
15241524 case llvm::omp::Directive::OMPD_masked:
15251525 case llvm::omp::Directive::OMPD_parallel_masked:
15261526 case llvm::omp::Directive::OMPD_master:
1527+ case llvm::omp::Directive::OMPD_parallel_master:
15271528 case llvm::omp::Directive::OMPD_ordered:
15281529 case llvm::omp::Directive::OMPD_parallel:
15291530 case llvm::omp::Directive::OMPD_single:
@@ -1542,7 +1543,8 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPBlockConstruct &x) {
15421543 // TODO others
15431544 break ;
15441545 }
1545- if (beginDir.v == llvm::omp::Directive::OMPD_master)
1546+ if (beginDir.v == llvm::omp::Directive::OMPD_master ||
1547+ beginDir.v == llvm::omp::Directive::OMPD_parallel_master)
15461548 IssueNonConformanceWarning (beginDir.v , beginDir.source );
15471549 ClearDataSharingAttributeObjects ();
15481550 ClearPrivateDataSharingAttributeObjects ();
@@ -1555,7 +1557,9 @@ void OmpAttributeVisitor::Post(const parser::OpenMPBlockConstruct &x) {
15551557 const auto &beginDir{std::get<parser::OmpBlockDirective>(beginBlockDir.t )};
15561558 switch (beginDir.v ) {
15571559 case llvm::omp::Directive::OMPD_masked:
1560+ case llvm::omp::Directive::OMPD_master:
15581561 case llvm::omp::Directive::OMPD_parallel_masked:
1562+ case llvm::omp::Directive::OMPD_parallel_master:
15591563 case llvm::omp::Directive::OMPD_parallel:
15601564 case llvm::omp::Directive::OMPD_single:
15611565 case llvm::omp::Directive::OMPD_target:
@@ -1625,10 +1629,14 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPLoopConstruct &x) {
16251629 case llvm::omp::Directive::OMPD_loop:
16261630 case llvm::omp::Directive::OMPD_masked_taskloop_simd:
16271631 case llvm::omp::Directive::OMPD_masked_taskloop:
1632+ case llvm::omp::Directive::OMPD_master_taskloop_simd:
1633+ case llvm::omp::Directive::OMPD_master_taskloop:
16281634 case llvm::omp::Directive::OMPD_parallel_do:
16291635 case llvm::omp::Directive::OMPD_parallel_do_simd:
16301636 case llvm::omp::Directive::OMPD_parallel_masked_taskloop_simd:
16311637 case llvm::omp::Directive::OMPD_parallel_masked_taskloop:
1638+ case llvm::omp::Directive::OMPD_parallel_master_taskloop_simd:
1639+ case llvm::omp::Directive::OMPD_parallel_master_taskloop:
16321640 case llvm::omp::Directive::OMPD_simd:
16331641 case llvm::omp::Directive::OMPD_target_loop:
16341642 case llvm::omp::Directive::OMPD_target_parallel_do:
@@ -1653,7 +1661,11 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPLoopConstruct &x) {
16531661 default :
16541662 break ;
16551663 }
1656- if (beginDir.v == llvm::omp::Directive::OMPD_target_loop)
1664+ if (beginDir.v == llvm::omp::OMPD_master_taskloop ||
1665+ beginDir.v == llvm::omp::OMPD_master_taskloop_simd ||
1666+ beginDir.v == llvm::omp::OMPD_parallel_master_taskloop ||
1667+ beginDir.v == llvm::omp::OMPD_parallel_master_taskloop_simd ||
1668+ beginDir.v == llvm::omp::Directive::OMPD_target_loop)
16571669 IssueNonConformanceWarning (beginDir.v , beginDir.source );
16581670 ClearDataSharingAttributeObjects ();
16591671 SetContextAssociatedLoopLevel (GetAssociatedLoopLevelFromClauses (clauseList));
@@ -2882,7 +2894,10 @@ void OmpAttributeVisitor::IssueNonConformanceWarning(
28822894 llvm::omp::Directive D, parser::CharBlock source) {
28832895 std::string warnStr;
28842896 llvm::raw_string_ostream warnStrOS (warnStr);
2885- warnStrOS << " OpenMP directive " << parser::ToUpperCaseLetters (llvm::omp::getOpenMPDirectiveName (D).str ()) << " has been deprecated" ;
2897+ warnStrOS << " OpenMP directive "
2898+ << parser::ToUpperCaseLetters (
2899+ llvm::omp::getOpenMPDirectiveName (D).str ())
2900+ << " has been deprecated" ;
28862901
28872902 auto setAlternativeStr = [&warnStrOS](llvm::StringRef alt) {
28882903 warnStrOS << " , please use " << alt << " instead." ;
@@ -2891,11 +2906,25 @@ void OmpAttributeVisitor::IssueNonConformanceWarning(
28912906 case llvm::omp::OMPD_master:
28922907 setAlternativeStr (" MASKED" );
28932908 break ;
2909+ case llvm::omp::OMPD_master_taskloop:
2910+ setAlternativeStr (" MASKED TASKLOOP" );
2911+ break ;
2912+ case llvm::omp::OMPD_master_taskloop_simd:
2913+ setAlternativeStr (" MASKED TASKLOOP SIMD" );
2914+ break ;
2915+ case llvm::omp::OMPD_parallel_master:
2916+ setAlternativeStr (" PARALLEL MASKED" );
2917+ break ;
2918+ case llvm::omp::OMPD_parallel_master_taskloop:
2919+ setAlternativeStr (" PARALLEL MASKED TASKLOOP" );
2920+ break ;
2921+ case llvm::omp::OMPD_parallel_master_taskloop_simd:
2922+ setAlternativeStr (" PARALLEL_MASKED TASKLOOP SIMD" );
28942923 break ;
28952924 case llvm::omp::OMPD_target_loop:
2896- default :
2925+ default :;
28972926 }
2898- context_.Warn (
2899- common::UsageWarning::OpenMPUsage, source, " %s " _warn_en_US, warnStrOS.str ());
2927+ context_.Warn (common::UsageWarning::OpenMPUsage, source, " %s " _warn_en_US,
2928+ warnStrOS.str ());
29002929}
29012930} // namespace Fortran::semantics
0 commit comments