summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BasicConstraintManager.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-27 06:08:40 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-27 06:08:40 +0000
commit59e2d41a8eed7eebef49e67907b1f232917620b6 (patch)
tree2f724313834910be25e710af8e4591ec9c9ef8ca /clang/lib/Analysis/BasicConstraintManager.cpp
parentb670f294c968f5dba7bfae232a63b7c6c744e719 (diff)
downloadbcm5719-llvm-59e2d41a8eed7eebef49e67907b1f232917620b6.tar.gz
bcm5719-llvm-59e2d41a8eed7eebef49e67907b1f232917620b6.zip
Factory objects should not be temporary. It caches all objects in the set.
llvm-svn: 60151
Diffstat (limited to 'clang/lib/Analysis/BasicConstraintManager.cpp')
-rw-r--r--clang/lib/Analysis/BasicConstraintManager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Analysis/BasicConstraintManager.cpp b/clang/lib/Analysis/BasicConstraintManager.cpp
index 7bed3931bf0..5ce95a1e565 100644
--- a/clang/lib/Analysis/BasicConstraintManager.cpp
+++ b/clang/lib/Analysis/BasicConstraintManager.cpp
@@ -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.
OpenPOWER on IntegriCloud