aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-05 05:15:51 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-05 05:15:51 +0000
commit768ad16a4ab79fbc52f6f3bdc9362fd4e1d51d53 (patch)
tree8503f243866b95f5922b4156cc4c50622ed7a47c
parent4c4635c6cd8114bfa3ee20628fa1f03e67ac1e55 (diff)
ValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46740 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Analysis/GRConstants.cpp2
-rw-r--r--Analysis/RValues.h6
-rw-r--r--Analysis/ValueState.h3
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h1
4 files changed, 8 insertions, 4 deletions
diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp
index 4c678914ef..1143ad2a25 100644
--- a/Analysis/GRConstants.cpp
+++ b/Analysis/GRConstants.cpp
@@ -131,7 +131,7 @@ protected:
public:
GRConstants(GraphTy& g) : G(g), Liveness(G.getCFG(), G.getFunctionDecl()),
Builder(NULL),
- StateMgr(G.getContext()),
+ StateMgr(G.getContext(), G.getAllocator()),
ValMgr(StateMgr.getValueManager()),
SymMgr(StateMgr.getSymbolManager()),
StmtEntryNode(NULL), CurrentStmt(NULL) {
diff --git a/Analysis/RValues.h b/Analysis/RValues.h
index 79202da545..9048c6753a 100644
--- a/Analysis/RValues.h
+++ b/Analysis/RValues.h
@@ -89,10 +89,12 @@ class ValueManager {
ASTContext& Ctx;
APSIntSetTy APSIntSet;
- llvm::BumpPtrAllocator BPAlloc;
+ llvm::BumpPtrAllocator& BPAlloc;
public:
- ValueManager(ASTContext& ctx) : Ctx(ctx) {}
+ ValueManager(ASTContext& ctx, llvm::BumpPtrAllocator& Alloc)
+ : Ctx(ctx), BPAlloc(Alloc) {}
+
~ValueManager();
ASTContext& getContext() const { return Ctx; }
diff --git a/Analysis/ValueState.h b/Analysis/ValueState.h
index ccbc6dd3c8..c686a48f20 100644
--- a/Analysis/ValueState.h
+++ b/Analysis/ValueState.h
@@ -141,7 +141,8 @@ private:
SymbolManager SymMgr;
public:
- ValueStateManager(ASTContext& Ctx) : ValMgr(Ctx) {}
+ ValueStateManager(ASTContext& Ctx, llvm::BumpPtrAllocator& Alloc)
+ : ValMgr(Ctx, Alloc) {}
StateTy getInitialState() {
return Factory.GetEmptyMap();
diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index e69acda3e3..dcc833c0df 100644
--- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -254,6 +254,7 @@ public:
unsigned num_roots() const { return Roots.size(); }
unsigned num_eops() const { return EndNodes.size(); }
+ llvm::BumpPtrAllocator& getAllocator() { return Allocator; }
CFG& getCFG() { return cfg; }
ASTContext& getContext() { return Ctx; }
FunctionDecl& getFunctionDecl() { return FD; }