public:
BasicCallGraph() : Root(0), ExternalCallingNode(0), CallsExternalNode(0) {}
- ~BasicCallGraph() { destroy(); }
// runOnModule - Compute the call graph for the specified module.
virtual bool runOnModule(Module &M) {
- destroy();
CallGraph::initialize(M);
ExternalCallingNode = getOrInsertFunction(0);
//
// destroy - Release memory for the call graph
virtual void destroy() {
+ /// CallsExternalNode is not in the function map, delete it explicitly.
delete CallsExternalNode;
CallsExternalNode = 0;
+ CallGraph::destroy();
}
};
} //End anonymous namespace
void CallGraph::initialize(Module &M) {
- destroy();
Mod = &M;
}