diff options
author | Kim Gräsman <kim.grasman@gmail.com> | 2022-07-24 21:27:51 +0200 |
---|---|---|
committer | Kim Gräsman <kim.grasman@gmail.com> | 2022-07-24 22:15:58 +0200 |
commit | bfe1909a9cfc8c85193c0ec31d3f313c9ec66ab9 (patch) | |
tree | f3e8e1f4d95315bf48091d351c4ce0ed5dc26f77 | |
parent | d2d4d15d8dcfebc388b07618ba3a9471223fc9d3 (diff) |
Remove fruitless Base::Visit calls
The IwyuBaseAstVisitor has a base class, BaseAstVisitor, but it only has a
small number of Visit functions implemented, for logging.
So there is no need to call Base::VisitX in general, only for the few with
an implementation that actually does something, and they are preserved
here.
-rw-r--r-- | iwyu.cc | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1704,7 +1704,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { if (const clang::Type* type = integer_type.getTypePtrOrNull()) { ReportTypeUse(CurrentLoc(), type); } - return Base::VisitEnumDecl(decl); + return true; } // If you say 'typedef Foo Bar', C++ says you just need to @@ -1744,7 +1744,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { current_ast_node()->set_in_forward_declare_context(false); } - return Base::VisitTypedefNameDecl(decl); + return true; } // If we're a declared (not defined) function, all our types -- @@ -1859,7 +1859,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { ReportTypeUse(CurrentLoc(), return_type); } - return Base::VisitCXXMethodDecl(method_decl); + return true; } //------------------------------------------------------------ @@ -1878,7 +1878,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { // catch(...): no type to act on here. } - return Base::VisitCXXCatchStmt(stmt); + return true; } // The type of the for-range-init expression is fully required, because the @@ -1896,7 +1896,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { // argument-dependent begin/end declarations. } - return Base::VisitCXXForRangeStmt(stmt); + return true; } // When casting non-pointers, iwyu will do the right thing @@ -2491,7 +2491,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { } } - return Base::VisitType(type); + return true; } bool VisitTemplateSpecializationType(TemplateSpecializationType* type) { |