summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Gräsman <kim.grasman@gmail.com>2022-07-24 21:27:51 +0200
committerKim Gräsman <kim.grasman@gmail.com>2022-07-24 22:15:58 +0200
commitbfe1909a9cfc8c85193c0ec31d3f313c9ec66ab9 (patch)
treef3e8e1f4d95315bf48091d351c4ce0ed5dc26f77
parentd2d4d15d8dcfebc388b07618ba3a9471223fc9d3 (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.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/iwyu.cc b/iwyu.cc
index 0147718..52198f7 100644
--- a/iwyu.cc
+++ b/iwyu.cc
@@ -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) {