Fix bug where use still existed in dead code

llvm-svn: 5824
This commit is contained in:
Chris Lattner 2003-04-21 19:15:26 +00:00
parent 4b462c0f99
commit 46371cc500
1 changed files with 2 additions and 0 deletions

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);
}