[cfe-commits] r117335 - /cfe/trunk/lib/Checker/RegionStore.cpp

Ted Kremenek kremenek at apple.com
Mon Oct 25 17:06:15 PDT 2010


Author: kremenek
Date: Mon Oct 25 19:06:15 2010
New Revision: 117335

URL: http://llvm.org/viewvc/llvm-project?rev=117335&view=rev
Log:
Move 'includeGlobals' as a field into ClusterAnalysis.

Modified:
    cfe/trunk/lib/Checker/RegionStore.cpp

Modified: cfe/trunk/lib/Checker/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RegionStore.cpp?rev=117335&r1=117334&r2=117335&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Mon Oct 25 19:06:15 2010
@@ -456,12 +456,14 @@
   ValueManager &ValMgr;
 
   RegionBindings B;
+  
+  const bool includeGlobals;
 
 public:
   ClusterAnalysis(RegionStoreManager &rm, GRStateManager &StateMgr,
-                  RegionBindings b)
+                  RegionBindings b, const bool includeGlobals)
     : RM(rm), Ctx(StateMgr.getContext()), ValMgr(StateMgr.getValueManager()),
-      B(b) {}
+      B(b), includeGlobals(includeGlobals) {}
 
   RegionBindings getRegionBindings() const { return B; }
 
@@ -487,7 +489,7 @@
     return *CRef;
   }
 
-  void GenerateClusters(bool includeGlobals = false) {
+  void GenerateClusters() {
       // Scan the entire set of bindings and make the region clusters.
     for (RegionBindings::iterator RI = B.begin(), RE = B.end(); RI != RE; ++RI){
       RegionCluster &C = AddToCluster(RI.getKey());
@@ -574,8 +576,9 @@
                           RegionBindings b,
                           const Expr *ex, unsigned count,
                           StoreManager::InvalidatedSymbols *is,
-                          StoreManager::InvalidatedRegions *r)
-    : ClusterAnalysis<InvalidateRegionsWorker>(rm, stateMgr, b),
+                          StoreManager::InvalidatedRegions *r,
+                          bool includeGlobals)
+    : ClusterAnalysis<InvalidateRegionsWorker>(rm, stateMgr, b, includeGlobals),
       Ex(ex), Count(count), IS(is), Regions(r) {}
 
   void VisitCluster(const MemRegion *baseR, BindingKey *I, BindingKey *E);
@@ -698,10 +701,10 @@
                                             InvalidatedRegions *Regions) {
   InvalidateRegionsWorker W(*this, StateMgr,
                             RegionStoreManager::GetRegionBindings(store),
-                            Ex, Count, IS, Regions);
+                            Ex, Count, IS, Regions, invalidateGlobals);
 
   // Scan the bindings and generate the clusters.
-  W.GenerateClusters(invalidateGlobals);
+  W.GenerateClusters();
 
   // Add I .. E to the worklist.
   for ( ; I != E; ++I)
@@ -1612,7 +1615,8 @@
   RemoveDeadBindingsWorker(RegionStoreManager &rm, GRStateManager &stateMgr,
                            RegionBindings b, SymbolReaper &symReaper,
                            const StackFrameContext *LCtx)
-    : ClusterAnalysis<RemoveDeadBindingsWorker>(rm, stateMgr, b),
+    : ClusterAnalysis<RemoveDeadBindingsWorker>(rm, stateMgr, b,
+                                                /* includeGlobals = */ false),
       SymReaper(symReaper), CurrentLCtx(LCtx) {}
 
   // Called by ClusterAnalysis.





More information about the cfe-commits mailing list