aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/performance
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2017-08-02 13:13:11 +0000
committerManuel Klimek <klimek@google.com>2017-08-02 13:13:11 +0000
commitf6d9f47621a7ca87268eea73a9b249bc67592a3c (patch)
tree997124ffab598717eca0cad0979606619cb64550 /clang-tidy/performance
parenta2f77bf8920bc71694c0ebee24d23d0684bd94ee (diff)
Adapt clang-tidy checks to changing semantics of hasDeclaration.
Differential Revision: https://reviews.llvm.org/D36154 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@309810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/performance')
-rw-r--r--clang-tidy/performance/FasterStringFindCheck.cpp8
-rw-r--r--clang-tidy/performance/InefficientStringConcatenationCheck.cpp3
2 files changed, 7 insertions, 4 deletions
diff --git a/clang-tidy/performance/FasterStringFindCheck.cpp b/clang-tidy/performance/FasterStringFindCheck.cpp
index 29dac1bc..eddc52b6 100644
--- a/clang-tidy/performance/FasterStringFindCheck.cpp
+++ b/clang-tidy/performance/FasterStringFindCheck.cpp
@@ -74,9 +74,11 @@ void FasterStringFindCheck::registerMatchers(MatchFinder *Finder) {
callee(functionDecl(StringFindFunctions).bind("func")),
anyOf(argumentCountIs(1), argumentCountIs(2)),
hasArgument(0, SingleChar),
- on(expr(hasType(recordDecl(hasAnyName(SmallVector<StringRef, 4>(
- StringLikeClasses.begin(), StringLikeClasses.end())))),
- unless(hasSubstitutedType())))),
+ on(expr(
+ hasType(hasUnqualifiedDesugaredType(recordType(hasDeclaration(
+ recordDecl(hasAnyName(SmallVector<StringRef, 4>(
+ StringLikeClasses.begin(), StringLikeClasses.end()))))))),
+ unless(hasSubstitutedType())))),
this);
}
diff --git a/clang-tidy/performance/InefficientStringConcatenationCheck.cpp b/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
index fb53167d..a17916d9 100644
--- a/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
+++ b/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
@@ -33,7 +33,8 @@ void InefficientStringConcatenationCheck::registerMatchers(
return;
const auto BasicStringType =
- hasType(cxxRecordDecl(hasName("::std::basic_string")));
+ hasType(qualType(hasUnqualifiedDesugaredType(recordType(
+ hasDeclaration(cxxRecordDecl(hasName("::std::basic_string")))))));
const auto BasicStringPlusOperator = cxxOperatorCallExpr(
hasOverloadedOperatorName("+"),