[flang-commits] [flang] [llvm] [Flang][OpenMP][Sema] Adding parsing and semantic support for scan directive. (PR #102792)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Tue Sep 3 05:15:33 PDT 2024


================
@@ -550,17 +551,23 @@ void OmpStructureChecker::CheckSIMDNest(const parser::OpenMPConstruct &c) {
                         }
                       }
                     },
-                    [&](const parser::OpenMPSimpleStandaloneConstruct &c) {
-                      const auto &dir{
-                          std::get<parser::OmpSimpleStandaloneDirective>(c.t)};
-                      if (dir.v == llvm::omp::Directive::OMPD_ordered) {
-                        const auto &clauses{
-                            std::get<parser::OmpClauseList>(c.t)};
-                        for (const auto &clause : clauses.v) {
-                          if (std::get_if<parser::OmpClause::Simd>(&clause.u)) {
-                            eligibleSIMD = true;
-                            break;
+                    [&](const parser::OpenMPStandaloneConstruct &c) {
+                      if (const auto &simpleConstruct =
+                              std::get_if<parser::OpenMPSimpleStandaloneConstruct>(
+                                  &c.u)) {
+                        const auto &dir{std::get<parser::OmpSimpleStandaloneDirective>(
+                            simpleConstruct->t)};
+                        if (dir.v == llvm::omp::Directive::OMPD_ordered) {
+                          const auto &clauses{
+                              std::get<parser::OmpClauseList>(simpleConstruct->t)};
+                          for (const auto &clause : clauses.v) {
+                            if (std::get_if<parser::OmpClause::Simd>(&clause.u)) {
+                              eligibleSIMD = true;
+                              break;
+                            }
                           }
+                        } else if (dir.v == llvm::omp::Directive::OMPD_scan) {
+                          eligibleSIMD = true;
----------------
mjklemm wrote:

I think you can ignore the formatter for a commit and later do a commit that only has the formatting changes.  Anyways, looks good to me.

https://github.com/llvm/llvm-project/pull/102792


More information about the flang-commits mailing list