OSDN Git Service

Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
authorChris Lattner <sabre@nondot.org>
Thu, 14 Oct 2004 19:53:50 +0000 (19:53 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Oct 2004 19:53:50 +0000 (19:53 +0000)
weak functions.  Thanks for finding this John!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16997 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/GlobalOpt.cpp

index dc8832c..e800e0c 100644 (file)
@@ -808,7 +808,8 @@ bool GlobalOpt::runOnModule(Module &M) {
     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;