Skip to content

Commit 9474709

Browse files
committed
[clang][dataflow] Remove deprecated transfer(const Stmt *, ...) API.
Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D134318
1 parent 7241b19 commit 9474709

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <vector>
2121

2222
#include "clang/AST/ASTContext.h"
23-
#include "clang/AST/Stmt.h"
2423
#include "clang/Analysis/CFG.h"
2524
#include "clang/Analysis/FlowSensitive/ControlFlowContext.h"
2625
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
@@ -33,17 +32,6 @@
3332
namespace clang {
3433
namespace dataflow {
3534

36-
template <typename AnalysisT, typename LatticeT, typename InputT,
37-
typename = std::void_t<>>
38-
struct HasTransferFor : std::false_type {};
39-
40-
template <typename AnalysisT, typename LatticeT, typename InputT>
41-
struct HasTransferFor<
42-
AnalysisT, LatticeT, InputT,
43-
std::void_t<decltype(std::declval<AnalysisT>().transfer(
44-
std::declval<const InputT *>(), std::declval<LatticeT &>(),
45-
std::declval<Environment &>()))>> : std::true_type {};
46-
4735
/// Base class template for dataflow analyses built on a single lattice type.
4836
///
4937
/// Requirements:
@@ -110,17 +98,7 @@ class DataflowAnalysis : public TypeErasedDataflowAnalysis {
11098
void transferTypeErased(const CFGElement *Element, TypeErasedLattice &E,
11199
Environment &Env) final {
112100
Lattice &L = llvm::any_cast<Lattice &>(E.Value);
113-
if constexpr (HasTransferFor<Derived, LatticeT, CFGElement>::value) {
114-
static_cast<Derived *>(this)->transfer(Element, L, Env);
115-
}
116-
117-
// FIXME: Remove after users have been updated to implement `transfer` on
118-
// `CFGElement`.
119-
if constexpr (HasTransferFor<Derived, LatticeT, Stmt>::value) {
120-
if (auto Stmt = Element->getAs<CFGStmt>()) {
121-
static_cast<Derived *>(this)->transfer(Stmt->getStmt(), L, Env);
122-
}
123-
}
101+
static_cast<Derived *>(this)->transfer(Element, L, Env);
124102
}
125103

126104
private:

0 commit comments

Comments
 (0)