forked from OSchip/llvm-project
Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
weak functions. Thanks for finding this John! llvm-svn: 16997
This commit is contained in:
parent
1f864b5583
commit
5d33e8e73a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue