use Label->isDefined() instead of isLabelDeleted() now that we
consistently use MCSymbol and only call this predicate after
they should have been emitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98461 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 98e60a7..4b71cfe 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2615,7 +2615,8 @@
     for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
       const SrcLineInfo &LineInfo = LineInfos[i];
       unsigned LabelID = LineInfo.getLabelID();
-      if (MMI->isLabelDeleted(LabelID)) continue;
+      MCSymbol *Label = getDWLabel("label", LabelID);
+      if (!Label->isDefined()) continue; // Not emitted, in dead code.
 
       if (LineInfo.getLine() == 0) continue;
 
@@ -2638,8 +2639,8 @@
       Asm->EmitInt8(dwarf::DW_LNE_set_address); 
 
       Asm->OutStreamer.AddComment("Location label");
-      Asm->OutStreamer.EmitSymbolValue(getDWLabel("label", LabelID),
-                                       TD->getPointerSize(), 0/*AddrSpace*/);
+      Asm->OutStreamer.EmitSymbolValue(Label, TD->getPointerSize(),
+                                       0/*AddrSpace*/);
       
       // If change of source, then switch to the new source.
       if (Source != LineInfo.getSourceID()) {
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 8d633f3..000d93f 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -248,17 +248,17 @@
   for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
     const MachineMove &Move = Moves[i];
     unsigned LabelID = Move.getLabelID();
-
     // Throw out move if the label is invalid.
-    if (LabelID && MMI->isLabelDeleted(LabelID))
-      continue;
+    if (LabelID == 0) continue;
+    MCSymbol *Label = getDWLabel("label", LabelID);
+    if (!Label->isDefined()) continue; // Not emitted, in dead code.
 
     const MachineLocation &Dst = Move.getDestination();
     const MachineLocation &Src = Move.getSource();
 
     // Advance row if new location.
-    if (BaseLabel && LabelID) {
-      MCSymbol *ThisSym = getDWLabel("label", LabelID);
+    if (BaseLabel) {
+      MCSymbol *ThisSym = Label;
       if (ThisSym != BaseLabel) {
         EmitCFAByte(dwarf::DW_CFA_advance_loc4);
         EmitDifference(ThisSym, BaseLabel, true);