llvm-project/clang/lib/ARCMigrate
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
..
ARCMT.cpp [ARCMT][NFC] Reduce #include dependencies 2020-02-12 19:10:46 +01:00
ARCMTActions.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
FileRemapper.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Internals.h [ARCMT][NFC] Reduce #include dependencies 2020-02-12 19:10:46 +01:00
ObjCMT.cpp Fix more implicit conversions. Getting closer to having clang working with gcc 5 again 2020-01-29 02:57:59 +01:00
PlistReporter.cpp Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
TransAPIUses.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransARCAssign.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransAutoreleasePool.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransBlockObjCVariable.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransEmptyStatementsAndDealloc.cpp Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or llvm::partition_point. NFC 2019-07-03 08:13:17 +00:00
TransGCAttrs.cpp [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec. 2020-04-23 17:21:25 -04:00
TransGCCalls.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransProperties.cpp Removed a RecursiveASTVisitor feature to visit operator kinds with different methods 2020-07-06 13:38:01 +02:00
TransProtectedScope.cpp Avoid SourceManager.h include in RawCommentList.h, add missing incs 2020-02-27 13:49:40 -08:00
TransRetainReleaseDealloc.cpp [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
TransUnbridgedCasts.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransUnusedInitDelegate.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TransZeroOutPropsInDealloc.cpp [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec. 2020-04-23 17:21:25 -04:00
TransformActions.cpp Fix file headers. NFC 2019-03-01 06:49:51 +00:00
Transforms.cpp [ARCMT][NFC] Reduce #include dependencies 2020-02-12 19:10:46 +01:00
Transforms.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00