diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-29 00:47:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-29 00:47:32 +0000 |
commit | 2bc39c61077e6a49728f309bb80a949fb0b2aaff (patch) | |
tree | 5d34c9916057c108fac37e6a6ac817e1f31f0677 /include/clang/Analysis | |
parent | 561ca4be84d6456dde1d2bcecf9969d3e99e5368 (diff) |
Added "getBindings" and "BindingAsString" to GRStateManager and StoreManager.
Migrated CFRefCount.cpp to use getBindings and BindingsAsString instead of
making assumptions about the Store (removed dependence on GRState::vb_iterator).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis')
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRState.h | 13 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/Store.h | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h index 0ecfb27c16..8570a9d0c2 100644 --- a/include/clang/Analysis/PathSensitive/GRState.h +++ b/include/clang/Analysis/PathSensitive/GRState.h @@ -381,6 +381,19 @@ public: const GRState* addGDM(const GRState* St, void* Key, void* Data); // Methods that query & manipulate the Store. + + /// getBindings - Returns all store bindings in the specified state that bind + /// to the specified symbolic value. + void getBindings(llvm::SmallVectorImpl<store::Binding>& bindings, + const GRState* St, SymbolID Sym) { + StMgr->getBindings(bindings, St->getStore(), Sym); + } + + /// BindingAsString - Returns a string representing the given store binding. + std::string BindingAsString(store::Binding binding) { + return StMgr->BindingAsString(binding); + } + RVal GetRVal(const GRState* St, LVal LV, QualType T = QualType()) { return StMgr->GetRVal(St->getStore(), LV, T); } diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h index 4f16901972..d91dac1fe4 100644 --- a/include/clang/Analysis/PathSensitive/Store.h +++ b/include/clang/Analysis/PathSensitive/Store.h @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/SmallVector.h" #include <vector> #include <iosfwd> @@ -124,6 +125,14 @@ public: virtual void print(Store store, std::ostream& Out, const char* nl, const char *sep) = 0; + /// getBindings - Returns all bindings in the specified store that bind + /// to the specified symbolic value. + virtual void getBindings(llvm::SmallVectorImpl<store::Binding>& bindings, + Store store, SymbolID Sym) = 0; + + /// BindingAsString - Returns a string representing the given binding. + virtual std::string BindingAsString(store::Binding binding) = 0; + /// getExtent - Returns the size of the region in bits. virtual store::RegionExtent getExtent(store::Region R) =0; }; |