diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-09-10 20:38:14 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-09-10 20:38:14 +0000 |
| commit | 2158052ac460e4e0559b57dfdac76079c4c49485 (patch) | |
| tree | 5a96f42bfec18e71efbc6dd3b3b166268caf1790 /llvm/lib | |
| parent | 630d2954bee8a65ccacf030e3b78adb77ccd3d0e (diff) | |
| download | bcm5719-llvm-2158052ac460e4e0559b57dfdac76079c4c49485.tar.gz bcm5719-llvm-2158052ac460e4e0559b57dfdac76079c4c49485.zip | |
Unwind instructions are intrinsically alive, just like returns
llvm-svn: 8462
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index ffb57d0d6ae..0efdbf4b0f6 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -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)) { |

