From f0cd4722bfb8fe9ac105f4fed54441b054781573 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 18 Jul 2002 04:43:20 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2959 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/GlobalDCE.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index d69a998cb04..4edfb3950ea 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -29,9 +29,10 @@ static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) { std::vector 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::iterator I = FunctionsToDelete.begin(), E = FunctionsToDelete.end(); I != E; ++I) - delete CallGraph.removeMethodFromModule(*I); + delete CallGraph.removeFunctionFromModule(*I); return true; }