diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-05 19:09:24 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-05 19:09:24 +0000 |
commit | d8c0192b0a4ef28b182a28486b02c3ab05aea76a (patch) | |
tree | 423e27c47a252a2a944cc6b70bf21f6577433454 /lib/Analysis/RegionStore.cpp | |
parent | 47259d9ca7840dd66f06f5f11da7768b23d1e0fd (diff) |
Use feedback from RegionStoreSubRegionMap::add() to prune off adding a super
region to the worklist used to create the subregion map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r-- | lib/Analysis/RegionStore.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 70201759e1..398babc9d7 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -119,12 +119,16 @@ class VISIBILITY_HIDDEN RegionStoreSubRegionMap : public SubRegionMap { SetTy::Factory F; Map M; public: - void add(const MemRegion* Parent, const MemRegion* SubRegion) { + bool add(const MemRegion* Parent, const MemRegion* SubRegion) { Map::iterator I = M.find(Parent); - if (I == M.end()) + + if (I == M.end()) { M.insert(std::make_pair(Parent, F.Add(F.GetEmptySet(), SubRegion))); - else - I->second = F.Add(I->second, SubRegion); + return true; + } + + I->second = F.Add(I->second, SubRegion); + return false; } ~RegionStoreSubRegionMap() {} @@ -405,9 +409,9 @@ RegionStoreManager::getRegionStoreSubRegionMap(const GRState *state) { continue; const MemRegion *superR = R->getSuperRegion(); - M->add(superR, R); - if (const SubRegion *sr = dyn_cast<SubRegion>(superR)) - WL.push_back(sr); + if (M->add(superR, R)) + if (const SubRegion *sr = dyn_cast<SubRegion>(superR)) + WL.push_back(sr); } return M; |