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 | 545a76ced84bc327d4c5c32415a98eeb5b1159c2 (patch) | |
tree | 14a189eef394e4f0319fb70ef5218186c8115f04 /lib | |
parent | b884f597d62e8596df0b3856e9ca1b2496f81361 (diff) | |
download | external_llvm-545a76ced84bc327d4c5c32415a98eeb5b1159c2.zip external_llvm-545a76ced84bc327d4c5c32415a98eeb5b1159c2.tar.gz external_llvm-545a76ced84bc327d4c5c32415a98eeb5b1159c2.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/ADCE.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index ffb57d0..0efdbf4 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/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)) { |