[lld] r340482 - lld-link: Separate 'undefined symbol' errors with just one newline, not two.
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 16:45:05 PDT 2018
Author: nico
Date: Wed Aug 22 16:45:05 2018
New Revision: 340482
URL: http://llvm.org/viewvc/llvm-project?rev=340482&view=rev
Log:
lld-link: Separate 'undefined symbol' errors with just one newline, not two.
newline() in ErrorHandler.cpp already tries to insert newlines between messages
that contain embedded newlines, so getSymbolLocations() shouldn't return a
string that ends in a newline -- else we end up with two newlines between error
messages.
Makes lld-link's output look more like ld.lld output.
https://reviews.llvm.org/D51117
Modified:
lld/trunk/COFF/SymbolTable.cpp
lld/trunk/test/COFF/undefined-symbol-cv.s
lld/trunk/test/COFF/undefined-symbol.s
Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=340482&r1=340481&r2=340482&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Wed Aug 22 16:45:05 2018
@@ -109,7 +109,7 @@ static std::string getSymbolLocations(Ob
}
if (Locations.empty())
- return "\n>>> referenced by " + toString(File) + "\n";
+ return "\n>>> referenced by " + toString(File);
std::string Out;
llvm::raw_string_ostream OS(Out);
@@ -122,7 +122,6 @@ static std::string getSymbolLocations(Ob
if (!Loc.SymName.empty())
OS << ":(" << Loc.SymName << ')';
}
- OS << '\n';
return OS.str();
}
Modified: lld/trunk/test/COFF/undefined-symbol-cv.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol-cv.s?rev=340482&r1=340481&r2=340482&view=diff
==============================================================================
--- lld/trunk/test/COFF/undefined-symbol-cv.s (original)
+++ lld/trunk/test/COFF/undefined-symbol-cv.s Wed Aug 22 16:45:05 2018
@@ -7,14 +7,14 @@
# CHECK-NEXT: >>> {{.*}}.obj:(main)
# CHECK-NEXT: >>> referenced by file1.cpp:2
# CHECK-NEXT: >>> {{.*}}.obj:(main)
-
-# CHECK: error: undefined symbol: ?bar@@YAHXZ
+# CHECK-EMPTY:
+# CHECK-NEXT: error: undefined symbol: ?bar@@YAHXZ
# CHECK-NEXT: >>> referenced by file2.cpp:3
# CHECK-NEXT: >>> {{.*}}.obj:(main)
# CHECK-NEXT: >>> referenced by file1.cpp:4
# CHECK-NEXT: >>> {{.*}}.obj:(f1)
-
-# CHECK: error: undefined symbol: ?baz@@YAHXZ
+# CHECK-EMPTY:
+# CHECK-NEXT: error: undefined symbol: ?baz@@YAHXZ
# CHECK-NEXT: >>> referenced by file1.cpp:5
# CHECK-NEXT: >>> {{.*}}.obj:(f2)
Modified: lld/trunk/test/COFF/undefined-symbol.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol.s?rev=340482&r1=340481&r2=340482&view=diff
==============================================================================
--- lld/trunk/test/COFF/undefined-symbol.s (original)
+++ lld/trunk/test/COFF/undefined-symbol.s Wed Aug 22 16:45:05 2018
@@ -5,12 +5,12 @@
# CHECK: error: undefined symbol: ?foo@@YAHXZ
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)
-
-# CHECK: error: undefined symbol: ?bar@@YAHXZ
+# CHECK-EMPTY:
+# CHECK-NEXT: error: undefined symbol: ?bar@@YAHXZ
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(f1)
-
-# CHECK: error: undefined symbol: ?baz@@YAHXZ
+# CHECK-EMPTY:
+# CHECK-NEXT: error: undefined symbol: ?baz@@YAHXZ
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(f2)
.section .text,"xr",one_only,main
More information about the llvm-commits
mailing list