[clang] [Clang] [NFC] Refactor more AST visitors (PR #116823)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 08:11:31 PST 2025


================
@@ -427,42 +423,53 @@ class ParentMapContext::ParentMap::ASTVisitor
     return Result;
   }
 
-  bool TraverseDecl(Decl *DeclNode) {
+  bool TraverseDecl(Decl *DeclNode) override {
     return TraverseNode(
-        DeclNode, DeclNode, [&] { return VisitorBase::TraverseDecl(DeclNode); },
+        DeclNode, DeclNode,
+        [&] { return DynamicRecursiveASTVisitor::TraverseDecl(DeclNode); },
         &Map.PointerParents);
   }
-  bool TraverseTypeLoc(TypeLoc TypeLocNode) {
+  bool TraverseTypeLoc(TypeLoc TypeLocNode) override {
     return TraverseNode(
         TypeLocNode, DynTypedNode::create(TypeLocNode),
-        [&] { return VisitorBase::TraverseTypeLoc(TypeLocNode); },
+        [&] {
+          return DynamicRecursiveASTVisitor::TraverseTypeLoc(TypeLocNode);
----------------
Sirraide wrote:

Er, unless I misread something horribly somewhere, in both cases this is statically calling the base class implementation (`VisitorBase` was `RecursiveASTVisitor<ASTVisitor>`, i.e. the base class of this thing).

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


More information about the cfe-commits mailing list