]> granicus.if.org Git - clang/commitdiff
Refactor MemRegionManager instance variable into parent class. No functionality...
authorTed Kremenek <kremenek@apple.com>
Wed, 7 Jan 2009 22:18:50 +0000 (22:18 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 7 Jan 2009 22:18:50 +0000 (22:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61888 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/Store.h
lib/Analysis/BasicStore.cpp
lib/Analysis/RegionStore.cpp

index 5425b6976b9a70285e3f3325cc41da0a34f8f34d..be8ee458cb96d6cb3028c7409ee32f27cf4fecac 100644 (file)
@@ -37,7 +37,14 @@ class StoreManager {
 public:
   typedef llvm::SmallSet<SymbolRef, 20>      LiveSymbolsTy;
   typedef llvm::DenseSet<SymbolRef>          DeadSymbolsTy;
-  
+
+protected:
+  /// MRMgr - Manages region objects associated with this StoreManager.
+  MemRegionManager MRMgr;
+
+  StoreManager(llvm::BumpPtrAllocator& Alloc) : MRMgr(Alloc) {}
+
+public:  
   virtual ~StoreManager() {}
   
   /// Retrieve - Retrieves the value bound to specified location.  The optional
@@ -64,7 +71,7 @@ public:
                                              SVal V) = 0;
   
   virtual Store getInitialStore() = 0;
-  virtual MemRegionManager& getRegionManager() = 0;
+  MemRegionManager& getRegionManager() { return MRMgr; }
 
   virtual SVal getLValueVar(const GRState* St, const VarDecl* VD) = 0;
 
index fe14a9effc19ef83e6171c082694351106e6fa7b..9e469c0b5dcc9b253435112b9f65e8cc5de2a2f9 100644 (file)
@@ -26,14 +26,13 @@ namespace {
 class VISIBILITY_HIDDEN BasicStoreManager : public StoreManager {
   VarBindingsTy::Factory VBFactory;
   GRStateManager& StateMgr;
-  MemRegionManager MRMgr;
   const MemRegion* SelfRegion;
   
 public:
   BasicStoreManager(GRStateManager& mgr)
-    : VBFactory(mgr.getAllocator()), 
+    : StoreManager(mgr.getAllocator()),
+      VBFactory(mgr.getAllocator()), 
       StateMgr(mgr), 
-      MRMgr(StateMgr.getAllocator()), 
       SelfRegion(0) {}
   
   ~BasicStoreManager() {}
@@ -49,7 +48,6 @@ public:
   Store BindInternal(Store St, Loc LV, SVal V);  
   Store Remove(Store St, Loc LV);
   Store getInitialStore();
-  MemRegionManager& getRegionManager() { return MRMgr; }
 
   // FIXME: Investigate what is using this. This method should be removed.
   virtual Loc getLoc(const VarDecl* VD) {
index 4e0215b997e0427feb758eddac80e1170be84fb2..598107c1ea53c08d3c4fcdeb091c660480c19c33 100644 (file)
@@ -54,6 +54,7 @@ namespace clang {
 //
 //  MemRegions represent chunks of memory with a size (their "extent").  This
 //  GDM entry tracks the extents for regions.  Extents are in bytes.
+//
 namespace { class VISIBILITY_HIDDEN RegionExtents {}; }
 static int RegionExtentsIndex = 0;
 namespace clang {
@@ -108,14 +109,13 @@ class VISIBILITY_HIDDEN RegionStoreManager : public StoreManager {
   RegionViews::Factory RVFactory;
 
   GRStateManager& StateMgr;
-  MemRegionManager MRMgr;
 
 public:
   RegionStoreManager(GRStateManager& mgr) 
-    : RBFactory(mgr.getAllocator()),
+    : StoreManager(mgr.getAllocator()),
+      RBFactory(mgr.getAllocator()),
       RVFactory(mgr.getAllocator()),
-      StateMgr(mgr), 
-      MRMgr(StateMgr.getAllocator()) {}
+      StateMgr(mgr) {}
 
   virtual ~RegionStoreManager() {}