llvm-project/clang/unittests
Samuel Benzaquen ee110341fb Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.
Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.

As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of
symbols generated by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D5485

llvm-svn: 218616
2014-09-29 18:43:20 +00:00
..
AST unique_ptrify SourceManager::createFileID 2014-08-29 07:59:55 +00:00
ASTMatchers Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts. 2014-09-29 18:43:20 +00:00
Basic Unique_ptrify PPCallbacks ownership. 2014-09-10 04:53:53 +00:00
CodeGen unique_ptrify SourceManager::createFileID 2014-08-29 07:59:55 +00:00
Driver [Driver] clang::driver::getARMCPUForMArch() moved to llvm::Triple::getARMCPUForArch(). 2014-07-11 23:47:48 +00:00
Format clang-format: Fix GCC warning about implicit bool pointer conversion. 2014-09-29 08:07:46 +00:00
Frontend Revert over-eager unique_ptr conversion. 2014-09-10 09:35:49 +00:00
Lex Unique_ptrify PPCallbacks ownership. 2014-09-10 04:53:53 +00:00
Sema Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325) 2014-08-10 19:56:51 +00:00
Tooling Tooling: Ignore file names in tooling::deduplicate. 2014-09-09 13:53:29 +00:00
libclang Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
CMakeLists.txt Don't segfault in EmitCXXGlobalInitFunc when main file is a membuf 2014-08-26 22:10:15 +00:00
Makefile Don't segfault in EmitCXXGlobalInitFunc when main file is a membuf 2014-08-26 22:10:15 +00:00