summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-13 05:03:01 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-13 05:03:01 +0000
commit6d7aee6eddc6ddcd333cf5878985cdad73d63ec9 (patch)
tree2619cf2fa6c17ac7d4ccd017270d44da837f1342
parenteb370bc386bd8957f8d4d030b7dbfbb6cb7ad1ff (diff)
downloadbcm5719-llvm-6d7aee6eddc6ddcd333cf5878985cdad73d63ec9.tar.gz
bcm5719-llvm-6d7aee6eddc6ddcd333cf5878985cdad73d63ec9.zip
Added node cleanup to dstor of ExplodedGraph.
llvm-svn: 45929
-rw-r--r--clang/include/clang/Analysis/PathSensitive/ExplodedGraph.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/clang/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index fbd0a24415f..347c9e6f4f9 100644
--- a/clang/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/clang/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -23,7 +23,6 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/DepthFirstIterator.h"
-#include <vector>
namespace clang {
@@ -159,7 +158,7 @@ protected:
friend class GREngineImpl;
// Type definitions.
- typedef llvm::DenseMap<ProgramPoint,void*> EdgeNodeSetMap;
+ typedef llvm::DenseMap<ProgramPoint,void*> EdgeNodeSetMap;
typedef llvm::SmallVector<ExplodedNodeImpl*,2> RootsTy;
typedef llvm::SmallVector<ExplodedNodeImpl*,10> EndNodesTy;
@@ -204,7 +203,7 @@ protected:
}
public:
- virtual ~ExplodedGraphImpl() {};
+ virtual ~ExplodedGraphImpl();
unsigned num_roots() const { return Roots.size(); }
unsigned num_eops() const { return EndNodes.size(); }
@@ -232,8 +231,16 @@ public:
// 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)
- delete reinterpret_cast<llvm::FoldingSet<NodeTy>*>(I->second);
+ for (EdgeNodeSetMap::iterator I=Nodes.begin(), E=Nodes.end(); I!=E; ++I) {
+ llvm::FoldingSet<NodeTy>* ENodes =
+ reinterpret_cast<llvm::FoldingSet<NodeTy>*>(I->second);
+
+ for (typename llvm::FoldingSet<NodeTy>::iterator
+ I=ENodes->begin(), E=ENodes->end(); I!=E; ++I)
+ delete *I;
+
+ delete ENodes;
+ }
}
/// getCheckerState - Returns the internal checker state associated
OpenPOWER on IntegriCloud