14 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_STORE_H
15 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_STORE_H
20 #include "llvm/ADT/DenseSet.h"
21 #include "llvm/ADT/Optional.h"
29 class StackFrameContext;
35 class ProgramStateManager;
99 return getLValueFieldOrIvar(D, Base);
206 virtual void print(
Store store, raw_ostream &Out,
207 const char* nl,
const char *sep) = 0;
224 : Sym(sym), Binding(nullptr), First(
true) {}
228 explicit operator bool() {
return First && Binding; }
237 QualType pointeeTy, uint64_t index = 0);
243 QualType castTy,
bool performTestOnly =
true);
251 : store(store), mgr(smgr) {
257 : store(sr.store), mgr(sr.mgr)
269 assert(&newStore.mgr == &mgr);
270 if (store != newStore.store) {
279 std::unique_ptr<StoreManager>
281 std::unique_ptr<StoreManager>
virtual DefinedOrUnknownSVal getSizeInElements(ProgramStateRef state, const MemRegion *region, QualType EleTy)
TypedValueRegion - An abstract class representing regions having a typed value.
SVal evalDerivedToBase(SVal Derived, const CastExpr *Cast)
SVal evalDynamicCast(SVal Base, QualType DerivedPtrType, bool &Failed)
Evaluates C++ dynamic_cast cast. The callback may result in the following 3 scenarios: ...
MemRegion - The root abstract class for all memory regions.
Information about invalidation for a particular region/symbol.
FindUniqueBinding(SymbolRef sym)
const MemRegion * MakeElementRegion(const MemRegion *baseRegion, QualType pointeeTy, uint64_t index=0)
virtual StoreRef invalidateRegions(Store store, ArrayRef< SVal > Values, const Expr *E, unsigned Count, const LocationContext *LCtx, const CallEvent *Call, InvalidatedSymbols &IS, RegionAndSymbolInvalidationTraits &ITraits, InvalidatedRegions *InvalidatedTopLevel, InvalidatedRegions *Invalidated)=0
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
virtual StoreRef getInitialStore(const LocationContext *InitLoc)=0
virtual SVal getBinding(Store store, Loc loc, QualType T=QualType())=0
std::unique_ptr< StoreManager > CreateFieldsOnlyRegionStoreManager(ProgramStateManager &StMgr)
const MemRegion * castRegion(const MemRegion *region, QualType CastToTy)
Symbolic value. These values used to capture symbolic execution of the program.
bool HandleBinding(StoreManager &SMgr, Store store, const MemRegion *R, SVal val) override
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
const MemRegion * getRegion()
virtual void decrementReferenceCount(Store store)
virtual SVal getLValueField(const FieldDecl *D, SVal Base)
StoreRef enterStackFrame(Store store, const CallEvent &Call, const StackFrameContext *CalleeCtx)
virtual SVal getLValueIvar(const ObjCIvarDecl *decl, SVal base)
std::unique_ptr< StoreManager > CreateRegionStoreManager(ProgramStateManager &StMgr)
Loc makeLoc(SymbolRef sym)
SValBuilder & svalBuilder
const ElementRegion * GetElementZeroRegion(const MemRegion *R, QualType T)
virtual Loc getLValueVar(const VarDecl *VD, const LocationContext *LC)
virtual StoreRef removeDeadBindings(Store store, const StackFrameContext *LCtx, SymbolReaper &SymReaper)=0
StoreRef & operator=(StoreRef const &)
ProgramStateManager & StateMgr
virtual StoreRef Bind(Store store, Loc loc, SVal val)=0
virtual StoreRef killBinding(Store ST, Loc L)=0
Create a new store with the specified binding removed.
SVal CastRetrievedVal(SVal val, const TypedValueRegion *region, QualType castTy, bool performTestOnly=true)
virtual ~BindingsHandler()
A class responsible for cleaning up unused symbols.
const CompoundLiteralRegion * getCompoundLiteralRegion(const CompoundLiteralExpr *CL, const LocationContext *LC)
llvm::DenseSet< SymbolRef > InvalidatedSymbols
virtual void iterBindings(Store store, BindingsHandler &f)=0
iterBindings - Iterate over the bindings in the Store.
const VarRegion * getVarRegion(const VarDecl *D, const LocationContext *LC)
virtual bool includedInBindings(Store store, const MemRegion *region) const =0
virtual void print(Store store, raw_ostream &Out, const char *nl, const char *sep)=0
Represents an abstract call to a function or method along a particular path.
virtual bool scanReachableSymbols(Store S, const MemRegion *R, ScanReachableSymbols &Visitor)=0
MemRegionManager & getRegionManager()
StoreRef(Store, StoreManager &)
virtual SVal ArrayToPointer(Loc Array, QualType ElementTy)=0
MemRegionManager & MRMgr
MRMgr - Manages region objects associated with this StoreManager.
virtual SVal getLValueElement(QualType elementType, NonLoc offset, SVal Base)
virtual bool HandleBinding(StoreManager &SMgr, Store store, const MemRegion *region, SVal val)=0
virtual void incrementReferenceCount(Store store)
virtual StoreRef BindDefault(Store store, const MemRegion *R, SVal V)
ElementRegin is used to represent both array elements and casts.
StoreManager(ProgramStateManager &stateMgr)
Loc getLValueCompoundLiteral(const CompoundLiteralExpr *CL, const LocationContext *LC)
SmallVector< const MemRegion *, 8 > InvalidatedRegions