]> granicus.if.org Git - clang/commitdiff
Remove method 'AddNE' from the public interface of ConstraintManager.
authorTed Kremenek <kremenek@apple.com>
Wed, 28 Jan 2009 22:27:59 +0000 (22:27 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 28 Jan 2009 22:27:59 +0000 (22:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63249 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/ConstraintManager.h
include/clang/Analysis/PathSensitive/GRState.h
lib/Analysis/BasicConstraintManager.cpp
lib/Analysis/CFRefCount.cpp

index 4cded5ce6915891cd1031ff3c0c508a481978f19..6b69a1020cde27c7181659bc8d4529f95232b57a 100644 (file)
@@ -38,8 +38,6 @@ public:
                                        SVal UpperBound, bool Assumption,
                                        bool& isFeasible) = 0;
 
-  virtual const GRState* AddNE(const GRState* St, SymbolRef sym, 
-                               const llvm::APSInt& V) = 0;
   virtual const llvm::APSInt* getSymVal(const GRState* St, SymbolRef sym) = 0;
 
   virtual bool isEqual(const GRState* St, SymbolRef sym, 
index 45ad702346c495f3f384d515d4a9a1b371e6433e..b227f91a78f03552f354decc2046038bac7b5954 100644 (file)
@@ -603,10 +603,6 @@ public:
                                         isFeasible);
   }
 
-  const GRState* AddNE(const GRState* St, SymbolRef sym, const llvm::APSInt& V) {
-    return ConstraintMgr->AddNE(St, sym, V);
-  }
-
   const llvm::APSInt* getSymVal(const GRState* St, SymbolRef sym) {
     return ConstraintMgr->getSymVal(St, sym);
   }
@@ -671,10 +667,6 @@ public:
     return GRStateRef(Mgr->Unbind(St, LV), *Mgr);
   }
   
-  GRStateRef AddNE(SymbolRef sym, const llvm::APSInt& V) {
-    return GRStateRef(Mgr->AddNE(St, sym, V), *Mgr);
-  }
-  
   // Trait based GDM dispatch.
   template<typename T>
   typename GRStateTrait<T>::data_type get() const {
@@ -735,6 +727,10 @@ public:
   SVal GetLValue(const VarDecl* VD) {
     return Mgr->GetLValue(St, VD);
   }
+    
+  GRStateRef Assume(SVal Cond, bool Assumption, bool& isFeasible) {
+    return GRStateRef(Mgr->Assume(St, Cond, Assumption, isFeasible), *Mgr);  
+  }
   
   // Pretty-printing.
   void print(std::ostream& Out, const char* nl = "\n",
index 7496c5f5aac247d47deddf684ac90b9c3625c9ed..f14ada7aed63a3e87ae4511289c7b3473cb05149 100644 (file)
@@ -72,7 +72,7 @@ public:
                               const SymIntConstraint& C, bool& isFeasible);
 
   const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
-                                const llvm::APSInt& V, bool& isFeasible);
+                             const llvm::APSInt& V, bool& isFeasible);
 
   const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
                                 const llvm::APSInt& V, bool& isFeasible);
index 2d5cb5f5b89ef46a77ad03336af9ba4859dae03e..6f1b1036b309d55cb5cfd63be0a258782047e870 100644 (file)
@@ -1678,8 +1678,11 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
 #endif 
 
       // FIXME: Add a flag to the checker where allocations are allowed to fail.      
-      if (RE.getKind() == RetEffect::OwnedAllocatedSymbol)
-        state = state.AddNE(Sym, Eng.getBasicVals().getZeroWithPtrWidth());
+      if (RE.getKind() == RetEffect::OwnedAllocatedSymbol) {
+        bool isFeasible;
+        state = state.Assume(loc::SymbolVal(Sym), true, isFeasible);
+        assert(isFeasible && "Cannot assume fresh symbol is non-null.");        
+      }
       
       break;
     }