clang 22.0.0git
Public Member Functions | List of all members
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 AssignOriginFact &F)
 The destination origin's loan set is replaced by the source's.
 
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 &)
 
Lattice transfer (Lattice In, const ExpireFact &)
 
Lattice transfer (Lattice In, const AssignOriginFact &)
 
Lattice transfer (Lattice In, const ReturnOfOriginFact &)
 
Lattice transfer (Lattice In, const UseFact &)
 
Lattice transfer (Lattice In, const TestPointFact &)
 

Additional Inherited Members

- Public Types inherited from clang::lifetimes::internal::DataflowAnalysis< LoanPropagationAnalysis, LoanPropagationLattice, Direction::Forward >
using Lattice = LoanPropagationLattice
 
using Base = DataflowAnalysis< LoanPropagationAnalysis, Lattice, Dir >
 
- 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 840 of file LifetimeSafety.cpp.

Constructor & Destructor Documentation

◆ LoanPropagationAnalysis()

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

Definition at line 847 of file LifetimeSafety.cpp.

Member Function Documentation

◆ getAnalysisName()

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

Definition at line 855 of file LifetimeSafety.cpp.

◆ getInitialState()

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

Definition at line 857 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 861 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 AssignOriginFact F 
)
inline

The destination origin's loan set is replaced by the source's.

This implicitly "resets" the old loans of the destination.

Definition at line 881 of file LifetimeSafety.cpp.

References clang::lifetimes::internal::AssignOriginFact::getDestOriginID(), getLoans(), and clang::lifetimes::internal::AssignOriginFact::getSrcOriginID().

◆ transfer() [2/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 871 of file LifetimeSafety.cpp.

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


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