[CodeGen] Unify printing format of debug-location in both MIR and -debug

Use "debug-location" instead of "; dbg:" in MI::print.

llvm-svn: 322936
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 1b3faba..32785de 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1425,6 +1425,15 @@
     }
   }
 
+  if (!SkipDebugLoc) {
+    if (const DebugLoc &DL = getDebugLoc()) {
+      if (!FirstOp)
+        OS << ',';
+      OS << " debug-location ";
+      DL->printAsOperand(OS, MST);
+    }
+  }
+
   bool HaveSemi = false;
   if (!memoperands_empty()) {
     if (!HaveSemi) {
@@ -1441,6 +1450,9 @@
     }
   }
 
+  if (SkipDebugLoc)
+    return;
+
   // Print debug location information.
   if (isDebugValue() && getOperand(e - 2).isMetadata()) {
     if (!HaveSemi)
@@ -1457,13 +1469,6 @@
     }
     if (isIndirectDebugValue())
       OS << " indirect";
-  } else if (SkipDebugLoc) {
-    return;
-  } else if (debugLoc && MF) {
-    if (!HaveSemi)
-      OS << ";";
-    OS << " dbg:";
-    debugLoc.print(OS);
   }
 
   OS << '\n';