mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
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:
@ -168,6 +168,8 @@ void PromoteMem2Reg::run() {
|
|||||||
//
|
//
|
||||||
while (!I->use_empty()) {
|
while (!I->use_empty()) {
|
||||||
Instruction *U = cast<Instruction>(I->use_back());
|
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);
|
U->getParent()->getInstList().erase(U);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user