Unwind instructions are intrinsically alive, just like returns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-09-10 20:38:14 +00:00
parent b884f597d6
commit 545a76ced8

View File

@ -84,8 +84,8 @@ private:
}
inline void markTerminatorLive(const BasicBlock *BB) {
DEBUG(std::cerr << "Terminat Live: " << BB->getTerminator());
markInstructionLive((Instruction*)BB->getTerminator());
DEBUG(std::cerr << "Terminator Live: " << BB->getTerminator());
markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
}
};
@ -176,7 +176,7 @@ bool ADCE::doADCE() {
BBI != BBE; ++BBI) {
BasicBlock *BB = *BBI;
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
if (II->mayWriteToMemory() || II->getOpcode() == Instruction::Ret) {
if (II->mayWriteToMemory() || isa<ReturnInst>(II) || isa<UnwindInst>(II)){
markInstructionLive(II);
++II; // Increment the inst iterator if the inst wasn't deleted
} else if (isInstructionTriviallyDead(II)) {