Increment counter inside insertDebugValue().
authorDevang Patel <dpatel@apple.com>
Thu, 4 Aug 2011 20:42:11 +0000 (20:42 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 4 Aug 2011 20:42:11 +0000 (20:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136915 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveDebugVariables.cpp

index 096c47fac96f5f7ff4a7c4d0369d7fd05dbcd254..7174bddfb5143c53be0fb7cfe7072526b4eb8df1 100644 (file)
@@ -896,6 +896,7 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx,
                                  const TargetInstrInfo &TII) {
   MachineBasicBlock::iterator I = findInsertLocation(MBB, Idx, LIS);
   MachineOperand &Loc = locations[LocNo];
+  ++NumInsertedDebugValues;
 
   // Frame index locations may require a target callback.
   if (Loc.isFI()) {
@@ -926,7 +927,6 @@ void UserValue::emitDebugValues(VirtRegMap *VRM, LiveIntervals &LIS,
 
     DEBUG(dbgs() << " BB#" << MBB->getNumber() << '-' << MBBEnd);
     insertDebugValue(MBB, Start, LocNo, LIS, TII);
-    ++NumInsertedDebugValues;
     // This interval may span multiple basic blocks.
     // Insert a DBG_VALUE into each one.
     while(Stop > MBBEnd) {
@@ -937,7 +937,6 @@ void UserValue::emitDebugValues(VirtRegMap *VRM, LiveIntervals &LIS,
       MBBEnd = LIS.getMBBEndIdx(MBB);
       DEBUG(dbgs() << " BB#" << MBB->getNumber() << '-' << MBBEnd);
       insertDebugValue(MBB, Start, LocNo, LIS, TII);
-      ++NumInsertedDebugValues;
     }
     DEBUG(dbgs() << '\n');
     if (MBB == MFEnd)