summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-11 22:11:16 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-11 22:11:16 +0000
commit803f48bcd11206cc4a7d6b6aba2a710bc57c8e5e (patch)
treeafbd0ace880519c22977b292e6c497c5da2ad798 /llvm/lib/CodeGen/LiveDebugVariables.cpp
parente45d68589537e6d2ce377de97445f6c7a789e29a (diff)
downloadbcm5719-llvm-803f48bcd11206cc4a7d6b6aba2a710bc57c8e5e.tar.gz
bcm5719-llvm-803f48bcd11206cc4a7d6b6aba2a710bc57c8e5e.zip
Don't insert DBG_VALUE instructions after the first terminator.
For one, MachineBasicBlock::getFirstTerminator() doesn't understand what is happening, and it also makes sense to have all control flow run through the DBG_VALUE. llvm-svn: 123277
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index da4b017cdca..9a67a630b54 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -587,6 +587,13 @@ findInsertLocation(MachineBasicBlock *MBB, SlotIndex Idx, DebugLoc &DL,
SlotIndex Start = LIS.getMBBStartIdx(MBB);
Idx = Idx.getBaseIndex();
+ // Don't insert anything after the first terminator.
+ MachineBasicBlock::iterator Term = MBB->getFirstTerminator();
+ if (Term != MBB->end() && Idx >= LIS.getInstructionIndex(Term)) {
+ DL = Term->getDebugLoc();
+ return Term;
+ }
+
// Try to find an insert location by going backwards from Idx.
MachineInstr *MI;
while (!(MI = LIS.getInstructionFromIndex(Idx))) {
OpenPOWER on IntegriCloud