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

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 14 12:54:04 PDT 2004



Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.23 -> 1.24
---
Log message:

Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
weak functions.  Thanks for finding this John!


---
Diffs of the changes:  (+2 -1)

Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.23 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.24
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.23	Mon Oct 11 00:54:41 2004
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Thu Oct 14 14:53:50 2004
@@ -808,7 +808,8 @@
     for (Module::iterator FI = M.begin(), E = M.end(); FI != E; ) {
       Function *F = FI++;
       F->removeDeadConstantUsers();
-      if (F->use_empty() && (F->hasInternalLinkage() || F->hasWeakLinkage())) {
+      if (F->use_empty() && (F->hasInternalLinkage() ||
+                             F->hasLinkOnceLinkage())) {
         M.getFunctionList().erase(F);
         LocalChange = true;
         ++NumFnDeleted;






More information about the llvm-commits mailing list