An even better fix.

llvm-svn: 35998
This commit is contained in:
Jeff Cohen 2007-04-14 17:18:29 +00:00
parent a9aad5685b
commit 4bd0fd367a
1 changed files with 2 additions and 3 deletions

View File

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