aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorStefan Maksimovic <stefan.maksimovic@mips.com>2018-02-09 14:03:26 +0000
committerStefan Maksimovic <stefan.maksimovic@mips.com>2018-02-09 14:03:26 +0000
commit991af7a5589347a99c42307a9cef89cb4009340f (patch)
treed9b8b17fc9a6d0032ab22bf3939eaa848a69634f /llvm/lib/CodeGen/LiveDebugVariables.cpp
parentdc66ae78c68f7a3094d4667bc103a216d2bd52ac (diff)
downloadllvm-991af7a5589347a99c42307a9cef89cb4009340f.zip
llvm-991af7a5589347a99c42307a9cef89cb4009340f.tar.gz
llvm-991af7a5589347a99c42307a9cef89cb4009340f.tar.bz2
[DebugInfo] Don't insert DEBUG_VALUE after terminators
r314974 introduced insertion of DEBUG_VALUEs after each redefinition of debug value register in the slot index range. In case the instruction redefining the debug value register was a terminator, machine verifier would complain since it enforces the rule of no non-terminator instructions following the first terminator. Differential Revision: https://reviews.llvm.org/D42801 llvm-svn: 324734
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 75e3d35..09168b6 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -1097,7 +1097,7 @@ findNextInsertLocation(MachineBasicBlock *MBB,
unsigned Reg = LocMO.getReg();
// Find the next instruction in the MBB that define the register Reg.
- while (I != MBB->end()) {
+ while (I != MBB->end() && !I->isTerminator()) {
if (!LIS.isNotInMIMap(*I) &&
SlotIndex::isEarlierEqualInstr(StopIdx, LIS.getInstructionIndex(*I)))
break;