clang 22.0.0git
|
The analysis that tracks which origins are live, with granular information about the causing use fact and confidence level. More...
Public Member Functions | |
LiveOriginAnalysis (const CFG &C, AnalysisDeclContext &AC, FactManager &F, LivenessMap::Factory &SF) | |
StringRef | getAnalysisName () const |
Lattice | getInitialState () |
Lattice | join (Lattice L1, Lattice L2) const |
Merges two lattices by combining liveness information. | |
Lattice | transfer (Lattice In, const UseFact &UF) |
A read operation makes the origin live with definite confidence, as it dominates this program point. | |
Lattice | transfer (Lattice In, const IssueFact &IF) |
Issuing a new loan to an origin kills its liveness. | |
Lattice | transfer (Lattice In, const OriginFlowFact &OF) |
An OriginFlow kills the liveness of the destination origin if KillDest is true. | |
LivenessMap | getLiveOrigins (ProgramPoint P) const |
void | dump (llvm::raw_ostream &OS, const LifetimeSafetyAnalysis &LSA) const |
Public Member Functions inherited from clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward > | |
void | run () |
Lattice | transfer (Lattice In, const IssueFact &) |
Additional Inherited Members | |
Public Types inherited from clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward > | |
using | Lattice |
using | Base |
Protected Member Functions inherited from clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward > | |
DataflowAnalysis (const CFG &C, AnalysisDeclContext &AC, FactManager &F) | |
Lattice | getState (ProgramPoint P) const |
std::optional< Lattice > | getInState (const CFGBlock *B) const |
Lattice | getOutState (const CFGBlock *B) const |
void | dump () const |
Protected Attributes inherited from clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward > | |
FactManager & | AllFacts |
The analysis that tracks which origins are live, with granular information about the causing use fact and confidence level.
This is a backward analysis.
Definition at line 1237 of file LifetimeSafety.cpp.
|
inline |
Definition at line 1244 of file LifetimeSafety.cpp.
References clang::C, and clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward >::DataflowAnalysis().
|
inline |
Definition at line 1323 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::LivenessLattice::dump(), getAnalysisName(), clang::lifetimes::internal::DataflowAnalysis< LiveOriginAnalysis, LivenessLattice, Direction::Backward >::getState(), and clang::lifetimes::internal::LifetimeSafetyAnalysis::getTestPoints().
|
inline |
Definition at line 1250 of file LifetimeSafety.cpp.
Referenced by dump().
|
inline |
Definition at line 1252 of file LifetimeSafety.cpp.
|
inline |
|
inline |
Merges two lattices by combining liveness information.
When the same origin has different confidence levels, we take the lower one.
Definition at line 1257 of file LifetimeSafety.cpp.
References clang::lifetimes::Dead, clang::Expr::getExprLoc(), clang::lifetimes::internal::UseFact::getUseExpr(), clang::lifetimes::internal::utils::join(), clang::lifetimes::internal::LivenessLattice::LiveOrigins, clang::lifetimes::Maybe, clang::lifetimes::Must, and clang::lifetimes::internal::utils::Symmetric.
|
inline |
Issuing a new loan to an origin kills its liveness.
Definition at line 1306 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::IssueFact::getOriginID().
|
inline |
An OriginFlow kills the liveness of the destination origin if KillDest is true.
Otherwise, it propagates liveness from destination to source.
Definition at line 1312 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::OriginFlowFact::getDestOriginID(), and clang::lifetimes::internal::OriginFlowFact::getKillDest().
|
inline |
A read operation makes the origin live with definite confidence, as it dominates this program point.
A write operation kills the liveness of the origin since it overwrites the value.
Definition at line 1295 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::UseFact::getUsedOrigin(), clang::lifetimes::internal::UseFact::isWritten(), and clang::lifetimes::Must.