[flang-commits] [flang] [flang] Add parsing of DO CONCURRENT REDUCE clause (PR #92518)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri May 17 10:15:33 PDT 2024


================
@@ -683,6 +683,89 @@ class DoContext {
     }
   }
 
+  void CheckReduce(
+      const parser::LocalitySpec::Reduce &reduce) const {
+    const parser::ReduceOperation &reduceOperation =
+        std::get<parser::ReduceOperation>(reduce.t);
+    // F'2023 C1132, reduction variables should have suitable intrinsic type
+    bool supported_identifier = true;
+    common::visit(
+        common::visitors{
+            [&](const parser::DefinedOperator &dOpr) {
+              const auto &intrinsicOp{
+                std::get<parser::DefinedOperator::IntrinsicOperator>(dOpr.u)
+              };
+              for (const Fortran::parser::Name &x :
+                       std::get<std::list<Fortran::parser::Name>>(reduce.t)) {
+                const auto *type{x.symbol->GetType()};
----------------
klausler wrote:

Better error recovery: don't assume that `x.symbol` is not a null pointer.

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


More information about the flang-commits mailing list