Skip to content

Commit 752e31c

Browse files
authored
[LifetimeSafety] Make the dataflow analysis generic (#148222)
Refactored the lifetime safety analysis to use a generic dataflow framework with a policy-based design. ### Changes - Introduced a generic `DataflowAnalysis` template class that can be specialized for different analyses - Renamed `LifetimeLattice` to `LoanPropagationLattice` to better reflect its purpose - Created a `LoanPropagationAnalysis` class that inherits from the generic framework - Moved transfer functions from the standalone `Transferer` class into the analysis class - Restructured the code to separate the dataflow engine from the specific analysis logic - Updated debug output and test expectations to use the new class names ### Motivation In order to add more analyses, e.g. [loan expiry](#148712) and origin liveness, the previous implementation would have separate, nearly identical dataflow runners for each analysis. This change creates a single, reusable component, which will make it much simpler to add subsequent analyses without repeating boilerplate code. This is quite close to the existing dataflow framework!
1 parent a944e86 commit 752e31c

File tree

2 files changed

+233
-192
lines changed

2 files changed

+233
-192
lines changed

0 commit comments

Comments
 (0)