From: Zhongxing Xu Date: Thu, 27 Nov 2008 06:08:40 +0000 (+0000) Subject: Factory objects should not be temporary. It caches all objects in the set. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0bc50eaa3fda5dd5d4148d385e25ac79151561b;p=clang 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 7bed3931bf..5ce95a1e56 100644 --- a/lib/Analysis/BasicConstraintManager.cpp +++ b/lib/Analysis/BasicConstraintManager.cpp @@ -29,9 +29,10 @@ typedef llvm::ImmutableMap 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.