Filter the toplevel matchers by kind.
authorSamuel Benzaquen <sbenza@google.com>
Mon, 24 Nov 2014 21:21:09 +0000 (21:21 +0000)
committerSamuel Benzaquen <sbenza@google.com>
Mon, 24 Nov 2014 21:21:09 +0000 (21:21 +0000)
commit074bbb698db6f2b4559a65a247e9d7aa0686de94
tree6b1d510de2cccf6c1f0fe268be203bd99cb3d56d
parent6953a3a6e006ee1f023e999a4304fddfbf70f1fc
Filter the toplevel matchers by kind.

Summary:
Filter the toplevel matchers by kind.
Decl and Stmt matchers are tied to a specific node kind and trying to
match incompatible nodes is a waste.
Precalculate a filtered list of matchers that have a chance of matching
the node and ignore the rest.
Speeds up our clang-tidy benchmark by ~10%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 222688
clang/include/clang/AST/ASTTypeTraits.h
clang/include/clang/ASTMatchers/ASTMatchFinder.h
clang/include/clang/ASTMatchers/ASTMatchersInternal.h
clang/lib/ASTMatchers/ASTMatchFinder.cpp
clang/lib/ASTMatchers/ASTMatchersInternal.cpp