class SymbolReaper
Declaration
class SymbolReaper { /* full declaration omitted */ };
Description
A class responsible for cleaning up unused symbols.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:572
Member Variables
- private clang::ento::SymbolReaper::SymbolMapTy TheLiving
- private clang::ento::SymbolReaper::SymbolSetTy MetadataInUse
- private clang::ento::SymbolReaper::RegionSetTy RegionRoots
- private const clang::StackFrameContext* LCtx
- private const clang::Stmt* Loc
- private clang::ento::SymbolManager& SymMgr
- private clang::ento::StoreRef reapedStore
- private llvm::DenseMap<const MemRegion*, unsigned int> includedRegionCache
Method Overview
- public SymbolReaper(const clang::StackFrameContext * Ctx, const clang::Stmt * s, clang::ento::SymbolManager & symmgr, clang::ento::StoreManager & storeMgr)
- public const clang::LocationContext * getLocationContext() const
- public bool isDead(clang::ento::SymbolRef sym)
- public bool isLive(clang::ento::SymbolRef sym)
- public bool isLive(const clang::Expr * ExprVal, const clang::LocationContext * LCtx) const
- public bool isLive(const clang::ento::VarRegion * VR, bool includeStoreBindings = false) const
- public bool isLiveRegion(const clang::ento::MemRegion * region)
- private void markDependentsLive(clang::ento::SymbolRef sym)
- public void markElementIndicesLive(const clang::ento::MemRegion * region)
- public void markInUse(clang::ento::SymbolRef sym)
- public void markLive(clang::ento::SymbolRef sym)
- public void markLive(const clang::ento::MemRegion * region)
- public clang::ento::SymbolReaper::region_iterator region_begin() const
- public clang::ento::SymbolReaper::region_iterator region_end() const
- public void setReapedStore(clang::ento::StoreRef st)
Methods
¶SymbolReaper(const clang::StackFrameContext* Ctx,
const clang::Stmt* s,
clang::ento::SymbolManager& symmgr,
clang::ento::StoreManager& storeMgr)
SymbolReaper(const clang::StackFrameContext* Ctx,
const clang::Stmt* s,
clang::ento::SymbolManager& symmgr,
clang::ento::StoreManager& storeMgr)
Description
Construct a reaper object, which removes everything which is not live before we execute statement s in the given location context. If the statement is NULL, everything is this and parent contexts is considered live. If the stack frame context is NULL, everything on stack is considered dead.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:601
Parameters
- const clang::StackFrameContext* Ctx
- const clang::Stmt* s
- clang::ento::SymbolManager& symmgr
- clang::ento::StoreManager& storeMgr
¶const clang::LocationContext* getLocationContext()
const
const clang::LocationContext* getLocationContext()
const
Description
It might return null.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:606
¶bool isDead(clang::ento::SymbolRef sym)
bool isDead(clang::ento::SymbolRef sym)
Description
Returns whether or not a symbol has been confirmed dead. This should only be called once all marking of dead symbols has completed. (For checkers, this means only in the checkDeadSymbols callback.)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:638
Parameters
¶bool isLive(clang::ento::SymbolRef sym)
bool isLive(clang::ento::SymbolRef sym)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:608
Parameters
¶bool isLive(
const clang::Expr* ExprVal,
const clang::LocationContext* LCtx) const
bool isLive(
const clang::Expr* ExprVal,
const clang::LocationContext* LCtx) const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:610
Parameters
- const clang::Expr* ExprVal
- const clang::LocationContext* LCtx
¶bool isLive(
const clang::ento::VarRegion* VR,
bool includeStoreBindings = false) const
bool isLive(
const clang::ento::VarRegion* VR,
bool includeStoreBindings = false) const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:611
Parameters
- const clang::ento::VarRegion* VR
- bool includeStoreBindings = false
¶bool isLiveRegion(
const clang::ento::MemRegion* region)
bool isLiveRegion(
const clang::ento::MemRegion* region)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:609
Parameters
- const clang::ento::MemRegion* region
¶void markDependentsLive(
clang::ento::SymbolRef sym)
void markDependentsLive(
clang::ento::SymbolRef sym)
Description
Mark the symbols dependent on the input symbol as live.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:651
Parameters
¶void markElementIndicesLive(
const clang::ento::MemRegion* region)
void markElementIndicesLive(
const clang::ento::MemRegion* region)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:643
Parameters
- const clang::ento::MemRegion* region
¶void markInUse(clang::ento::SymbolRef sym)
void markInUse(clang::ento::SymbolRef sym)
Description
Marks a symbol as important to a checker. For metadata symbols, this will keep the symbol alive as long as its associated region is also live. For other symbols, this has no effect; checkers are not permitted to influence the life of other symbols. This should be used before any symbol marking has occurred, i.e. in the MarkLiveSymbols callback.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:627
Parameters
¶void markLive(clang::ento::SymbolRef sym)
void markLive(clang::ento::SymbolRef sym)
Description
Unconditionally marks a symbol as live. This should never be used by checkers, only by the state infrastructure such as the store and environment. Checkers should instead use metadata symbols and markInUse.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:618
Parameters
¶void markLive(
const clang::ento::MemRegion* region)
void markLive(
const clang::ento::MemRegion* region)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:642
Parameters
- const clang::ento::MemRegion* region
¶clang::ento::SymbolReaper::region_iterator
region_begin() const
clang::ento::SymbolReaper::region_iterator
region_begin() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:631
¶clang::ento::SymbolReaper::region_iterator
region_end() const
clang::ento::SymbolReaper::region_iterator
region_end() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:632
¶void setReapedStore(clang::ento::StoreRef st)
void setReapedStore(clang::ento::StoreRef st)
Description
Set to the value of the symbolic store after StoreManager::removeDeadBindings has been called.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h:647