[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalDCE.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Sep 14 23:53:02 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

GlobalDCE.cpp updated: 1.25 -> 1.26

---
Log message:

Ugh, a bug fix needed because of the bug in the CallGraph code


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp
diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.25 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.26
--- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.25	Thu Aug  7 09:43:13 2003
+++ llvm/lib/Transforms/IPO/GlobalDCE.cpp	Sun Sep 14 23:52:00 2003
@@ -56,9 +56,11 @@
     // 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;
   }
   





More information about the llvm-commits mailing list