summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-05 00:23:29 +0000
committerDan Gohman <gohman@apple.com>2009-12-05 00:23:29 +0000
commitabc77742c80d6fd11ac1b0bf03a067dd4457da17 (patch)
treebaec0a2827694c9e2a3afba91a91b1b5b166a951 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent33004b6302ad775044e89043ed81adbfe8cc4e89 (diff)
downloadbcm5719-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.cpp17
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;
}
OpenPOWER on IntegriCloud