diff --git a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h --- a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h +++ b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h @@ -356,97 +356,6 @@ }); } -// 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 -llvm::Error checkDataflow( - llvm::StringRef Code, - ast_matchers::internal::Matcher TargetFuncMatcher, - std::function MakeAnalysis, - std::function>>, - ASTContext &)> - VerifyResults, - ArrayRef Args, - const tooling::FileContentMappings &VirtualMappedFiles = {}) { - return checkDataflow( - AnalysisInputs(Code, std::move(TargetFuncMatcher), - std::move(MakeAnalysis)) - .withASTBuildArgs(std::move(Args)) - .withASTBuildVirtualMappedFiles(std::move(VirtualMappedFiles)), - [&VerifyResults](const llvm::StringMap> &AnnotationStates, - const AnalysisOutputs &AO) { - std::vector>> - 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 -llvm::Error checkDataflow( - llvm::StringRef Code, llvm::StringRef TargetFun, - std::function MakeAnalysis, - std::function>>, - ASTContext &)> - VerifyResults, - ArrayRef Args, - const tooling::FileContentMappings &VirtualMappedFiles = {}) { - return checkDataflow( - Code, ast_matchers::hasName(TargetFun), std::move(MakeAnalysis), - std::move(VerifyResults), Args, VirtualMappedFiles); -} - /// Returns the `ValueDecl` for the given identifier. /// /// Requirements: