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

via flang-commits flang-commits at lists.llvm.org
Mon Jan 12 08:25:29 PST 2026


Author: Krzysztof Parzyszek
Date: 2026-01-12T10:25:25-06:00
New Revision: 01e089ee5e6c87f3be0668e1e2a145fc3906ff6b

URL: https://github.com/llvm/llvm-project/commit/01e089ee5e6c87f3be0668e1e2a145fc3906ff6b
DIFF: https://github.com/llvm/llvm-project/commit/01e089ee5e6c87f3be0668e1e2a145fc3906ff6b.diff

LOG: [flang] Remove unnecessary overloads of Walk in parse tree visitor (#175563)

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

Added: 
    

Modified: 
    flang/include/flang/Parser/parse-tree-visitor.h

Removed: 
    


################################################################################
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
 


        


More information about the flang-commits mailing list