[cfe-commits] r73735 - in /cfe/trunk/lib/Analysis: BasicConstraintManager.cpp RangeConstraintManager.cpp SimpleConstraintManager.cpp SimpleConstraintManager.h

Ted Kremenek kremenek at apple.com
Thu Jun 18 16:20:05 PDT 2009


Author: kremenek
Date: Thu Jun 18 18:20:05 2009
New Revision: 73735

URL: http://llvm.org/viewvc/llvm-project?rev=73735&view=rev
Log:
Remove GRStateManager& field from SimpleConstraintManager.

Modified:
    cfe/trunk/lib/Analysis/BasicConstraintManager.cpp
    cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
    cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp
    cfe/trunk/lib/Analysis/SimpleConstraintManager.h

Modified: cfe/trunk/lib/Analysis/BasicConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicConstraintManager.cpp?rev=73735&r1=73734&r2=73735&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicConstraintManager.cpp Thu Jun 18 18:20:05 2009
@@ -51,7 +51,7 @@
   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);

Modified: cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RangeConstraintManager.cpp?rev=73735&r1=73734&r2=73735&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RangeConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/RangeConstraintManager.cpp Thu Jun 18 18:20:05 2009
@@ -235,8 +235,7 @@
 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 @@
 
 } // 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,

Modified: cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp?rev=73735&r1=73734&r2=73735&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp Thu Jun 18 18:20:05 2009
@@ -234,7 +234,7 @@
   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())

Modified: cfe/trunk/lib/Analysis/SimpleConstraintManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SimpleConstraintManager.h?rev=73735&r1=73734&r2=73735&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/SimpleConstraintManager.h (original)
+++ cfe/trunk/lib/Analysis/SimpleConstraintManager.h Thu Jun 18 18:20:05 2009
@@ -20,22 +20,18 @@
 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 @@
   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





More information about the cfe-commits mailing list