[PATCH] D134318: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.
weiyi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 20 14:41:23 PDT 2022
wyt created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
wyt requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134318
Files:
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
Index: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
+++ 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 @@
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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134318.461716.patch
Type: text/x-patch
Size: 1910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220920/dc3ef4c2/attachment-0001.bin>
More information about the cfe-commits
mailing list