An even better fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2007-04-14 17:18:29 +00:00
parent 15855a1d28
commit 98a72203d7

View File

@ -65,9 +65,8 @@ bool ConstantMerge::runOnModule(Module &M) {
// If this GV is dead, remove it. // If this GV is dead, remove it.
GV->removeDeadConstantUsers(); GV->removeDeadConstantUsers();
if (GV->use_empty() && GV->hasInternalLinkage()) { if (GV->use_empty() && GV->hasInternalLinkage()) {
(GV++)->eraseFromParent(); GV->eraseFromParent();
if (GV == E) continue;
break;
} }
// Only process constants with initializers. // Only process constants with initializers.