Don't print the debug directory; it's often long and uninteresting. Omit
authorDan Gohman <gohman@apple.com>
Sat, 5 Dec 2009 00:20:51 +0000 (00:20 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 5 Dec 2009 00:20:51 +0000 (00:20 +0000)
the column number if it is not known. Handle the case of a missing filename
better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index 2cafbd418f337fb188b318dfa2f0b9eb1fef535c..3f4a92804c45fd5542a40310fb1d61e78ce80def 100644 (file)
@@ -1166,9 +1166,14 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const {
     DebugLocTuple DLT = MF->getDebugLocTuple(debugLoc);
     DIScope Scope(DLT.Scope);
     OS << " dbg:";
+    // Omit the directory, since it's usually long and uninteresting.
     if (!Scope.isNull())
-      OS << Scope.getDirectory() << ':' << Scope.getFilename() << ':';
-    OS << DLT.Line << ":" << DLT.Col;
+      OS << Scope.getFilename();
+    else
+      OS << "<unknown>";
+    OS << ':' << DLT.Line;
+    if (DLT.Col != 0)
+      OS << ':' << DLT.Col;
   }
 
   OS << "\n";