diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-09-17 13:31:25 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-09-17 13:31:25 +0000 |
commit | b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8 (patch) | |
tree | 362e33db9c2d4fb7ab5fc96172386893a7d50b10 /clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | |
parent | 512fb64765c7d61e89531b8ff697a85d815d9a13 (diff) | |
download | bcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.tar.gz bcm5719-llvm-b9ea09c4451cb8f33ffd41d22b7dd10e8a68c5c8.zip |
Refactors AST matching code to use the new AST matcher names. This patch correlates to r247885 which performs the AST matcher rename in Clang.
llvm-svn: 247886
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp index 5bd9f75c815..cd264268a6f 100644 --- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp @@ -19,11 +19,12 @@ namespace tidy { void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( expr(unless(isInTemplateInstantiation()), - expr(sizeOfExpr(has(expr(hasType(hasCanonicalType(hasDeclaration( - recordDecl(matchesName("^(::std::|::string)"), - unless(matchesName("^::std::(bitset|array)$")), - hasMethod(methodDecl(hasName("size"), isPublic(), - isConst())))))))))) + expr(sizeOfExpr(has( + expr(hasType(hasCanonicalType(hasDeclaration(cxxRecordDecl( + matchesName("^(::std::|::string)"), + unless(matchesName("^::std::(bitset|array)$")), + hasMethod(cxxMethodDecl(hasName("size"), isPublic(), + isConst())))))))))) .bind("sizeof"), // Ignore ARRAYSIZE(<array of containers>) pattern. unless(hasAncestor(binaryOperator( |