[clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`.
authorWei Yi Tee <wyt@google.com>
Wed, 21 Sep 2022 09:01:00 +0000 (09:01 +0000)
committerWei Yi Tee <wyt@google.com>
Wed, 21 Sep 2022 10:36:44 +0000 (10:36 +0000)
Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D134081

clang/unittests/Analysis/FlowSensitive/TestingSupport.h

index 7ea51d8..909a475 100644 (file)
@@ -356,97 +356,6 @@ checkDataflow(AnalysisInputs<AnalysisT> AI,
       });
 }
 
-// Deprecated.
-// FIXME: Remove this function after usage has been updated to the overload
-// which uses the `AnalysisInputs` struct.
-//
-/// Runs dataflow specified from `MakeAnalysis` on the body of the function that
-/// matches `TargetFuncMatcher` in `Code`. Given the state computed at each
-/// annotated statement, `VerifyResults` checks that the results from the
-/// analysis are correct.
-///
-/// Requirements:
-///
-///   `AnalysisT` contains a type `Lattice`.
-///
-///   `Code`, `TargetFuncMatcher`, `MakeAnalysis` and `VerifyResults` must be
-///   provided.
-///
-///   Any annotations appearing in `Code` must come after a statement.
-///
-///   There can be at most one annotation attached per statement.
-///
-///   Annotations must not be repeated.
-template <typename AnalysisT>
-llvm::Error checkDataflow(
-    llvm::StringRef Code,
-    ast_matchers::internal::Matcher<FunctionDecl> TargetFuncMatcher,
-    std::function<AnalysisT(ASTContext &, Environment &)> MakeAnalysis,
-    std::function<void(
-        llvm::ArrayRef<std::pair<
-            std::string, DataflowAnalysisState<typename AnalysisT::Lattice>>>,
-        ASTContext &)>
-        VerifyResults,
-    ArrayRef<std::string> Args,
-    const tooling::FileContentMappings &VirtualMappedFiles = {}) {
-  return checkDataflow<AnalysisT>(
-      AnalysisInputs<AnalysisT>(Code, std::move(TargetFuncMatcher),
-                                std::move(MakeAnalysis))
-          .withASTBuildArgs(std::move(Args))
-          .withASTBuildVirtualMappedFiles(std::move(VirtualMappedFiles)),
-      [&VerifyResults](const llvm::StringMap<DataflowAnalysisState<
-                           typename AnalysisT::Lattice>> &AnnotationStates,
-                       const AnalysisOutputs &AO) {
-        std::vector<std::pair<
-            std::string, DataflowAnalysisState<typename AnalysisT::Lattice>>>
-            AnnotationStatesAsVector;
-        for (const auto &P : AnnotationStates) {
-          AnnotationStatesAsVector.push_back(
-              std::make_pair(P.first().str(), std::move(P.second)));
-        }
-        llvm::sort(AnnotationStatesAsVector,
-                   [](auto a, auto b) { return a.first < b.first; });
-
-        VerifyResults(AnnotationStatesAsVector, AO.ASTCtx);
-      });
-}
-
-// Deprecated.
-// FIXME: Remove this function after usage has been updated to the overload
-// which uses the `AnalysisInputs` struct.
-//
-/// Runs dataflow specified from `MakeAnalysis` on the body of the function
-/// named `TargetFun` in `Code`. Given the state computed at each annotated
-/// statement, `VerifyResults` checks that the results from the analysis are
-/// correct.
-///
-/// Requirements:
-///
-///   `AnalysisT` contains a type `Lattice`.
-///
-///   Any annotations appearing in `Code` must come after a statement.
-///
-///   `Code`, `TargetFun`, `MakeAnalysis` and `VerifyResults` must be provided.
-///
-///   There can be at most one annotation attached per statement.
-///
-///   Annotations must not be repeated.
-template <typename AnalysisT>
-llvm::Error checkDataflow(
-    llvm::StringRef Code, llvm::StringRef TargetFun,
-    std::function<AnalysisT(ASTContext &, Environment &)> MakeAnalysis,
-    std::function<void(
-        llvm::ArrayRef<std::pair<
-            std::string, DataflowAnalysisState<typename AnalysisT::Lattice>>>,
-        ASTContext &)>
-        VerifyResults,
-    ArrayRef<std::string> Args,
-    const tooling::FileContentMappings &VirtualMappedFiles = {}) {
-  return checkDataflow<AnalysisT>(
-      Code, ast_matchers::hasName(TargetFun), std::move(MakeAnalysis),
-      std::move(VerifyResults), Args, VirtualMappedFiles);
-}
-
 /// Returns the `ValueDecl` for the given identifier.
 ///
 /// Requirements: