|
20 | 20 | #include <vector>
|
21 | 21 |
|
22 | 22 | #include "clang/AST/ASTContext.h"
|
23 |
| -#include "clang/AST/Stmt.h" |
24 | 23 | #include "clang/Analysis/CFG.h"
|
25 | 24 | #include "clang/Analysis/FlowSensitive/ControlFlowContext.h"
|
26 | 25 | #include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
|
|
33 | 32 | namespace clang {
|
34 | 33 | namespace dataflow {
|
35 | 34 |
|
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 |
| - |
47 | 35 | /// Base class template for dataflow analyses built on a single lattice type.
|
48 | 36 | ///
|
49 | 37 | /// Requirements:
|
@@ -110,17 +98,7 @@ class DataflowAnalysis : public TypeErasedDataflowAnalysis {
|
110 | 98 | void transferTypeErased(const CFGElement *Element, TypeErasedLattice &E,
|
111 | 99 | Environment &Env) final {
|
112 | 100 | 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); |
124 | 102 | }
|
125 | 103 |
|
126 | 104 | private:
|
|
0 commit comments