clang 17.0.0git
|
A class responsible for cleaning up unused symbols. More...
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
Public Types | |
using | region_iterator = RegionSetTy::const_iterator |
Public Member Functions | |
SymbolReaper (const StackFrameContext *Ctx, const Stmt *s, SymbolManager &symmgr, StoreManager &storeMgr) | |
Construct a reaper object, which removes everything which is not live before we execute statement s in the given location context. | |
const LocationContext * | getLocationContext () const |
It might return null. | |
bool | isLive (SymbolRef sym) |
bool | isLiveRegion (const MemRegion *region) |
bool | isLive (const Expr *ExprVal, const LocationContext *LCtx) const |
bool | isLive (const VarRegion *VR, bool includeStoreBindings=false) const |
void | markLive (SymbolRef sym) |
Unconditionally marks a symbol as live. | |
void | markInUse (SymbolRef sym) |
Marks a symbol as important to a checker. | |
region_iterator | region_begin () const |
region_iterator | region_end () const |
bool | isDead (SymbolRef sym) |
Returns whether or not a symbol has been confirmed dead. | |
void | markLive (const MemRegion *region) |
void | markLazilyCopied (const MemRegion *region) |
void | markElementIndicesLive (const MemRegion *region) |
void | setReapedStore (StoreRef st) |
Set to the value of the symbolic store after StoreManager::removeDeadBindings has been called. | |
A class responsible for cleaning up unused symbols.
Definition at line 572 of file SymbolManager.h.
using clang::ento::SymbolReaper::region_iterator = RegionSetTy::const_iterator |
Definition at line 634 of file SymbolManager.h.
|
inline |
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.
Definition at line 606 of file SymbolManager.h.
|
inline |
It might return null.
Definition at line 611 of file SymbolManager.h.
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.)
Definition at line 643 of file SymbolManager.h.
References isLive().
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkDeadSymbols(), and clang::ento::SMTConstraintManager::removeDeadBindings().
bool SymbolReaper::isLive | ( | const Expr * | ExprVal, |
const LocationContext * | LCtx | ||
) | const |
Definition at line 521 of file SymbolManager.cpp.
Definition at line 541 of file SymbolManager.cpp.
References clang::ento::VarRegion::getDecl(), clang::LocationContext::getStackFrame(), clang::ento::VarRegion::getStackFrame(), clang::LiveVariables::isLive(), and clang::LocationContext::isParentOf().
Definition at line 469 of file SymbolManager.cpp.
References clang::ento::SymExpr::getKind().
Referenced by isDead(), and clang::ento::EnvironmentManager::removeDeadBindings().
Definition at line 438 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion().
Referenced by clang::ento::mpi::MPIChecker::checkMissingWaits().
void SymbolReaper::markElementIndicesLive | ( | const MemRegion * | region | ) |
Definition at line 422 of file SymbolManager.cpp.
References clang::ento::SVal::symbol_begin(), and clang::ento::SVal::symbol_end().
void SymbolReaper::markInUse | ( | SymbolRef | sym | ) |
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.
Definition at line 433 of file SymbolManager.cpp.
void SymbolReaper::markLazilyCopied | ( | const MemRegion * | region | ) |
Definition at line 418 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion().
void SymbolReaper::markLive | ( | const MemRegion * | region | ) |
Definition at line 413 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion().
void SymbolReaper::markLive | ( | SymbolRef | sym | ) |
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.
Definition at line 408 of file SymbolManager.cpp.
Referenced by clang::ento::ExprEngine::removeDead().
|
inline |
Definition at line 636 of file SymbolManager.h.
|
inline |
Definition at line 637 of file SymbolManager.h.
|
inline |
Set to the value of the symbolic store after StoreManager::removeDeadBindings has been called.
Definition at line 653 of file SymbolManager.h.
Referenced by clang::ento::ProgramStateManager::removeDeadBindingsFromEnvironmentAndStore().