From: Wei Yi Tee Date: Wed, 21 Sep 2022 09:01:00 +0000 (+0000) Subject: [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`. X-Git-Tag: upstream/17.0.6~32915 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=003566cb1faec315f86e69f57da3998ff3f922aa;p=platform%2Fupstream%2Fllvm.git [clang][dataflow] Remove deprecated overloads of `checkDataflow` in `TestingSupport.h`. Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D134081 --- diff --git a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h index 7ea51d8..909a475 100644 --- a/clang/unittests/Analysis/FlowSensitive/TestingSupport.h +++ b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h @@ -356,97 +356,6 @@ checkDataflow(AnalysisInputs 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 -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: