diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 1e92318..6a1d5ee 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -1474,6 +1474,8 @@ MachineBasicBlock::findDebugLoc(instr_iterator MBBI) { } DebugLoc MachineBasicBlock::rfindDebugLoc(reverse_instr_iterator MBBI) { + if (MBBI == instr_rend()) + return findDebugLoc(instr_begin()); // Skip debug declarations, we don't want a DebugLoc from them. MBBI = skipDebugInstructionsBackward(MBBI, instr_rbegin()); if (!MBBI->isDebugInstr()) |