A bit of AST matcher cleanup, NFC.
Removed the uses of the allOf() matcher inside node matchers that are implicit
allOf(). Replaced uses of allOf() with the explicit node matcher where it makes
matchers more readable. Replace anyOf(hasName(), hasName(), ...) with the more
efficient and readable hasAnyName().
llvm-svn: 347520
diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
index ef6bcd6..6f31057 100644
--- a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
+++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
@@ -39,10 +39,6 @@
void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
auto ConstReference = referenceType(pointee(qualType(isConstQualified())));
- auto ConstOrConstReference =
- allOf(anyOf(ConstReference, isConstQualified()),
- unless(allOf(pointerType(), unless(pointerType(pointee(
- qualType(isConstQualified())))))));
// Match method call expressions where the `this` argument is only used as
// const, this will be checked in `check()` part. This returned const
@@ -63,11 +59,11 @@
declStmt(
has(varDecl(hasLocalStorage(),
hasType(qualType(
- allOf(hasCanonicalType(
- matchers::isExpensiveToCopy()),
- unless(hasDeclaration(namedDecl(
- matchers::matchesAnyListedName(
- AllowedTypes))))))),
+ hasCanonicalType(
+ matchers::isExpensiveToCopy()),
+ unless(hasDeclaration(namedDecl(
+ matchers::matchesAnyListedName(
+ AllowedTypes)))))),
unless(isImplicit()),
hasInitializer(
cxxConstructExpr(