llvm-project/clang/unittests/Tooling/RecursiveASTVisitorTests
Dmitri Gribenko 5689b38c6a Removed a RecursiveASTVisitor feature to visit operator kinds with different methods
Summary:
This feature was only used in two places, but contributed a non-trivial
amount to the complexity of RecursiveASTVisitor, and was buggy (see my
recent patches where I was fixing the bugs that I noticed). I don't
think the convenience benefit of this feature is worth the complexity.

Besides complexity, another issue with the current state of
RecursiveASTVisitor is the non-uniformity in how it handles different
AST nodes. All AST nodes follow a regular pattern, but operators are
special -- and this special behavior not documented. Correct usage of
RecursiveASTVisitor relies on shadowing member functions with specific
names and signatures. Near misses don't cause any compile-time errors,
incorrectly named or typed methods are just silently ignored. Therefore,
predictability of RecursiveASTVisitor API is quite important.

This change reduces the size of the `clang` binary by 38 KB (0.2%) in
release mode, and by 7 MB (0.3%) in debug mode. The `clang-tidy` binary
is reduced by 205 KB (0.3%) in release mode, and by 5 MB (0.4%) in debug
mode. I don't think these code size improvements are significant enough
to justify this change on its own (for me, the primary motivation is
reducing code complexity), but they I think are a nice side-effect.

Reviewers: rsmith, sammccall, ymandel, aaron.ballman

Reviewed By: rsmith, sammccall, ymandel, aaron.ballman

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82921
2020-07-06 13:38:01 +02:00
..
Attr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CXXBoolLiteralExpr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CXXMemberCall.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CXXMethodDecl.cpp [AST] default implementation is possible for non-member functions in C++20. 2020-05-25 10:45:12 +02:00
CXXOperatorCallExprTraverser.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Callbacks.cpp Removed a RecursiveASTVisitor feature to visit operator kinds with different methods 2020-07-06 13:38:01 +02:00
Class.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstructExpr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclRefExpr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImplicitCtor.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImplicitCtorInitializer.cpp [AST] Fix buildbot failure because of raw string inside macro from 367839. 2019-08-05 17:14:46 +00:00
InitListExprPostOrder.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InitListExprPostOrderNoQueue.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InitListExprPreOrder.cpp [AST] Treat semantic form of InitListExpr as implicit code in traversals 2019-07-22 09:58:53 +00:00
InitListExprPreOrderNoQueue.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntegerLiteral.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LambdaDefaultCapture.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LambdaExpr.cpp Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
LambdaTemplateParams.cpp [clang][test] Add missing LambdaTemplateParams test and migrate from getLocStart 2019-06-19 17:43:58 +00:00
MemberPointerTypeLoc.cpp [Tooling] Move raw string literal out of a macro call. NFC 2019-12-12 10:53:20 +01:00
NestedNameSpecifiers.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ParenExpr.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TemplateArgumentLocTraverser.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TraversalScope.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00