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

The analysis that tracks which loans belong to which origins. More...

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

Public Member Functions

 LoanPropagationAnalysis (const CFG &C, AnalysisDeclContext &AC, FactManager &F, LifetimeFactory &LFactory)
StringRef getAnalysisName () const
Lattice getInitialState ()
Lattice join (Lattice A, Lattice B)
 Merges two lattices by taking the union of loans for each origin.
Lattice transfer (Lattice In, const IssueFact &F)
 A new loan is issued to the origin. Old loans are erased.
Lattice transfer (Lattice In, const OriginFlowFact &F)
 A flow from source to destination.
LoanSet getLoans (OriginID OID, ProgramPoint P)
Public Member Functions inherited from clang::lifetimes::internal::DataflowAnalysis< LoanPropagationAnalysis, LoanPropagationLattice, Direction::Forward >
void run ()
Lattice transfer (Lattice In, const IssueFact &)

Additional Inherited Members

Public Types inherited from clang::lifetimes::internal::DataflowAnalysis< LoanPropagationAnalysis, LoanPropagationLattice, Direction::Forward >
using Lattice
using Base
Protected Member Functions inherited from clang::lifetimes::internal::DataflowAnalysis< LoanPropagationAnalysis, LoanPropagationLattice, Direction::Forward >
 DataflowAnalysis (const CFG &C, AnalysisDeclContext &AC, FactManager &F)
Lattice getState (ProgramPoint P) const
Lattice getInState (const CFGBlock *B) const
Lattice getOutState (const CFGBlock *B) const
void dump () const
Protected Attributes inherited from clang::lifetimes::internal::DataflowAnalysis< LoanPropagationAnalysis, LoanPropagationLattice, Direction::Forward >
FactManagerAllFacts

Detailed Description

The analysis that tracks which loans belong to which origins.

Definition at line 1068 of file LifetimeSafety.cpp.

Constructor & Destructor Documentation

◆ LoanPropagationAnalysis()

clang::lifetimes::internal::LoanPropagationAnalysis::LoanPropagationAnalysis ( const CFG & C,
AnalysisDeclContext & AC,
FactManager & F,
LifetimeFactory & LFactory )
inline

Member Function Documentation

◆ getAnalysisName()

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

Definition at line 1083 of file LifetimeSafety.cpp.

◆ getInitialState()

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

Definition at line 1085 of file LifetimeSafety.cpp.

◆ getLoans()

LoanSet clang::lifetimes::internal::LoanPropagationAnalysis::getLoans ( OriginID OID,
ProgramPoint P )
inline

◆ join()

Lattice clang::lifetimes::internal::LoanPropagationAnalysis::join ( Lattice A,
Lattice B )
inline

Merges two lattices by taking the union of loans for each origin.

Definition at line 1089 of file LifetimeSafety.cpp.

References clang::lifetimes::internal::utils::join(), and clang::lifetimes::internal::LoanPropagationLattice::Origins.

◆ transfer() [1/2]

Lattice clang::lifetimes::internal::LoanPropagationAnalysis::transfer ( Lattice In,
const IssueFact & F )
inline

A new loan is issued to the origin. Old loans are erased.

Definition at line 1099 of file LifetimeSafety.cpp.

References clang::lifetimes::internal::IssueFact::getLoanID(), and clang::lifetimes::internal::IssueFact::getOriginID().

◆ transfer() [2/2]

Lattice clang::lifetimes::internal::LoanPropagationAnalysis::transfer ( Lattice In,
const OriginFlowFact & F )
inline

A flow from source to destination.

If KillDest is true, this replaces the destination's loans with the source's. Otherwise, the source's loans are merged into the destination's.

Definition at line 1110 of file LifetimeSafety.cpp.

References clang::lifetimes::internal::OriginFlowFact::getDestOriginID(), clang::lifetimes::internal::OriginFlowFact::getKillDest(), getLoans(), clang::lifetimes::internal::OriginFlowFact::getSrcOriginID(), and clang::lifetimes::internal::utils::join().


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