diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -136,6 +136,26 @@ return BlockStates; } +/// Virtual 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 _modeling_ a particular aspect of program +/// semantics -- for example, a type and its related functions, and should be +/// composable with other models over the same lattice. +/// +/// c) Models do not provide an initial element -- that is the responsibility of +/// the analysis. +template +class DataflowModel : public Environment::ValueModel { +public: + virtual void transfer(const Stmt *Stmt, Lattice &L, Environment &Env) = 0; +}; + } // namespace dataflow } // namespace clang