]> granicus.if.org Git - clang/commitdiff
Factory objects should not be temporary. It caches all objects in the set.
authorZhongxing Xu <xuzhongxing@gmail.com>
Thu, 27 Nov 2008 06:08:40 +0000 (06:08 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Thu, 27 Nov 2008 06:08:40 +0000 (06:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60151 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicConstraintManager.cpp

index 7bed3931bf0b2973b89ba7246ea3b1a8f4bcfa63..5ce95a1e565535173f2086e5d719decd2bfc56d0 100644 (file)
@@ -29,9 +29,10 @@ typedef llvm::ImmutableMap<SymbolID,const llvm::APSInt*> ConstEqTy;
 // constants and integer variables.
 class VISIBILITY_HIDDEN BasicConstraintManager : public ConstraintManager {
   GRStateManager& StateMgr;
-
+  GRState::IntSetTy::Factory ISetFactory;
 public:
-  BasicConstraintManager(GRStateManager& statemgr) : StateMgr(statemgr) {}
+  BasicConstraintManager(GRStateManager& statemgr) 
+    : StateMgr(statemgr), ISetFactory(statemgr.getAllocator()) {}
 
   virtual const GRState* Assume(const GRState* St, SVal Cond,
                                 bool Assumption, bool& isFeasible);
@@ -409,7 +410,7 @@ const GRState* BasicConstraintManager::AddEQ(const GRState* St, SymbolID sym,
 
 const GRState* BasicConstraintManager::AddNE(const GRState* St, SymbolID sym,
                                              const llvm::APSInt& V) {
-  GRState::IntSetTy::Factory ISetFactory(StateMgr.getAllocator());
+
   GRStateRef state(St, StateMgr);
 
   // First, retrieve the NE-set associated with the given symbol.