[PATCH] D134318: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API.

weiyi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 04:06:59 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG94747094c782: [clang][dataflow] Remove deprecated `transfer(const Stmt *, ...)` API. (authored by wyt).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134318/new/

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.461844.patch
Type: text/x-patch
Size: 1910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220921/58767da9/attachment.bin>


More information about the cfe-commits mailing list