[all-commits] [llvm/llvm-project] 752e31: [LifetimeSafety] Make the dataflow analysis generi...
Utkarsh Saxena via All-commits
all-commits at lists.llvm.org
Wed Jul 16 07:20:13 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 752e31c27c0d2888e23db9db63dedc316dbaa1a4
https://github.com/llvm/llvm-project/commit/752e31c27c0d2888e23db9db63dedc316dbaa1a4
Author: Utkarsh Saxena <usx at google.com>
Date: 2025-07-16 (Wed, 16 Jul 2025)
Changed paths:
M clang/lib/Analysis/LifetimeSafety.cpp
M clang/test/Sema/warn-lifetime-safety-dataflow.cpp
Log Message:
-----------
[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](https://github.com/llvm/llvm-project/pull/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!
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list