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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/AST/ASTTypeTraits.h | ||
---|---|---|
264 ↗ | (On Diff #16786) | 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 ↗ | (On Diff #16786) | It used to be that DynTypedNode::create() stored the static type of the node in NodeKind. |
Comment Actions
lg with comment added :)
include/clang/AST/ASTTypeTraits.h | ||
---|---|---|
264 ↗ | (On Diff #16786) | Yse please :) |