ymandel updated this revision to Diff 415817.
ymandel added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121796

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
@@ -136,6 +136,29 @@
   return BlockStates;
 }
 
+/// Abstract base class for dataflow "models": reusable analysis components 
that
+/// model a particular aspect of program semantics, with respect to a specific
+/// lattice. Models are very similar to analyses, except:
+///
+/// a) Models implement a typed dynamic (that is, virtual) interface (with
+///    respect to the lattice type), while analyses implement an untyped 
dynamic
+///    interface.
+///
+/// b) Models should focus on a _particular_ aspect of program semantics -- for
+///    example, a type and its related functions. FIXME: determine how models
+///    should relate to each other -- that is, how they should compose. Open
+///    questions include: Do we want to enable composition of models that have
+///    different lattice types? Do we want to support models with no lattices
+///    that only use the Environment?
+///
+/// c) Models do not provide an initial element -- that is the responsibility 
of
+///    the analysis.
+template <typename LatticeT>
+class DataflowModel : public Environment::ValueModel {
+public:
+  virtual void transfer(const Stmt *Stmt, LatticeT &L, Environment &Env) = 0;
+};
+
 } // namespace dataflow
 } // namespace clang
 


Index: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
+++ clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
@@ -136,6 +136,29 @@
   return BlockStates;
 }
 
+/// Abstract base class for dataflow "models": reusable analysis components that
+/// model a particular aspect of program semantics, with respect to a specific
+/// lattice. Models are very similar to analyses, except:
+///
+/// a) Models implement a typed dynamic (that is, virtual) interface (with
+///    respect to the lattice type), while analyses implement an untyped dynamic
+///    interface.
+///
+/// b) Models should focus on a _particular_ aspect of program semantics -- for
+///    example, a type and its related functions. FIXME: determine how models
+///    should relate to each other -- that is, how they should compose. Open
+///    questions include: Do we want to enable composition of models that have
+///    different lattice types? Do we want to support models with no lattices
+///    that only use the Environment?
+///
+/// c) Models do not provide an initial element -- that is the responsibility of
+///    the analysis.
+template <typename LatticeT>
+class DataflowModel : public Environment::ValueModel {
+public:
+  virtual void transfer(const Stmt *Stmt, LatticeT &L, Environment &Env) = 0;
+};
+
 } // namespace dataflow
 } // namespace clang
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to