Fix bug where use still existed in dead code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-04-21 19:15:26 +00:00
parent c65b104309
commit 085c801dee

View File

@ -168,6 +168,8 @@ void PromoteMem2Reg::run() {
//
while (!I->use_empty()) {
Instruction *U = cast<Instruction>(I->use_back());
if (!U->use_empty()) // If uses remain in dead code segment...
U->replaceAllUsesWith(Constant::getNullValue(U->getType()));
U->getParent()->getInstList().erase(U);
}