use both the Mangler and the CBE's mangler for identifiers,
[oota-llvm.git] / lib / CodeGen / MachineBasicBlock.cpp
index e2ce642cfd6da8bbfd4fcfdf3dbd4ac7b63ed29e..9215bd583b59b707239acc33d9d8dc8f18e51488 100644 (file)
@@ -378,7 +378,7 @@ bool MachineBasicBlock::canFallThrough() {
   MachineBasicBlock *TBB = 0, *FBB = 0;
   SmallVector<MachineOperand, 4> Cond;
   const TargetInstrInfo *TII = getParent()->getTarget().getInstrInfo();
-  if (TII->AnalyzeBranch(*this, TBB, FBB, Cond, true)) {
+  if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) {
     // If we couldn't analyze the branch, examine the last instruction.
     // If the block doesn't end in a known control barrier, assume fallthrough
     // is possible. The isPredicable check is needed because this code can be
@@ -524,7 +524,26 @@ bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
   return MadeChange;
 }
 
+/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
+/// any DEBUG_VALUE instructions.  Return UnknownLoc if there is none.
+DebugLoc
+MachineBasicBlock::findDebugLoc(MachineBasicBlock::iterator &MBBI) {
+  DebugLoc DL;
+  MachineBasicBlock::iterator E = end();
+  if (MBBI != E) {
+    // Skip debug declarations, we don't want a DebugLoc from them.
+    MachineBasicBlock::iterator MBBI2 = MBBI;
+    while (MBBI2 != E &&
+           MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
+      MBBI2++;
+    if (MBBI2 != E)
+      DL = MBBI2->getDebugLoc();
+  }
+  return DL;
+}
+
 void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
                           bool t) {
   OS << "BB#" << MBB->getNumber();
 }
+