forked from OSchip/llvm-project
Fix bug where use still existed in dead code
llvm-svn: 5824
This commit is contained in:
parent
4b462c0f99
commit
46371cc500
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue