[PATCH] Skip some unnecessary type checks.

Samuel Benzaquen sbenza at google.com
Mon Dec 1 13:51:49 PST 2014


Hi klimek,

Skip some unnecessary type checks wrt DynTypedNodes.
Add DynTypedNode::getUnchecked() to skip the runtime check when the type
is known.
Speed up DynTypedNode::operator== by using isSame() instead of
isBaseOf().
Skip the type check in MatcherInterface<T>::matches(). All calls come
from DynTypedMatcher::matches(), which already did the type check.
This change speeds up our clang-tidy benchmark by ~4%.

http://reviews.llvm.org/D6468

Files:
  include/clang/AST/ASTTypeTraits.h
  include/clang/ASTMatchers/ASTMatchersInternal.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6468.16786.patch
Type: text/x-patch
Size: 4113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141201/c94a27e6/attachment.bin>


More information about the cfe-commits mailing list