aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PIC16
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
commit139dcd7aa428c188facd672b1c5a0e299b298390 (patch)
tree28f6ac48c327e656e147cb2c4b2b1ecf73ce3dbe /lib/Target/PIC16
parentd2bb6716c3e2e7c9d47a208034367e25b9333595 (diff)
downloadexternal_llvm-139dcd7aa428c188facd672b1c5a0e299b298390.zip
external_llvm-139dcd7aa428c188facd672b1c5a0e299b298390.tar.gz
external_llvm-139dcd7aa428c188facd672b1c5a0e299b298390.tar.bz2
Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the branch(es) at the end of a block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16')
-rw-r--r--lib/Target/PIC16/PIC16InstrInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/PIC16/PIC16InstrInfo.cpp b/lib/Target/PIC16/PIC16InstrInfo.cpp
index 2fb405e..da16e83 100644
--- a/lib/Target/PIC16/PIC16InstrInfo.cpp
+++ b/lib/Target/PIC16/PIC16InstrInfo.cpp
@@ -226,6 +226,11 @@ bool PIC16InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
// Get the terminator instruction.
--I;
+ while (I->isDebugValue()) {
+ if (I == MBB.begin())
+ return true;
+ --I;
+ }
// Handle unconditional branches. If the unconditional branch's target is
// successor basic block then remove the unconditional branch.
if (I->getOpcode() == PIC16::br_uncond && AllowModify) {