*** empty log message ***

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2959 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-07-18 04:43:20 +00:00
parent d99d4d7b70
commit f0cd4722bf

View File

@ -29,9 +29,10 @@ static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
std::vector<CallGraphNode*> FunctionsToDelete; // Track unused functions
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
CallGraphNode *N = CallGraph[I];
if (!ReachableNodes.count(N)) { // Not reachable??
I->dropAllReferences();
N->removeAllCalledMethods();
N->removeAllCalledFunctions();
FunctionsToDelete.push_back(N);
++NumRemoved;
}
@ -45,7 +46,7 @@ static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
//
for (std::vector<CallGraphNode*>::iterator I = FunctionsToDelete.begin(),
E = FunctionsToDelete.end(); I != E; ++I)
delete CallGraph.removeMethodFromModule(*I);
delete CallGraph.removeFunctionFromModule(*I);
return true;
}