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%.
Details
Diff Detail
Event Timeline
include/clang/AST/ASTTypeTraits.h | ||
---|---|---|
264 | Why doesn't this change behavior? -> can we not get the same node with a different more or less specific type? |
include/clang/AST/ASTTypeTraits.h | ||
---|---|---|
264 | It used to be that DynTypedNode::create() stored the static type of the node in NodeKind. |
Why doesn't this change behavior? -> can we not get the same node with a different more or less specific type?