summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-03 23:44:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-03 23:44:31 +0000
commit79513ed8598bd5ebc25b0764961f326d34aaf388 (patch)
tree888059e2574833be684b3c49f19204ce35b2c82a /lib/CodeGen/LiveDebugVariables.cpp
parentfbfb806e3fe697fd8ee2a59f8fd3e0790ccf0d3c (diff)
downloadllvm-79513ed8598bd5ebc25b0764961f326d34aaf388.tar.gz
llvm-79513ed8598bd5ebc25b0764961f326d34aaf388.tar.bz2
llvm-79513ed8598bd5ebc25b0764961f326d34aaf388.tar.xz
Correctly handle multiple DBG_VALUE instructions at the same SlotIndex.
It is possible to have multiple DBG_VALUEs for the same variable: 32L TEST32rr %vreg0<kill>, %vreg0, %EFLAGS<imp-def>; GR32:%vreg0 DBG_VALUE 2, 0, !"i" DBG_VALUE %noreg, %0, !"i" When that happens, keep the last one instead of the first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--lib/CodeGen/LiveDebugVariables.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp
index 5d38c83b49..eb9bbacb7b 100644
--- a/lib/CodeGen/LiveDebugVariables.cpp
+++ b/lib/CodeGen/LiveDebugVariables.cpp
@@ -179,6 +179,9 @@ public:
LocMap::iterator I = locInts.find(Idx);
if (!I.valid() || I.start() != Idx)
I.insert(Idx, Idx.getNextSlot(), getLocationNo(LocMO));
+ else
+ // A later DBG_VALUE at the same SlotIndex overrides the old location.
+ I.setValue(getLocationNo(LocMO));
}
/// extendDef - Extend the current definition as far as possible down the