aboutsummaryrefslogtreecommitdiff
path: root/Analysis/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-13 05:33:04 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-13 05:33:04 +0000
commitd880c1829395f55129fee31e2df542a475ec3cd7 (patch)
treec3a946bb301138a68b5e185465b7095d2acc5cd6 /Analysis/ExplodedGraph.cpp
parent90e2280fd242b02d9829365570ba3966217cb0e0 (diff)
Moved destructor logic of templated class ExplodedGraph to non-templated
parent class ExplodedGraphImpl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Analysis/ExplodedGraph.cpp')
-rw-r--r--Analysis/ExplodedGraph.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Analysis/ExplodedGraph.cpp b/Analysis/ExplodedGraph.cpp
index 4c9f026532..61548e9b27 100644
--- a/Analysis/ExplodedGraph.cpp
+++ b/Analysis/ExplodedGraph.cpp
@@ -68,3 +68,20 @@ ExplodedNodeImpl** ExplodedNodeImpl::NodeGroup::end() const {
ExplodedNodeImpl::NodeGroup::~NodeGroup() {
if (getKind() == SizeOther) delete &getVector(getPtr());
}
+
+
+ExplodedGraphImpl::~ExplodedGraphImpl() {
+ // Delete the FoldingSet's in Nodes. Note that the contents
+ // of the FoldingSets are nodes allocated from the BumpPtrAllocator,
+ // so all of those will get nuked when that object is destroyed.
+ for (EdgeNodeSetMap::iterator I=Nodes.begin(), E=Nodes.end(); I!=E; ++I) {
+ llvm::FoldingSet<ExplodedNodeImpl>* ENodes =
+ reinterpret_cast<llvm::FoldingSet<ExplodedNodeImpl>*>(I->second);
+
+ for (llvm::FoldingSet<ExplodedNodeImpl>::iterator
+ I=ENodes->begin(), E=ENodes->end(); I!=E; ++I)
+ delete &*I;
+
+ delete ENodes;
+ }
+}