Speed up hasName() matcher.
authorSamuel Benzaquen <sbenza@google.com>
Wed, 15 Oct 2014 14:58:46 +0000 (14:58 +0000)
committerSamuel Benzaquen <sbenza@google.com>
Wed, 15 Oct 2014 14:58:46 +0000 (14:58 +0000)
commit8513d6234d00cae96811fb07fc71e8000839b7ba
tree9b4b1adbe214c4528945dcc7012fcfdd1dbb99be
parent6b862f22e5fbda2ffd2a6241b76436de7610dc55
Speed up hasName() matcher.

Summary:
Speed up hasName() matcher by skipping the expensive generation of the
fully qualified name unless we need it.
In the common case of matching an unqualified name, we don't need to
generate the full name. We might not even need to copy any string at
all.
This change speeds up our clang-tidy benchmark by ~10%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 219792
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/include/clang/ASTMatchers/ASTMatchersInternal.h
clang/lib/ASTMatchers/ASTMatchersInternal.cpp