Change the way how we print out line numbers.
LLD's error messages contain line numbers, function names or section names.
Currently they are formatter as follows.
foo.c (32): symbol 'foo' not found
foo.c (function bar): symbol 'foo' not found
foo.c (.text+0x1234): symbol 'foo' not found
This patch changes them so that they are consistent with Clang's output.
foo.c:32: symbol 'foo' not found
foo.c:(function bar): symbol 'foo' not found
foo.c:(.text+0x1234): symbol 'foo' not found
Differential Revision: https://reviews.llvm.org/D26901
llvm-svn: 287537
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 72d8148..ae16a63 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -91,7 +91,7 @@
Info);
if (Info.Line == 0)
return "";
- return Info.FileName + " (" + std::to_string(Info.Line) + ")";
+ return Info.FileName + ":" + std::to_string(Info.Line);
}
// Returns "(internal)", "foo.a(bar.o)" or "baz.o".