Teach AnalyzeBranch, RemoveBranch and the branch
[oota-llvm.git] / lib / Target / PIC16 / PIC16InstrInfo.cpp
index 2fb405e947ff8c80dd41172b7c151854d4526a10..da16e8383c31c77180d219858faefde20378a3e5 100644 (file)
@@ -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) {