[clang] 9474709 - [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.
Wei Yi Tee via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 21 04:06:52 PDT 2022
Author: Wei Yi Tee
Date: 2022-09-21T11:06:21Z
New Revision: 94747094c782d8a45b61414717df8308f8a25919
URL: https://github.com/llvm/llvm-project/commit/94747094c782d8a45b61414717df8308f8a25919
DIFF: https://github.com/llvm/llvm-project/commit/94747094c782d8a45b61414717df8308f8a25919.diff
LOG: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D134318
Added:
Modified:
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
Removed:
################################################################################
diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
index cbd20ad9ee568..6184f22f786c7 100644
--- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
+++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
@@ -20,7 +20,6 @@
#include <vector>
#include "clang/AST/ASTContext.h"
-#include "clang/AST/Stmt.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/FlowSensitive/ControlFlowContext.h"
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
@@ -33,17 +32,6 @@
namespace clang {
namespace dataflow {
-template <typename AnalysisT, typename LatticeT, typename InputT,
- typename = std::void_t<>>
-struct HasTransferFor : std::false_type {};
-
-template <typename AnalysisT, typename LatticeT, typename InputT>
-struct HasTransferFor<
- AnalysisT, LatticeT, InputT,
- std::void_t<decltype(std::declval<AnalysisT>().transfer(
- std::declval<const InputT *>(), std::declval<LatticeT &>(),
- std::declval<Environment &>()))>> : std::true_type {};
-
/// Base class template for dataflow analyses built on a single lattice type.
///
/// Requirements:
@@ -110,17 +98,7 @@ class DataflowAnalysis : public TypeErasedDataflowAnalysis {
void transferTypeErased(const CFGElement *Element, TypeErasedLattice &E,
Environment &Env) final {
Lattice &L = llvm::any_cast<Lattice &>(E.Value);
- if constexpr (HasTransferFor<Derived, LatticeT, CFGElement>::value) {
- static_cast<Derived *>(this)->transfer(Element, L, Env);
- }
-
- // FIXME: Remove after users have been updated to implement `transfer` on
- // `CFGElement`.
- if constexpr (HasTransferFor<Derived, LatticeT, Stmt>::value) {
- if (auto Stmt = Element->getAs<CFGStmt>()) {
- static_cast<Derived *>(this)->transfer(Stmt->getStmt(), L, Env);
- }
- }
+ static_cast<Derived *>(this)->transfer(Element, L, Env);
}
private:
More information about the cfe-commits
mailing list