[llvm-commits] [llvm] r136842 - /llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Aug 3 16:44:31 PDT 2011


Author: stoklund
Date: Wed Aug  3 18:44:31 2011
New Revision: 136842

URL: http://llvm.org/viewvc/llvm-project?rev=136842&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp

Modified: llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp?rev=136842&r1=136841&r2=136842&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp Wed Aug  3 18:44:31 2011
@@ -179,6 +179,9 @@
     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





More information about the llvm-commits mailing list