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

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri May 30 05:27:36 PDT 2025


================
@@ -3508,6 +3509,17 @@ bool OmpStructureChecker::CheckReductionOperator(
         break;
       }
     }
+    // User-defined operators are OK if there has been a declared reduction
+    // for that. We mangle those names to store the user details.
+    if (const auto *definedOp{std::get_if<parser::DefinedOpName>(&dOpr.u)}) {
+      std::string mangled = MangleDefinedOperator(definedOp->v.symbol->name());
+      const Scope &scope = definedOp->v.symbol->owner();
+      if (const Symbol *symbol = scope.FindSymbol(mangled)) {
----------------
kiranchandramohan wrote:

Nit: Braced initialization for all three assignments here.

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


More information about the flang-commits mailing list