aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/Store.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-19 01:59:33 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-19 01:59:33 +0000
commit77a4d5687c2cb3199c689892c9d040a94ff270af (patch)
tree2de2bb3aebfd7f4c982d64744324c6a486ccd830 /lib/StaticAnalyzer/Core/Store.cpp
parent7ff07dce18a7c693fe1a15bd7b790d8de9d21e92 (diff)
Add 'StoreRef' smart pointer to allow more fine-grain memory lifetime control of Store objects.
This yields a minor memory reduction (for larger functions) on Sqlite at the cost of slightly higher memory usage on some functions because of the increased size of GRState (which can be optimized). I expect the real memory savings from this enhancement will come when we aggressively canabilize more of the ExplodedGraph. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Store.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/Store.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp
index 28f890b39c..379327fbb5 100644
--- a/lib/StaticAnalyzer/Core/Store.cpp
+++ b/lib/StaticAnalyzer/Core/Store.cpp
@@ -22,9 +22,9 @@ StoreManager::StoreManager(GRStateManager &stateMgr)
: svalBuilder(stateMgr.getSValBuilder()), StateMgr(stateMgr),
MRMgr(svalBuilder.getRegionManager()), Ctx(stateMgr.getContext()) {}
-Store StoreManager::enterStackFrame(const GRState *state,
- const StackFrameContext *frame) {
- return state->getStore();
+StoreRef StoreManager::enterStackFrame(const GRState *state,
+ const StackFrameContext *frame) {
+ return StoreRef(state->getStore(), *this);
}
const MemRegion *StoreManager::MakeElementRegion(const MemRegion *Base,
@@ -44,6 +44,10 @@ static bool IsCompleteType(ASTContext &Ctx, QualType Ty) {
return true;
}
+StoreRef StoreManager::BindDefault(Store store, const MemRegion *R, SVal V) {
+ return StoreRef(store, *this);
+}
+
const ElementRegion *StoreManager::GetElementZeroRegion(const MemRegion *R,
QualType T) {
NonLoc idx = svalBuilder.makeZeroArrayIndex();