diff options
author | Dan Gohman <gohman@apple.com> | 2009-12-05 00:23:29 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-12-05 00:23:29 +0000 |
commit | abc77742c80d6fd11ac1b0bf03a067dd4457da17 (patch) | |
tree | baec0a2827694c9e2a3afba91a91b1b5b166a951 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 33004b6302ad775044e89043ed81adbfe8cc4e89 (diff) | |
download | bcm5719-llvm-abc77742c80d6fd11ac1b0bf03a067dd4457da17.tar.gz bcm5719-llvm-abc77742c80d6fd11ac1b0bf03a067dd4457da17.zip |
Fix this code to use DIScope instead of DICompileUnit, as in r90181.
Don't print "SrcLine"; just print the filename and line number, which
is obvious enough and more informative.
llvm-svn: 90631
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 5e54e6781e6..a8f164cd9c2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1837,15 +1837,16 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const { // Print source line info. O.PadToColumn(MAI->getCommentColumn()); - O << MAI->getCommentString() << " SrcLine "; - if (DLT.Scope) { - DICompileUnit CU(DLT.Scope); - if (!CU.isNull()) - O << CU.getFilename() << " "; - } - O << DLT.Line; + O << MAI->getCommentString() << ' '; + DIScope Scope(DLT.Scope); + // Omit the directory, because it's likely to be long and uninteresting. + if (!Scope.isNull()) + O << Scope.getFilename(); + else + O << "<unknown>"; + O << ':' << DLT.Line; if (DLT.Col != 0) - O << ":" << DLT.Col; + O << ':' << DLT.Col; Newline = true; } |