etienneb added inline comments. ================ Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:73 @@ +72,3 @@ + Finder->addMatcher( + callExpr(allOf(callee(functionDecl(matchesName("::memcpy"))), + argumentCountIs(3))) ---------------- It's more efficient to use hasAnyName and merge the three following matcher. That way, you won't need the function 'getCallExpr' to retrieve the CallExpr.
================ Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:80 @@ +79,3 @@ + Finder->addMatcher( + callExpr(allOf(callee(functionDecl(matchesName("::memmove"))), + argumentCountIs(3))) ---------------- allOf is not needed. ================ Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:106 @@ +105,3 @@ + const auto *MatchedExpr = getCallExpr(Result); + const auto MatchedName = MatchedExpr->getDirectCallee()->getNameAsString(); + const auto ReplacedName = Replacements[MatchedName]; ---------------- Instead of DirectCallee, you could add a "bind" to the Matcher : functionDecl(...).bind("callee") ================ Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:107 @@ +106,3 @@ + const auto MatchedName = MatchedExpr->getDirectCallee()->getNameAsString(); + const auto ReplacedName = Replacements[MatchedName]; + ---------------- What is the name is not in the map? https://reviews.llvm.org/D22725 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits