[PATCH] D54400: Move ExprMutationAnalyzer to Tooling/Analysis (2/3)

Shuai Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 11 14:05:03 PST 2018


shuaiwang created this revision.
shuaiwang added reviewers: george.karpenkov, rsmith, dblaikie.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, a.sidorin, mgorny.
shuaiwang added a dependency: D54399: Move ExprMutationAnalyzer to Tooling/Analysis (1/3).

Reference the new location of ExprMutationAnalyzer.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54400

Files:
  clang-tidy/performance/CMakeLists.txt
  clang-tidy/performance/ForRangeCopyCheck.cpp
  clang-tidy/performance/UnnecessaryValueParamCheck.cpp
  clang-tidy/performance/UnnecessaryValueParamCheck.h


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<const FunctionDecl *, FunctionParmMutationAnalyzer>
+  llvm::DenseMap<const FunctionDecl *, tooling::FunctionParmMutationAnalyzer>
       MutationAnalyzers;
   std::unique_ptr<utils::IncludeInserter> 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<ParmVarDecl>("param");
   const auto *Function = Result.Nodes.getNodeAs<FunctionDecl>("functionDecl");
 
-  FunctionParmMutationAnalyzer &Analyzer =
+  tooling::FunctionParmMutationAnalyzer &Analyzer =
       MutationAnalyzers.try_emplace(Function, *Function, *Result.Context)
           .first->second;
   if (Analyzer.isMutated(Param))
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/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
   )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54400.173581.patch
Type: text/x-patch
Size: 2969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181111/5a0d35a8/attachment.bin>


More information about the cfe-commits mailing list