Factory objects should not be temporary. It caches all objects in the set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60151 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicConstraintManager.cpp b/lib/Analysis/BasicConstraintManager.cpp
index 7bed393..5ce95a1 100644
--- a/lib/Analysis/BasicConstraintManager.cpp
+++ b/lib/Analysis/BasicConstraintManager.cpp
@@ -29,9 +29,10 @@
 // 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::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.