]> granicus.if.org Git - clang/commitdiff
Remove GRStateManager& field from SimpleConstraintManager.
authorTed Kremenek <kremenek@apple.com>
Thu, 18 Jun 2009 23:20:05 +0000 (23:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 18 Jun 2009 23:20:05 +0000 (23:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73735 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicConstraintManager.cpp
lib/Analysis/RangeConstraintManager.cpp
lib/Analysis/SimpleConstraintManager.cpp
lib/Analysis/SimpleConstraintManager.h

index 7bd22fd313a78c50ed4cb4ead39b1f54ad3c3bbf..ffa8a8625bdf41c204bf4b9256c58d5cf0aab270 100644 (file)
@@ -51,7 +51,7 @@ class VISIBILITY_HIDDEN BasicConstraintManager
   GRState::IntSetTy::Factory ISetFactory;
 public:
   BasicConstraintManager(GRStateManager& statemgr) 
-    : SimpleConstraintManager(statemgr), ISetFactory(statemgr.getAllocator()) {}
+    : ISetFactory(statemgr.getAllocator()) {}
 
   const GRState* AssumeSymNE(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& V);
index 3b4d0c4122ce6e692667e0a1ec2d56aaecfd3309..73c68bcaea033dc11826d1702eef670675b46244 100644 (file)
@@ -235,8 +235,7 @@ namespace {
 class VISIBILITY_HIDDEN RangeConstraintManager : public SimpleConstraintManager{
   RangeSet GetRange(const GRState *state, SymbolRef sym);      
 public:
-  RangeConstraintManager(GRStateManager& statemgr) 
-      : SimpleConstraintManager(statemgr) {}
+  RangeConstraintManager() {}
 
   const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
                              const llvm::APSInt& V);
@@ -275,9 +274,8 @@ private:
 
 } // end anonymous namespace
 
-ConstraintManager* clang::CreateRangeConstraintManager(GRStateManager& StateMgr)
-{
-  return new RangeConstraintManager(StateMgr);
+ConstraintManager* clang::CreateRangeConstraintManager(GRStateManager&) {
+  return new RangeConstraintManager();
 }
 
 const llvm::APSInt* RangeConstraintManager::getSymVal(const GRState* St,
index 6e858891fa83a339a5de8105854a8fb75ac9c4a2..82801eb05d38369c69ddc26a10f834a50609517a 100644 (file)
@@ -234,7 +234,7 @@ const GRState *SimpleConstraintManager::AssumeInBound(const GRState *state,
   if (!(isa<nonloc::ConcreteInt>(Idx) && isa<nonloc::ConcreteInt>(UpperBound)))
     return state;
 
-  const llvm::APSInt& Zero = getBasicVals().getZeroWithPtrWidth(false);
+  const llvm::APSInt& Zero = state->getBasicVals().getZeroWithPtrWidth(false);
   llvm::APSInt IdxV = cast<nonloc::ConcreteInt>(Idx).getValue();
   // IdxV might be too narrow.
   if (IdxV.getBitWidth() < Zero.getBitWidth())
index bd18b6af93121ddd044ffcec6f3355f0c23b1fae..1e1a10da030fc3e80ce1847c1eb898bc47c381f7 100644 (file)
 namespace clang {
 
 class SimpleConstraintManager : public ConstraintManager {
-protected:
-  GRStateManager& StateMgr;
 public:
-  SimpleConstraintManager(GRStateManager& statemgr) 
-    : StateMgr(statemgr) {}
-  virtual ~SimpleConstraintManager();
-  
-  bool canReasonAbout(SVal X) const;
+  SimpleConstraintManager() {}
+  virtual ~SimpleConstraintManager();  
   
-  virtual const GRState *Assume(const GRState *state, SVal Cond,
-                                bool Assumption);
-
   //===------------------------------------------------------------------===//
   // Common implementation for the interface provided by ConstraintManager.
   //===------------------------------------------------------------------===//
-  
+
+  bool canReasonAbout(SVal X) const;
+
+  const GRState *Assume(const GRState *state, SVal Cond, bool Assumption);
+
   const GRState *Assume(const GRState *state, Loc Cond, bool Assumption);
 
   const GRState *Assume(const GRState *state, NonLoc Cond, bool Assumption);
@@ -77,14 +73,6 @@ protected:
   const GRState *AssumeAux(const GRState *state, Loc Cond,bool Assumption);
   
   const GRState *AssumeAux(const GRState *state, NonLoc Cond, bool Assumption);
-
-  //===------------------------------------------------------------------===//
-  // FIXME: These can probably be removed now.
-  //===------------------------------------------------------------------===//
-
-private:
-  BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
-  SymbolManager& getSymbolManager() const { return StateMgr.getSymbolManager(); }
 };
 
 }  // end clang namespace