clang 22.0.0git
clang::lifetimes::internal::LiveOriginAnalysis Class Reference

The analysis that tracks which origins are live, with granular information about the causing use fact and confidence level. More...

Inheritance diagram for clang::lifetimes::internal::LiveOriginAnalysis:
[legend]

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< LatticegetInState (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 >
FactManagerAllFacts

Detailed Description

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.

Constructor & Destructor Documentation

◆ LiveOriginAnalysis()

clang::lifetimes::internal::LiveOriginAnalysis::LiveOriginAnalysis ( const CFG & C,
AnalysisDeclContext & AC,
FactManager & F,
LivenessMap::Factory & SF )
inline

Member Function Documentation

◆ dump()

◆ getAnalysisName()

StringRef clang::lifetimes::internal::LiveOriginAnalysis::getAnalysisName ( ) const
inline

Definition at line 1250 of file LifetimeSafety.cpp.

Referenced by dump().

◆ getInitialState()

Lattice clang::lifetimes::internal::LiveOriginAnalysis::getInitialState ( )
inline

Definition at line 1252 of file LifetimeSafety.cpp.

◆ getLiveOrigins()

◆ join()

Lattice clang::lifetimes::internal::LiveOriginAnalysis::join ( Lattice L1,
Lattice L2 ) const
inline

◆ transfer() [1/3]

Lattice clang::lifetimes::internal::LiveOriginAnalysis::transfer ( Lattice In,
const IssueFact & IF )
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().

◆ transfer() [2/3]

Lattice clang::lifetimes::internal::LiveOriginAnalysis::transfer ( Lattice In,
const OriginFlowFact & OF )
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().

◆ transfer() [3/3]

Lattice clang::lifetimes::internal::LiveOriginAnalysis::transfer ( Lattice In,
const UseFact & UF )
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.


The documentation for this class was generated from the following file: