[flang-commits] [flang] [flang][openmp]Add UserReductionDetails and use in DECLARE REDUCTION (PR #131628)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Wed Mar 26 10:23:29 PDT 2025


================
@@ -3479,8 +3483,18 @@ static bool IsReductionAllowedForType(
         DIE("This should have been caught in CheckIntrinsicOperator");
         return false;
       }
+      parser::CharBlock name{MakeNameFromOperator(*intrinsicOp)};
+      Symbol *symbol{scope.FindSymbol(name)};
+      if (symbol) {
+        const auto *reductionDetails{symbol->detailsIf<UserReductionDetails>()};
+        assert(reductionDetails && "Expected to find reductiondetails");
+
+        return reductionDetails->SupportsType(&type);
+      }
+      return false;
     }
-    return true;
+    assert(0 && "Intrinsic Operator not found - parsing gone wrong?");
----------------
Leporacanthicus wrote:

Done.

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


More information about the flang-commits mailing list