[flang-commits] [flang] [flang] Visit "source" member in all AST nodes (PR #175211)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Jan 9 11:42:16 PST 2026


================
@@ -59,6 +59,20 @@ struct ParseTreeVisitorLookupScope {
     }
   }
 
+  template <typename A, typename V>
+  static void WalkSource(const A &x, V &visitor) {
+    if constexpr (HasSource<A>::value) {
+      Walk(x.source, visitor);
+    }
+  }
+
+  template <typename A, typename M>
----------------
klausler wrote:

This second template may be all that you need.

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


More information about the flang-commits mailing list