[PATCH] D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 12:48:21 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
ymandel marked 2 inline comments as done.
Closed by commit rGe0aefb4f9278: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis… (authored by ymandel).

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,15 @@
   return BlockStates;
 }
 
+/// Abstract base class for dataflow "models": reusable analysis components that
+/// model a particular aspect of program semantics in the `Environment`. For
+/// example, a model may capture a type and its related functions.
+class DataflowModel : public Environment::ValueModel {
+public:
+  /// Return value indicates whether the model processed the `Stmt`.
+  virtual bool transfer(const Stmt *Stmt, Environment &Env) = 0;
+};
+
 } // namespace dataflow
 } // namespace clang
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121796.415941.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220316/20f50bf6/attachment.bin>


More information about the cfe-commits mailing list