summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalDCE.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-18 04:43:20 +0000
committerChris Lattner <sabre@nondot.org>2002-07-18 04:43:20 +0000
commit6f21961d679dbda4916fc933063e2dfb155466b8 (patch)
treee91225c73acf2eaf6741a5cf13c34eab5938f093 /llvm/lib/Transforms/IPO/GlobalDCE.cpp
parent79b0c7d016bffa510f8f8adfbb9c6a63a5bb2d3c (diff)
downloadbcm5719-llvm-6f21961d679dbda4916fc933063e2dfb155466b8.tar.gz
bcm5719-llvm-6f21961d679dbda4916fc933063e2dfb155466b8.zip
*** empty log message ***
llvm-svn: 2959
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalDCE.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalDCE.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
index d69a998cb04..4edfb3950ea 100644
--- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
@@ -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;
}
OpenPOWER on IntegriCloud