ASTNodeKind::isBaseOf shows in one of the top lines of the profile when running a large clang-tidy benchmark. This rewrite reduces its cumulative time from 6.14% to 3.7%:
< 11.06s 6.14%: clang::ast_type_traits::ASTNodeKind::isBaseOf > 5.75s 3.70%: clang::ast_type_traits::ASTNodeKind::isBaseOf
Also, perhaps declare a constant to std::numeric_limits<unsigned>::max()?