[clang] 003566c - [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`.

Wei Yi Tee via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 03:37:22 PDT 2022


Author: Wei Yi Tee
Date: 2022-09-21T10:36:44Z
New Revision: 003566cb1faec315f86e69f57da3998ff3f922aa

URL: https://github.com/llvm/llvm-project/commit/003566cb1faec315f86e69f57da3998ff3f922aa
DIFF: https://github.com/llvm/llvm-project/commit/003566cb1faec315f86e69f57da3998ff3f922aa.diff

LOG: [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`.

Reviewed By: gribozavr2

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

Added: 
    

Modified: 
    clang/unittests/Analysis/FlowSensitive/TestingSupport.h

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h
index 7ea51d83e25ed..909a475bbf9e1 100644
--- a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h
+++ b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h
@@ -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:


        


More information about the cfe-commits mailing list