[clang] [LifetimeSafety] Add per-program-point lattice tracking (PR #149199)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 17 03:23:47 PDT 2025
================
@@ -524,14 +531,20 @@ template <typename Derived, typename LatticeType, Direction Dir>
class DataflowAnalysis {
public:
using Lattice = LatticeType;
- using Base = DataflowAnalysis<Derived, LatticeType, Dir>;
+ using Base = DataflowAnalysis<Derived, Lattice, Dir>;
private:
const CFG &Cfg;
AnalysisDeclContext &AC;
+ /// The dataflow state before a basic block is processed.
llvm::DenseMap<const CFGBlock *, Lattice> InStates;
+ /// The dataflow state after a basic block is processed.
llvm::DenseMap<const CFGBlock *, Lattice> OutStates;
+ /// The dataflow state at a Program Point.
+ /// In a forward analysis, this is the state after the Fact at that point has
+ /// been applied, while in a backward analysis, it is the state before.
+ llvm::DenseMap<ProgramPoint, Lattice> PerPointStates;
----------------
Xazax-hun wrote:
Ah never mind. Now I remember you want to keep these states instead of replaying the analysis for the blocks.
https://github.com/llvm/llvm-project/pull/149199
More information about the cfe-commits
mailing list