[flang-commits] [flang] [flang][OpenMP]Add symbls omp_in, omp_out and omp_priv in DECLARE RED… (PR #129908)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Wed Mar 5 10:36:20 PST 2025


================
@@ -2705,11 +2705,14 @@ class UnparseVisitor {
     Walk(std::get<std::list<ActualArgSpec>>(x.t));
     Put(")");
   }
-  void Unparse(const OmpInitializerExpr &x) {
-    Word("OMP_PRIV = ");
-    Walk(x.v);
+  void Unparse(const OmpInitializerClause &x) {
+    // Don't let the visitor go to the normal AssignmentStmt Unparse function,
+    // it adds an extra newline that we don't want.
+    if (const auto *assignment = std::get_if<AssignmentStmt>(&x.u))
+      Walk(assignment->t, "=");
+    else
+      Walk(x.u);
----------------
kparzysz wrote:

The convention in Parser is to use braces even with single statements.

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


More information about the flang-commits mailing list