summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-04-02 01:38:09 +0000
committerDale Johannesen <dalej@apple.com>2010-04-02 01:38:09 +0000
commit4244d12769ff19cc917ac39ee450a12bbcfeccfb (patch)
treea73cbf2711c72627e31eee0ca4e370c63a0a177b /llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
parent8d6d0d4c5866268c202389487e49626181a340f1 (diff)
downloadbcm5719-llvm-4244d12769ff19cc917ac39ee450a12bbcfeccfb.tar.gz
bcm5719-llvm-4244d12769ff19cc917ac39ee450a12bbcfeccfb.zip
Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the branch(es) at the end of a block. llvm-svn: 100168
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430InstrInfo.cpp')
-rw-r--r--llvm/lib/Target/MSP430/MSP430InstrInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
index 63724823f56..e584770dd49 100644
--- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
+++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
@@ -173,6 +173,8 @@ unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
while (I != MBB.begin()) {
--I;
+ if (I->isDebugValue())
+ continue;
if (I->getOpcode() != MSP430::JMP &&
I->getOpcode() != MSP430::JCC)
break;
@@ -241,6 +243,9 @@ bool MSP430InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I = MBB.end();
while (I != MBB.begin()) {
--I;
+ if (I->isDebugValue())
+ continue;
+
// Working from the bottom, when we see a non-terminator
// instruction, we're done.
if (!isUnpredicatedTerminator(I))
OpenPOWER on IntegriCloud