change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98463 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b7cc5b3..31151f3 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1553,7 +1553,12 @@
 /// printLabel - This method prints a local label used by debug and
 /// exception handling tables.
 void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
-  MCSymbol *Sym = 
+  MCSymbol *Sym; 
+  
+  if (MI->getOperand(0).isMCSymbol())
+    Sym = MI->getOperand(0).getMCSymbol();
+  else
+    Sym =
     OutContext.GetOrCreateTemporarySymbol(Twine(MAI->getPrivateGlobalPrefix()) +
                                  "label" + Twine(MI->getOperand(0).getImm()));
   OutStreamer.EmitLabel(Sym);
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index ff0aa80..b5f7270 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -475,9 +475,15 @@
         continue;
       }
 
-      unsigned BeginLabelNo = MI->getOperand(0).getImm();
-      assert(BeginLabelNo && "Invalid label!");
-      MCSymbol *BeginLabel = getDWLabel("label", BeginLabelNo);
+      MCSymbol *BeginLabel;
+      if (MI->getOperand(0).isImm()) {
+        unsigned BeginLabelNo = MI->getOperand(0).getImm();
+        assert(BeginLabelNo && "Invalid label!");
+        BeginLabel = getDWLabel("label", BeginLabelNo);
+      } else {
+        BeginLabel = MI->getOperand(0).getMCSymbol();
+      }
+      
 
       // End of the previous try-range?
       if (BeginLabel == LastLabel)