[flang-commits] [flang] [flang] Remove unnecessary overloads of Walk in parse tree visitor (PR #175563)

via flang-commits flang-commits at lists.llvm.org
Mon Jan 12 07:40:13 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-parser

Author: Krzysztof Parzyszek (kparzysz)

<details>
<summary>Changes</summary>

These actions are now performed by the trait-based Walk functions.

---
Full diff: https://github.com/llvm/llvm-project/pull/175563.diff


1 Files Affected:

- (modified) flang/include/flang/Parser/parse-tree-visitor.h (-72) 


``````````diff
diff --git a/flang/include/flang/Parser/parse-tree-visitor.h b/flang/include/flang/Parser/parse-tree-visitor.h
index b7d41254c75c4..61470f8c30604 100644
--- a/flang/include/flang/Parser/parse-tree-visitor.h
+++ b/flang/include/flang/Parser/parse-tree-visitor.h
@@ -433,35 +433,6 @@ struct ParseTreeVisitorLookupScope {
         x, mutator);
   }
 
-  template <typename V> static void Walk(const Designator &x, V &visitor) {
-    if (visitor.Pre(x)) {
-      Walk(x.source, visitor);
-      Walk(x.u, visitor);
-      visitor.Post(x);
-    }
-  }
-  template <typename M> static void Walk(Designator &x, M &mutator) {
-    if (mutator.Pre(x)) {
-      Walk(x.source, mutator);
-      Walk(x.u, mutator);
-      mutator.Post(x);
-    }
-  }
-  template <typename V>
-  static void Walk(const FunctionReference &x, V &visitor) {
-    if (visitor.Pre(x)) {
-      Walk(x.source, visitor);
-      Walk(x.v, visitor);
-      visitor.Post(x);
-    }
-  }
-  template <typename M> static void Walk(FunctionReference &x, M &mutator) {
-    if (mutator.Pre(x)) {
-      Walk(x.source, mutator);
-      Walk(x.v, mutator);
-      mutator.Post(x);
-    }
-  }
   template <typename V> static void Walk(const CallStmt &x, V &visitor) {
     if (visitor.Pre(x)) {
       Walk(x.source, visitor);
@@ -513,22 +484,6 @@ struct ParseTreeVisitorLookupScope {
     }
   }
   template <typename V>
-  static void Walk(const SignedIntLiteralConstant &x, V &visitor) {
-    if (visitor.Pre(x)) {
-      Walk(x.source, visitor);
-      Walk(x.t, visitor);
-      visitor.Post(x);
-    }
-  }
-  template <typename M>
-  static void Walk(SignedIntLiteralConstant &x, M &mutator) {
-    if (mutator.Pre(x)) {
-      Walk(x.source, mutator);
-      Walk(x.t, mutator);
-      mutator.Post(x);
-    }
-  }
-  template <typename V>
   static void Walk(const RealLiteralConstant &x, V &visitor) {
     if (visitor.Pre(x)) {
       Walk(x.real, visitor);
@@ -736,33 +691,6 @@ struct ParseTreeVisitorLookupScope {
       mutator.Post(x);
     }
   }
-  template <typename V>
-  static void Walk(const CompilerDirective &x, V &visitor) {
-    if (visitor.Pre(x)) {
-      Walk(x.source, visitor);
-      Walk(x.u, visitor);
-      visitor.Post(x);
-    }
-  }
-  template <typename M> static void Walk(CompilerDirective &x, M &mutator) {
-    if (mutator.Pre(x)) {
-      Walk(x.source, mutator);
-      Walk(x.u, mutator);
-      mutator.Post(x);
-    }
-  }
-  template <typename V>
-  static void Walk(const CompilerDirective::Unrecognized &x, V &visitor) {
-    if (visitor.Pre(x)) {
-      visitor.Post(x);
-    }
-  }
-  template <typename M>
-  static void Walk(CompilerDirective::Unrecognized &x, M &mutator) {
-    if (mutator.Pre(x)) {
-      mutator.Post(x);
-    }
-  }
 };
 } // namespace detail
 

``````````

</details>


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


More information about the flang-commits mailing list