clang 24.0.0git
clang::lifetimes::internal::FactManager Class Reference

#include "clang/Analysis/Analyses/LifetimeSafety/Facts.h"

Public Member Functions

 FactManager (const AnalysisDeclContext &AC, const CFG &Cfg)
llvm::ArrayRef< const Fact * > getFacts (const CFGBlock *B) const
void addBlockFacts (const CFGBlock *B, llvm::ArrayRef< Fact * > NewFacts)
void appendBlockFact (const CFGBlock *B, const Fact *F)
template<typename FactType, typename... Args>
FactType * createFact (Args &&...args)
void dump (const CFG &Cfg, AnalysisDeclContext &AC, const LoanPropagationAnalysis *LPA=nullptr) const
llvm::StringMap< ProgramPoint > getTestPoints () const
 Retrieves program points that were specially marked in the source code for testing.
llvm::ArrayRef< const Fact * > getBlockContaining (ProgramPoint P) const
 Retrieves all the facts in the block containing Program Point P.
size_t getBlockID (ProgramPoint P) const
unsigned getNumFacts () const
const llvm::BitVector & getPersistentOrigins () const
 Returns the origins that are referenced from more than one basic block.
LoanManager & getLoanMgr ()
const LoanManager & getLoanMgr () const
OriginManager & getOriginMgr ()
const OriginManager & getOriginMgr () const
void addCapturedField (const FieldDecl *FD)
bool isFieldCapturedByLambda (const FieldDecl *FD) const
void setThisCapturedByLambda ()

Friends

class FactsGenerator

Detailed Description

Definition at line 342 of file Facts.h.

Constructor & Destructor Documentation

◆ FactManager()

clang::lifetimes::internal::FactManager::FactManager ( const AnalysisDeclContext & AC,
const CFG & Cfg )
inline

Definition at line 344 of file Facts.h.

References clang::CFG::getNumBlockIDs().

Member Function Documentation

◆ addBlockFacts()

void clang::lifetimes::internal::FactManager::addBlockFacts ( const CFGBlock * B,
llvm::ArrayRef< Fact * > NewFacts )
inline

Definition at line 352 of file Facts.h.

References clang::CFGBlock::getBlockID().

◆ addCapturedField()

void clang::lifetimes::internal::FactManager::addCapturedField ( const FieldDecl * FD)
inline

Definition at line 403 of file Facts.h.

◆ appendBlockFact()

void clang::lifetimes::internal::FactManager::appendBlockFact ( const CFGBlock * B,
const Fact * F )
inline

Definition at line 357 of file Facts.h.

References clang::CFGBlock::getBlockID().

◆ createFact()

template<typename FactType, typename... Args>
FactType * clang::lifetimes::internal::FactManager::createFact ( Args &&... args)
inline

Definition at line 362 of file Facts.h.

◆ dump()

void clang::lifetimes::internal::FactManager::dump ( const CFG & Cfg,
AnalysisDeclContext & AC,
const LoanPropagationAnalysis * LPA = nullptr ) const

◆ getBlockContaining()

llvm::ArrayRef< const Fact * > clang::lifetimes::internal::FactManager::getBlockContaining ( ProgramPoint P) const

Retrieves all the facts in the block containing Program Point P.

Note
This is intended for testing only.

Definition at line 230 of file Facts.cpp.

References getBlockID().

◆ getBlockID()

size_t clang::lifetimes::internal::FactManager::getBlockID ( ProgramPoint P) const

Definition at line 234 of file Facts.cpp.

Referenced by getBlockContaining().

◆ getFacts()

llvm::ArrayRef< const Fact * > clang::lifetimes::internal::FactManager::getFacts ( const CFGBlock * B) const
inline

Definition at line 348 of file Facts.h.

References clang::CFGBlock::getBlockID().

Referenced by dump().

◆ getLoanMgr() [1/2]

LoanManager & clang::lifetimes::internal::FactManager::getLoanMgr ( )
inline

◆ getLoanMgr() [2/2]

const LoanManager & clang::lifetimes::internal::FactManager::getLoanMgr ( ) const
inline

Definition at line 399 of file Facts.h.

◆ getNumFacts()

unsigned clang::lifetimes::internal::FactManager::getNumFacts ( ) const
inline

Definition at line 387 of file Facts.h.

◆ getOriginMgr() [1/2]

OriginManager & clang::lifetimes::internal::FactManager::getOriginMgr ( )
inline

Definition at line 400 of file Facts.h.

Referenced by clang::lifetimes::runLifetimeSafetyAnalysis().

◆ getOriginMgr() [2/2]

const OriginManager & clang::lifetimes::internal::FactManager::getOriginMgr ( ) const
inline

Definition at line 401 of file Facts.h.

◆ getPersistentOrigins()

const llvm::BitVector & clang::lifetimes::internal::FactManager::getPersistentOrigins ( ) const
inline

Returns the origins that are referenced from more than one basic block.

Only those need to survive block boundaries in the dataflow analyses; the rest are block-local.

Definition at line 392 of file Facts.h.

◆ getTestPoints()

llvm::StringMap< ProgramPoint > clang::lifetimes::internal::FactManager::getTestPoints ( ) const

Retrieves program points that were specially marked in the source code for testing.

The analysis recognizes special function calls of the form void("__lifetime_test_point_<name>") as test points. This method returns a map from the annotation string (<name>) to the corresponding ProgramPoint. This allows test harnesses to query the analysis state at user-defined locations in the code.

Note
This is intended for testing only.

Definition at line 195 of file Facts.cpp.

◆ isFieldCapturedByLambda()

bool clang::lifetimes::internal::FactManager::isFieldCapturedByLambda ( const FieldDecl * FD) const
inline

Definition at line 404 of file Facts.h.

◆ setThisCapturedByLambda()

void clang::lifetimes::internal::FactManager::setThisCapturedByLambda ( )
inline

Definition at line 407 of file Facts.h.

◆ FactsGenerator

friend class FactsGenerator
friend

Definition at line 414 of file Facts.h.

References FactsGenerator.

Referenced by FactsGenerator.


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