Skip to content

Commit e0aefb4

Browse files
committed
[clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.
This patch introduces `DataflowModel`, an abstract base class for dataflow "models": reusable analysis components that model a particular aspect of program semantics. Differential Revision: https://reviews.llvm.org/D121796
1 parent 4001b82 commit e0aefb4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ runDataflowAnalysis(const ControlFlowContext &CFCtx, AnalysisT &Analysis,
136136
return BlockStates;
137137
}
138138

139+
/// Abstract base class for dataflow "models": reusable analysis components that
140+
/// model a particular aspect of program semantics in the `Environment`. For
141+
/// example, a model may capture a type and its related functions.
142+
class DataflowModel : public Environment::ValueModel {
143+
public:
144+
/// Return value indicates whether the model processed the `Stmt`.
145+
virtual bool transfer(const Stmt *Stmt, Environment &Env) = 0;
146+
};
147+
139148
} // namespace dataflow
140149
} // namespace clang
141150

0 commit comments

Comments
 (0)