Call destroy from ~BasicCallGraph.
[oota-llvm.git] / lib / Analysis / IPA / CallGraph.cpp
index 7620fd9842ccebaac9ab1d1f09e1cfe579f5d789..6c18d0d1a6442d6bee39534d4a4998d79f798eda 100644 (file)
@@ -46,12 +46,16 @@ public:
     ExternalCallingNode(0), CallsExternalNode(0) {
       initializeBasicCallGraphPass(*PassRegistry::getPassRegistry());
     }
+  ~BasicCallGraph() {
+    destroy();
+  }
 
   // runOnModule - Compute the call graph for the specified module.
   virtual bool runOnModule(Module &M) {
     CallGraph::initialize(M);
     
     ExternalCallingNode = getOrInsertFunction(0);
+    assert(!CallsExternalNode);
     CallsExternalNode = new CallGraphNode(0);
     Root = 0;