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

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 06:24:30 PDT 2024


================
@@ -751,7 +759,43 @@ void OmpStructureChecker::CheckDistLinear(
   }
 }
 
-void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &) {
+void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &x) {
+  const auto &beginLoopDir = std::get<parser::OmpBeginLoopDirective>(x.t);
+  const auto &clauseList{std::get<parser::OmpClauseList>(beginLoopDir.t)};
+  for (const auto &clause : clauseList.v) {
+    if (const auto *reductionClause{
+            std::get_if<parser::OmpClause::Reduction>(&clause.u)}) {
+      using ReductionModifier = parser::OmpReductionClause::ReductionModifier;
----------------
skatrak wrote:

This should not be necessary here if it's already defined at the class level.
```suggestion
```

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


More information about the llvm-commits mailing list