Index: clang-tidy/performance/CMakeLists.txt =================================================================== --- clang-tidy/performance/CMakeLists.txt +++ clang-tidy/performance/CMakeLists.txt @@ -18,9 +18,9 @@ LINK_LIBS clangAST clangASTMatchers - clangAnalysis clangBasic clangLex clangTidy clangTidyUtils + clangToolingAnalysis ) Index: clang-tidy/performance/ForRangeCopyCheck.cpp =================================================================== --- clang-tidy/performance/ForRangeCopyCheck.cpp +++ clang-tidy/performance/ForRangeCopyCheck.cpp @@ -13,7 +13,7 @@ #include "../utils/Matchers.h" #include "../utils/OptionsUtils.h" #include "../utils/TypeTraits.h" -#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h" +#include "clang/Tooling/Analysis/ExprMutationAnalyzer.h" using namespace clang::ast_matchers; @@ -98,7 +98,8 @@ // Because the fix (changing to `const auto &`) will introduce an unused // compiler warning which can't be suppressed. // Since this case is very rare, it is safe to ignore it. - if (!ExprMutationAnalyzer(*ForRange.getBody(), Context).isMutated(&LoopVar) && + if (!tooling::ExprMutationAnalyzer(*ForRange.getBody(), Context) + .isMutated(&LoopVar) && !utils::decl_ref_expr::allDeclRefExprs(LoopVar, *ForRange.getBody(), Context) .empty()) { Index: clang-tidy/performance/UnnecessaryValueParamCheck.h =================================================================== --- clang-tidy/performance/UnnecessaryValueParamCheck.h +++ clang-tidy/performance/UnnecessaryValueParamCheck.h @@ -12,7 +12,7 @@ #include "../ClangTidy.h" #include "../utils/IncludeInserter.h" -#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h" +#include "clang/Tooling/Analysis/ExprMutationAnalyzer.h" namespace clang { namespace tidy { @@ -36,7 +36,7 @@ void handleMoveFix(const ParmVarDecl &Var, const DeclRefExpr &CopyArgument, const ASTContext &Context); - llvm::DenseMap + llvm::DenseMap MutationAnalyzers; std::unique_ptr Inserter; const utils::IncludeSorter::IncludeStyle IncludeStyle; Index: clang-tidy/performance/UnnecessaryValueParamCheck.cpp =================================================================== --- clang-tidy/performance/UnnecessaryValueParamCheck.cpp +++ clang-tidy/performance/UnnecessaryValueParamCheck.cpp @@ -97,7 +97,7 @@ const auto *Param = Result.Nodes.getNodeAs("param"); const auto *Function = Result.Nodes.getNodeAs("functionDecl"); - FunctionParmMutationAnalyzer &Analyzer = + tooling::FunctionParmMutationAnalyzer &Analyzer = MutationAnalyzers.try_emplace(Function, *Function, *Result.Context) .first->second; if (Analyzer.isMutated(Param))