Showing content from https://clang.llvm.org/doxygen/classclang_1_1ento_1_1ProgramState.html below:
clang: clang::ento::ProgramState Class Reference
ProgramState - This class encapsulates: More...
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
ProgramState (ProgramStateManager *mgr, const Environment &env, StoreRef st, GenericDataMap gdm) This ctor is used when creating the first ProgramState object.
ProgramState (const ProgramState &RHS) Copy ctor - We must explicitly define this or else the "Next" ptr in FoldingSetNode will also get copied.
~ProgramState () int64_t getID () const ProgramStateManager & getStateManager () const Return the ProgramStateManager associated with this state.
AnalysisManager & getAnalysisManager () const ConstraintManager & getConstraintManager () const Return the ConstraintManager.
const Environment & getEnvironment () const getEnvironment - Return the environment associated with this state.
Store getStore () const Return the store associated with this state.
GenericDataMap getGDM () const getGDM - Return the generic data map associated with this state.
void setGDM (GenericDataMap gdm) void Profile (llvm::FoldingSetNodeID &ID) const Profile - Used to profile the contents of this object for inclusion in a FoldingSet.
BasicValueFactory & getBasicVals () const SymbolManager & getSymbolManager () const ProgramStateRef assume (DefinedOrUnknownSVal cond, bool assumption) const Assumes that the value of cond
is zero (if assumption
is "false") or non-zero (if assumption
is "true").
std::pair< ProgramStateRef, ProgramStateRef > assume (DefinedOrUnknownSVal cond) const Assumes both "true" and "false" for cond
, and returns both corresponding states (respectively).
std::pair< ProgramStateRef, ProgramStateRef > assumeInBoundDual (DefinedOrUnknownSVal idx, DefinedOrUnknownSVal upperBound, QualType IndexType=QualType()) const ProgramStateRef assumeInBound (DefinedOrUnknownSVal idx, DefinedOrUnknownSVal upperBound, bool assumption, QualType IndexType=QualType()) const ProgramStateRef assumeInclusiveRange (DefinedOrUnknownSVal Val, const llvm::APSInt &From, const llvm::APSInt &To, bool assumption) const Assumes that the value of Val
is bounded with [From
; To
] (if assumption
is "true") or it is fully out of this range (if assumption
is "false").
std::pair< ProgramStateRef, ProgramStateRef > assumeInclusiveRange (DefinedOrUnknownSVal Val, const llvm::APSInt &From, const llvm::APSInt &To) const Assumes given range both "true" and "false" for Val
, and returns both corresponding states (respectively).
ConditionTruthVal isNonNull (SVal V) const Check if the given SVal is not constrained to zero and is not a zero constant.
ConditionTruthVal isNull (SVal V) const Check if the given SVal is constrained to zero or is a zero constant.
ConditionTruthVal areEqual (SVal Lhs, SVal Rhs) const LLVM_ATTRIBUTE_RETURNS_NONNULL const VarRegion * getRegion (const VarDecl *D, const LocationContext *LC) const Utility method for getting regions.
ProgramStateRef BindExpr (const Stmt *S, const LocationContext *LCtx, SVal V, bool Invalidate=true) const Create a new state by binding the value 'V' to the statement 'S' in the state's environment.
ProgramStateRef bindLoc (Loc location, SVal V, const LocationContext *LCtx, bool notifyChanges=true) const ProgramStateRef bindLoc (SVal location, SVal V, const LocationContext *LCtx) const ProgramStateRef bindDefaultInitial (SVal loc, SVal V, const LocationContext *LCtx) const Initializes the region of memory represented by loc
with an initial value.
ProgramStateRef bindDefaultZero (SVal loc, const LocationContext *LCtx) const Performs C++ zero-initialization procedure on the region of memory represented by loc
.
ProgramStateRef killBinding (Loc LV) const ProgramStateRef invalidateRegions (ArrayRef< const MemRegion * > Regions, const Stmt *S, unsigned BlockCount, const LocationContext *LCtx, bool CausesPointerEscape, InvalidatedSymbols *IS=nullptr, const CallEvent *Call=nullptr, RegionAndSymbolInvalidationTraits *ITraits=nullptr) const Returns the state with bindings for the given regions cleared from the store.
ProgramStateRef invalidateRegions (ArrayRef< SVal > Values, const Stmt *S, unsigned BlockCount, const LocationContext *LCtx, bool CausesPointerEscape, InvalidatedSymbols *IS=nullptr, const CallEvent *Call=nullptr, RegionAndSymbolInvalidationTraits *ITraits=nullptr) const ProgramStateRef enterStackFrame (const CallEvent &Call, const StackFrameContext *CalleeCtx) const enterStackFrame - Returns the state for entry to the given stack frame, preserving the current state.
SVal getSelfSVal (const LocationContext *LC) const Return the value of 'self' if available in the given context.
Loc getLValue (const CXXBaseSpecifier &BaseSpec, const SubRegion *Super) const Get the lvalue for a base class object reference.
Loc getLValue (const CXXRecordDecl *BaseClass, const SubRegion *Super, bool IsVirtual) const Get the lvalue for a base class object reference.
Loc getLValue (const VarDecl *D, const LocationContext *LC) const Get the lvalue for a variable reference.
Loc getLValue (const CompoundLiteralExpr *literal, const LocationContext *LC) const SVal getLValue (const ObjCIvarDecl *decl, SVal base) const Get the lvalue for an ivar reference.
SVal getLValue (const FieldDecl *decl, SVal Base) const Get the lvalue for a field reference.
SVal getLValue (const IndirectFieldDecl *decl, SVal Base) const Get the lvalue for an indirect field reference.
SVal getLValue (QualType ElementType, SVal Idx, SVal Base) const Get the lvalue for an array index.
SVal getSVal (const Stmt *S, const LocationContext *LCtx) const Returns the SVal bound to the statement 'S' in the state's environment.
SVal getSValAsScalarOrLoc (const Stmt *Ex, const LocationContext *LCtx) const SVal getSVal (Loc LV, QualType T=QualType()) const Return the value bound to the specified location.
SVal getRawSVal (Loc LV, QualType T=QualType()) const Returns the "raw" SVal bound to LV before any value simplfication.
SVal getSVal (const MemRegion *R, QualType T=QualType()) const Return the value bound to the specified location.
SVal getSValAsScalarOrLoc (const MemRegion *R) const Return the value bound to the specified location, assuming that the value is a scalar integer or an enumeration or a pointer.
bool scanReachableSymbols (SVal val, SymbolVisitor &visitor) const Visits the symbols reachable from the given SVal using the provided SymbolVisitor.
bool scanReachableSymbols (llvm::iterator_range< region_iterator > Reachable, SymbolVisitor &visitor) const Visits the symbols reachable from the regions in the given MemRegions range using the provided SymbolVisitor.
template<typename CB > CB scanReachableSymbols (SVal val) const template<typename CB > CB scanReachableSymbols (llvm::iterator_range< region_iterator > Reachable) const void *const * FindGDM (void *K) const template<typename T > ProgramStateRef add (typename ProgramStateTrait< T >::key_type K) const template<typename T > ProgramStateTrait< T >::data_type get () const template<typename T > ProgramStateTrait< T >::lookup_type get (typename ProgramStateTrait< T >::key_type key) const template<typename T > ProgramStateTrait< T >::context_type get_context () const template<typename T > ProgramStateRef remove (typename ProgramStateTrait< T >::key_type K) const template<typename T > ProgramStateRef remove (typename ProgramStateTrait< T >::key_type K, typename ProgramStateTrait< T >::context_type C) const template<typename T > ProgramStateRef remove () const template<typename T > ProgramStateRef set (typename ProgramStateTrait< T >::data_type D) const template<typename T > ProgramStateRef set (typename ProgramStateTrait< T >::key_type K, typename ProgramStateTrait< T >::value_type E) const template<typename T > ProgramStateRef set (typename ProgramStateTrait< T >::key_type K, typename ProgramStateTrait< T >::value_type E, typename ProgramStateTrait< T >::context_type C) const template<typename T > bool contains (typename ProgramStateTrait< T >::key_type key) const void printJson (raw_ostream &Out, const LocationContext *LCtx=nullptr, const char *NL="\n", unsigned int Space=0, bool IsDot=false) const void printDOT (raw_ostream &Out, const LocationContext *LCtx=nullptr, unsigned int Space=0) const void dump () const
ProgramState - This class encapsulates:
- A mapping from expressions to values (Environment)
- A mapping from locations to values (Store)
- Constraints on symbolic values (GenericDataMap)
Together these represent the "abstract state" of a program.
ProgramState is intended to be used as a functional object; that is, once it is created and made "persistent" in a FoldingSet, its values will never change.
Definition at line 71 of file ProgramState.h.
◆ GenericDataMap ◆ region_iterator ◆ ProgramState() [1/2] ◆ ProgramState() [2/2] ◆ ~ProgramState() ProgramState::~ProgramState ( ) ◆ add() ◆ areEqual() ◆ assume() [1/2] ◆ assume() [2/2] ◆ assumeInBound() ◆ assumeInBoundDual()
Definition at line 317 of file ProgramState.cpp.
References clang::ento::ConstraintManager::assumeDual(), clang::ento::SVal::castAs(), clang::ento::SValBuilder::evalBinOpNN(), clang::ento::SValBuilder::getArrayIndexType(), clang::ento::SValBuilder::getBasicValueFactory(), clang::ento::SValBuilder::getContext(), clang::ento::BasicValueFactory::getMinValue(), getStateManager(), clang::ASTContext::IntTy, clang::QualType::isNull(), clang::ento::SVal::isUnknown(), clang::ento::SVal::isUnknownOrUndef(), clang::Min, and SM.
Referenced by assumeInBound().
◆ assumeInclusiveRange() [1/2] ◆ assumeInclusiveRange() [2/2] ◆ bindDefaultInitial() ◆ bindDefaultZero() ◆ BindExpr() ◆ bindLoc() [1/2] ◆ bindLoc() [2/2] ◆ contains() ◆ dump() LLVM_DUMP_METHOD void ProgramState::dump ( ) const ◆ enterStackFrame() ◆ FindGDM() void *const * ProgramState::FindGDM ( void * K ) const ◆ get() [1/2] ◆ get() [2/2] ◆ get_context() ◆ getAnalysisManager() ◆ getBasicVals() ◆ getConstraintManager() ◆ getEnvironment() const Environment & clang::ento::ProgramState::getEnvironment ( ) const inline
getEnvironment - Return the environment associated with this state.
The environment is the mapping from expressions to values.
Definition at line 157 of file ProgramState.h.
References Env.
◆ getGDM()
getGDM - Return the generic data map associated with this state.
Definition at line 165 of file ProgramState.h.
◆ getID() int64_t ProgramState::getID ( ) const ◆ getLValue() [1/8] ◆ getLValue() [2/8] ◆ getLValue() [3/8] ◆ getLValue() [4/8] ◆ getLValue() [5/8] ◆ getLValue() [6/8] ◆ getLValue() [7/8] ◆ getLValue() [8/8] ◆ getRawSVal() ◆ getRegion() ◆ getSelfSVal() ◆ getStateManager()
Return the ProgramStateManager associated with this state.
Definition at line 146 of file ProgramState.h.
Referenced by add(), assume(), assumeInBoundDual(), assumeInclusiveRange(), bindDefaultInitial(), bindDefaultZero(), BindExpr(), bindLoc(), enterStackFrame(), get_context(), getBasicVals(), getID(), getLValue(), getRawSVal(), getRegion(), getSVal(), getSymbolManager(), isNull(), killBinding(), printJson(), remove(), and set().
◆ getStore() Store clang::ento::ProgramState::getStore ( ) const inline ◆ getSVal() [1/3] ◆ getSVal() [2/3] ◆ getSVal() [3/3] ◆ getSValAsScalarOrLoc() [1/2] SVal ProgramState::getSValAsScalarOrLoc ( const MemRegion * R ) const ◆ getSValAsScalarOrLoc() [2/2] ◆ getSymbolManager() SymbolManager & clang::ento::ProgramState::getSymbolManager ( ) const inline ◆ invalidateRegions() [1/2]
Returns the state with bindings for the given regions cleared from the store.
If Call
is non-null, also invalidates global regions (but if Call
is from a system header, then this is limited to globals declared in system headers).
This calls the lower-level method StoreManager::invalidateRegions
to do the actual invalidation, then calls the checker callbacks which should be triggered by this event.
-
Parameters
-
Regions the set of regions to be invalidated. E the expression that caused the invalidation. BlockCount The number of times the current basic block has been visited. CausesPointerEscape the flag is set to true when the invalidation entails escape of a symbol (representing a pointer). For example, due to it being passed as an argument in a call. IS the set of invalidated symbols. Call if non-null, the invalidated regions represent parameters to the call and should be considered directly invalidated. ITraits information about special handling for particular regions or symbols.
◆ invalidateRegions() [2/2] ◆ isNonNull() ◆ isNull() ◆ killBinding() ◆ printDOT() ◆ printJson()
Definition at line 479 of file ProgramState.cpp.
References clang::ento::ProgramStateManager::getConstraintManager(), clang::ento::ProgramStateManager::getContext(), clang::ento::ProgramStateManager::getOwningEngine(), getStateManager(), getStore(), clang::ento::ProgramStateManager::getStoreManager(), clang::ento::printDynamicTypeInfoJson(), clang::ento::Environment::printJson(), clang::ento::ConstraintManager::printJson(), clang::ento::ExprEngine::printJson(), and clang::ento::StoreManager::printJson().
Referenced by dump(), and printDOT().
◆ Profile() [1/2] void clang::ento::ProgramState::Profile ( llvm::FoldingSetNodeID & ID ) const inline
Profile - Used to profile the contents of this object for inclusion in a FoldingSet.
Definition at line 181 of file ProgramState.h.
References ID, and Profile().
◆ Profile() [2/2] static void clang::ento::ProgramState::Profile ( llvm::FoldingSetNodeID & ID, const ProgramState * V ) inlinestatic ◆ remove() [1/3] ◆ remove() [2/3] ◆ remove() [3/3] ◆ scanReachableSymbols() [1/4]
template<typename CB >
CB clang::ento::ProgramState::scanReachableSymbols ( llvm::iterator_range< region_iterator > Reachable ) const ◆ scanReachableSymbols() [2/4] ◆ scanReachableSymbols() [3/4]
template<typename CB >
CB clang::ento::ProgramState::scanReachableSymbols ( SVal val ) const ◆ scanReachableSymbols() [4/4] ◆ set() [1/3] ◆ set() [2/3] ◆ set() [3/3] ◆ setGDM() ◆ ConstraintManager ◆ ExplodedGraph ◆ ExplodedNode ◆ NodeBuilder ◆ ProgramStateManager ◆ ProgramStateRelease
Decrement the number of times this state is referenced.
Definition at line 35 of file ProgramState.cpp.
◆ ProgramStateRetain
Increments the number of times this state is referenced.
Definition at line 30 of file ProgramState.cpp.
The documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4