mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 20:20:54 +00:00
[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
This commit is contained in:
parent
4001b82b15
commit
e0aefb4f92
@ -136,6 +136,15 @@ runDataflowAnalysis(const ControlFlowContext &CFCtx, AnalysisT &Analysis,
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user