Skip to content

Commit

Permalink
Don't delete one more instruction than we're allowed to. This should …
Browse files Browse the repository at this point in the history
…fix the

Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160693 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
nlewycky committed Jul 24, 2012
1 parent 9669f74 commit 952f5d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,14 @@ static bool CleanupPointerRootUsers(GlobalVariable *GV) {
Dead[i].second->eraseFromParent();
Instruction *I = Dead[i].first;
do {
if (isAllocationFn(I))
break;
Instruction *J = dyn_cast<Instruction>(I->getOperand(0));
if (!J)
break;
I->eraseFromParent();
I = J;
} while (!isAllocationFn(I));
} while (1);
I->eraseFromParent();
}
}
Expand Down

0 comments on commit 952f5d5

Please sign in to comment.