diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-03 23:44:31 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-03 23:44:31 +0000 |
commit | 2539af600ae2dff669a52b4589680c2f93984910 (patch) | |
tree | 93c7466fb3bea5f595966eaece94182a7814fdae /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | 7de631cc4078cfef7dab5e971622e29288d86955 (diff) | |
download | llvm-2539af600ae2dff669a52b4589680c2f93984910.zip llvm-2539af600ae2dff669a52b4589680c2f93984910.tar.gz llvm-2539af600ae2dff669a52b4589680c2f93984910.tar.bz2 |
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.
llvm-svn: 136842
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 5d38c83..eb9bbac 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/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 |