clang 22.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir > Class Template Reference

A generic, policy-based driver for dataflow analyses. More...

Inheritance diagram for clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >:
[legend]

Public Types

using Lattice = LatticeType
 
using Base = DataflowAnalysis< Derived, Lattice, Dir >
 

Public Member Functions

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 &)
 

Protected Member Functions

 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

FactManagerAllFacts
 

Detailed Description

template<typename Derived, typename LatticeType, Direction Dir>
class clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >

A generic, policy-based driver for dataflow analyses.

It combines the dataflow runner and the transferer logic into a single class hierarchy.

The derived class is expected to provide:

Template Parameters
DerivedThe CRTP derived class that implements the specific analysis.
LatticeTypeThe dataflow lattice used by the analysis.
DirThe direction of the analysis (Forward or Backward). TODO: Maybe use the dataflow framework! The framework might need changes to support the current comparison done at block-entry.

Definition at line 608 of file LifetimeSafety.cpp.

Member Typedef Documentation

◆ Base

template<typename Derived , typename LatticeType , Direction Dir>
using clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::Base = DataflowAnalysis<Derived, Lattice, Dir>

Definition at line 611 of file LifetimeSafety.cpp.

◆ Lattice

template<typename Derived , typename LatticeType , Direction Dir>
using clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::Lattice = LatticeType

Definition at line 610 of file LifetimeSafety.cpp.

Constructor & Destructor Documentation

◆ DataflowAnalysis()

template<typename Derived , typename LatticeType , Direction Dir>
clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::DataflowAnalysis ( const CFG C,
AnalysisDeclContext AC,
FactManager F 
)
inlineexplicitprotected

Definition at line 631 of file LifetimeSafety.cpp.

Member Function Documentation

◆ dump()

template<typename Derived , typename LatticeType , Direction Dir>
void clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::dump ( ) const
inlineprotected

◆ getInState()

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::getInState ( const CFGBlock B) const
inlineprotected

◆ getOutState()

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::getOutState ( const CFGBlock B) const
inlineprotected

◆ getState()

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::getState ( ProgramPoint  P) const
inlineprotected

Definition at line 673 of file LifetimeSafety.cpp.

References P.

◆ run()

template<typename Derived , typename LatticeType , Direction Dir>
void clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::run ( )
inline

◆ transfer() [1/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const AssignOriginFact  
)
inline

Definition at line 731 of file LifetimeSafety.cpp.

◆ transfer() [2/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const ExpireFact  
)
inline

Definition at line 730 of file LifetimeSafety.cpp.

◆ transfer() [3/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const IssueFact  
)
inline

Definition at line 729 of file LifetimeSafety.cpp.

◆ transfer() [4/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const ReturnOfOriginFact  
)
inline

Definition at line 732 of file LifetimeSafety.cpp.

◆ transfer() [5/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const TestPointFact  
)
inline

Definition at line 734 of file LifetimeSafety.cpp.

◆ transfer() [6/6]

template<typename Derived , typename LatticeType , Direction Dir>
Lattice clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::transfer ( Lattice  In,
const UseFact  
)
inline

Definition at line 733 of file LifetimeSafety.cpp.

Member Data Documentation

◆ AllFacts

template<typename Derived , typename LatticeType , Direction Dir>
FactManager& clang::lifetimes::internal::DataflowAnalysis< Derived, LatticeType, Dir >::AllFacts
protected

Definition at line 629 of file LifetimeSafety.cpp.


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