[cfe-commits] r78228 - /cfe/trunk/lib/Analysis/RegionStore.cpp
Ted Kremenek
kremenek at apple.com
Wed Aug 5 12:09:27 PDT 2009
Author: kremenek
Date: Wed Aug 5 14:09:24 2009
New Revision: 78228
URL: http://llvm.org/viewvc/llvm-project?rev=78228&view=rev
Log:
Use feedback from RegionStoreSubRegionMap::add() to prune off adding a super
region to the worklist used to create the subregion map.
Modified:
cfe/trunk/lib/Analysis/RegionStore.cpp
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=78228&r1=78227&r2=78228&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Wed Aug 5 14:09:24 2009
@@ -119,12 +119,16 @@
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 @@
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;
More information about the cfe-commits
mailing list