Use location entry only of the location described by DBG_VALUE is valid.
authorDevang Patel <dpatel@apple.com>
Wed, 4 Aug 2010 22:07:27 +0000 (22:07 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 4 Aug 2010 22:07:27 +0000 (22:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110255 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index ac58f7a6bd53b5e3324d921a886e3449c2f1a76e..1b84442181b280dc92cd8c147e14ffb14e169554 100644 (file)
@@ -2315,7 +2315,9 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
 
       const MCSymbol *FLabel = getLabelBeforeInsn(Begin);
       const MCSymbol *SLabel = getLabelBeforeInsn(End);
-      DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc));
+      if (MLoc.getReg())
+        DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc));
+
       Begin = End;
       if (MVI + 1 == MVE) {
         // If End is the last instruction then its value is valid
@@ -2326,8 +2328,9 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
           EMLoc.set(Begin->getOperand(0).getReg(), Begin->getOperand(1).getImm());
         } else
           EMLoc = Asm->getDebugValueLocation(End);
-        DotDebugLocEntries.
-          push_back(DotDebugLocEntry(SLabel, FunctionEndSym, EMLoc));
+        if (EMLoc.getReg()) 
+          DotDebugLocEntries.
+            push_back(DotDebugLocEntry(SLabel, FunctionEndSym, EMLoc));
       }
     }
     DotDebugLocEntries.push_back(DotDebugLocEntry());