From: Ted Kremenek Date: Tue, 5 Feb 2008 05:15:51 +0000 (+0000) Subject: ValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=768ad16a4ab79fbc52f6f3bdc9362fd4e1d51d53;p=clang 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 --- 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; }