aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/IPO/GlobalDCE.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp
index f991229..5ce7962 100644
--- a/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/lib/Transforms/IPO/GlobalDCE.cpp
@@ -56,9 +56,11 @@ namespace {
// Walk the function list, removing prototypes for functions which are not
// used.
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (I->use_size() == 0 && I->isExternal())
+ if (I->use_size() == 0 && I->isExternal()) {
+ CallGraph[I]->removeAllCalledFunctions();
delete CallGraph.removeFunctionFromModule(I);
-
+ }
+
return true;
}