|
clang 23.0.0git
|
A class responsible for cleaning up unused symbols. More...
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
Public Member Functions | |
| SymbolReaper (const StackFrame *SF, const Stmt *s, SymbolManager &symmgr, StoreManager &storeMgr) | |
| Construct a reaper object, which removes everything which is not live before we execute statements in the given stack frame. | |
| const StackFrame * | getStackFrame () const |
| It might return null. | |
| bool | isLive (SymbolRef sym) |
| bool | isLiveRegion (const MemRegion *region) |
| bool | isLive (const Expr *ExprVal, const StackFrame *SF) 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. | |
| llvm::iterator_range< RegionSetTy::const_iterator > | regions () 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 560 of file SymbolManager.h.
|
inline |
Construct a reaper object, which removes everything which is not live before we execute statements in the given stack frame.
If the statement is NULL, everything in this and parent stack frames are considered live. If the stack frame is NULL, everything on stack is considered dead.
Definition at line 593 of file SymbolManager.h.
References clang::nullptr, and s.
Referenced by isLive().
|
inline |
It might return null.
Definition at line 598 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 629 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 StackFrame * | SF ) const |
Definition at line 389 of file SymbolManager.cpp.
References isLive().
Definition at line 409 of file SymbolManager.cpp.
References clang::ento::VarRegion::getDecl(), clang::ento::VarRegion::getStackFrame(), clang::isa(), clang::LiveVariables::isLive(), clang::StackFrame::isParentOf(), and SymbolReaper().
Definition at line 338 of file SymbolManager.cpp.
References clang::cast(), clang::ento::SymExpr::getKind(), getRegion(), isLive(), isLiveRegion(), and markLive().
Referenced by isDead(), isLive(), isLive(), isLiveRegion(), and clang::ento::EnvironmentManager::removeDeadBindings().
Definition at line 307 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion(), clang::isa(), and isLive().
Referenced by clang::ento::mpi::MPIChecker::checkMissingWaits(), and isLive().
| void SymbolReaper::markElementIndicesLive | ( | const MemRegion * | region | ) |
Definition at line 291 of file SymbolManager.cpp.
References markLive(), and clang::ento::SVal::symbols().
Referenced by markLive().
| 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 302 of file SymbolManager.cpp.
References clang::isa().
| void SymbolReaper::markLazilyCopied | ( | const MemRegion * | region | ) |
Definition at line 287 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion().
| void SymbolReaper::markLive | ( | const MemRegion * | region | ) |
Definition at line 282 of file SymbolManager.cpp.
References clang::ento::MemRegion::getBaseRegion(), and markElementIndicesLive().
| 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 277 of file SymbolManager.cpp.
Referenced by isLive(), markElementIndicesLive(), and clang::ento::ExprEngine::removeDead().
|
inline |
Definition at line 621 of file SymbolManager.h.
|
inline |
Set to the value of the symbolic store after StoreManager::removeDeadBindings has been called.
Definition at line 639 of file SymbolManager.h.
Referenced by clang::ento::ProgramStateManager::removeDeadBindingsFromEnvironmentAndStore().