diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-31 02:23:28 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-31 02:23:28 +0000 |
commit | a5888f61be9f8d76e9b48a453dbced50523bd2e0 (patch) | |
tree | 614cf6a2cf481e8330faaae382b92835747238c5 /include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h | |
parent | 1d16f0f805c2a3e2198a87154990347b2759f6bd (diff) |
Reapply r149311 which I reverted by mistake.
Original log:
Convert ProgramStateRef to a smart pointer for managing the reference counts of ProgramStates. This leads to a slight memory
improvement, and a simplification of the logic for managing ProgramState objects.
# Please enter the commit message for your changes. Lines starting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h index bed1bffd36..89fe7ddf75 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -119,14 +119,11 @@ public: explicit ExplodedNode(const ProgramPoint &loc, ProgramStateRef state, bool IsSink) : Location(loc), State(state) { - const_cast<ProgramState*>(State)->incrementReferenceCount(); if (IsSink) Succs.setFlag(); } - ~ExplodedNode() { - const_cast<ProgramState*>(State)->decrementReferenceCount(); - } + ~ExplodedNode() {} /// getLocation - Returns the edge associated with the given node. ProgramPoint getLocation() const { return Location; } @@ -156,7 +153,7 @@ public: ProgramStateRef state, bool IsSink) { ID.Add(Loc); - ID.AddPointer(state); + ID.AddPointer(state.getPtr()); ID.AddBoolean(IsSink); } |