[clang-tools-extra] r260212 - [clang-tidy] Replace a custom ASTMatcher with a built-in one.

Gabor Horvath via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 01:26:11 PST 2016


Author: xazax
Date: Tue Feb  9 03:26:11 2016
New Revision: 260212

URL: http://llvm.org/viewvc/llvm-project?rev=260212&view=rev
Log:
[clang-tidy] Replace a custom ASTMatcher with a built-in one.

Modified:
    clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp?rev=260212&r1=260211&r2=260212&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp Tue Feb  9 03:26:11 2016
@@ -37,8 +37,6 @@ static bool isContainer(llvm::StringRef
 
 namespace clang {
 namespace {
-AST_MATCHER(QualType, isBoolType) { return Node->isBooleanType(); }
-
 AST_MATCHER(NamedDecl, stlContainer) {
   return isContainer(Node.getQualifiedNameAsString());
 }
@@ -67,11 +65,11 @@ void ContainerSizeEmptyCheck::registerMa
                               ignoringImpCasts(integerLiteral(equals(1)))))))
               .bind("SizeBinaryOp")),
       hasParent(implicitCastExpr(
-          hasImplicitDestinationType(isBoolType()),
+          hasImplicitDestinationType(booleanType()),
           anyOf(
               hasParent(unaryOperator(hasOperatorName("!")).bind("NegOnSize")),
               anything()))),
-      hasParent(explicitCastExpr(hasDestinationType(isBoolType()))));
+      hasParent(explicitCastExpr(hasDestinationType(booleanType()))));
 
   Finder->addMatcher(
       cxxMemberCallExpr(




More information about the cfe-commits mailing list