aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-09-27 22:39:07 +0000
committerTed Kremenek <kremenek@apple.com>2009-09-27 22:39:07 +0000
commit13c200061ac1dd2a7641da6a9394a5dffab08d3b (patch)
tree8edfdbfdff1cfd51a4f9e9f582b0b34d01462dad /lib/Analysis/RegionStore.cpp
parentbada1aad0939021f9caee4feeda9eedf5a2b9e3b (diff)
Specially handle fields, elements, and ivars in
RegionStoreManager::InvalidateRegion() by only removing their old binding, not conjuring a new symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index da04d68dcf..5d3fa7292b 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -514,17 +514,21 @@ const GRState *RegionStoreManager::InvalidateRegion(const GRState *state,
continue;
}
- // FIXME: Special case FieldRegion/ElementRegion for more
- // efficient invalidation. We don't need to conjure symbols for
- // these regions in all cases.
-
// Get the old binding. Is it a region? If so, add it to the worklist.
if (const SVal *OldV = B.lookup(R)) {
if (const MemRegion *RV = OldV->getAsRegion())
WorkList.push_back(RV);
}
- // Invalidate the binding.
+ if (isa<FieldRegion>(R) || isa<ElementRegion>(R) || isa<ObjCIvarRegion>(R)){
+ // For fields and elements, only remove the old binding. The super
+ // region will get set with a default value from which we can lazily
+ // derive a new symbolic value.
+ B = RBFactory.Remove(B, R);
+ continue;
+ }
+
+ // Invalidate the binding by conjuring a new symbol.
DefinedOrUnknownSVal V = ValMgr.getConjuredSymbolVal(R, Ex, T, Count);
assert(SymbolManager::canSymbolicate(T) || V.isUnknown());
B = RBFactory.Add(B, R, V);