diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-27 22:39:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-27 22:39:07 +0000 |
commit | df5f681525afba7eca981b180d89194611377ee9 (patch) | |
tree | cd9a356cbbaf9444c3e46c206a091535b2e5a0cc /clang/lib/Analysis/RegionStore.cpp | |
parent | 4425660b1f9e096534bed960ed2dd36c7f04053e (diff) | |
download | bcm5719-llvm-df5f681525afba7eca981b180d89194611377ee9.tar.gz bcm5719-llvm-df5f681525afba7eca981b180d89194611377ee9.zip |
Specially handle fields, elements, and ivars in
RegionStoreManager::InvalidateRegion() by only removing their old
binding, not conjuring a new symbol.
llvm-svn: 82939
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index da04d68dcf0..5d3fa7292b6 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/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); |