<div dir="ltr"><div dir="ltr">Hello Nico,<br><br>This commit broke tests to couple of our win builders:<br><br><a href="http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/33438">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/33438</a><br><a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast</a><br>. . . <br>Failing Tests (1):<br> lld :: COFF/conflict-mangled.test<br><br>Please have a look ASAP?<br><br>Thanks<br><br>Galina<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 4:01 PM Nico Weber via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: nico<br>
Date: Mon Mar 11 16:02:18 2019<br>
New Revision: 355878<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=355878&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=355878&view=rev</a><br>
Log:<br>
lld-link: Only print demangled symbol names by default<br>
<br>
This makes lld-link's output a bit more concise. Since most developers can't<br>
read mangled names, this should make the output a bit easier to understand as<br>
well. It also makes lld-link's output consistent with ld.lld's output.<br>
<br>
(link.exe prints both demangled and mangled names; lld-link used to match<br>
link.exe output but now no longer does.)<br>
<br>
For people working on toolchains, add a `/demangle:no` flag that makes lld-link<br>
print the mangled name instead of the demangled name. (If desired, people could<br>
pipe that through `demumble -b` to get the old behavior of both demangled and<br>
mangled output.)<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D58132" rel="noreferrer" target="_blank">https://reviews.llvm.org/D58132</a><br>
<br>
Modified:<br>
lld/trunk/COFF/Config.h<br>
lld/trunk/COFF/Driver.cpp<br>
lld/trunk/COFF/Options.td<br>
lld/trunk/COFF/Symbols.cpp<br>
lld/trunk/test/COFF/undefined-symbol-cv.s<br>
lld/trunk/test/COFF/undefined-symbol.s<br>
<br>
Modified: lld/trunk/COFF/Config.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.h?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.h?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/COFF/Config.h (original)<br>
+++ lld/trunk/COFF/Config.h Mon Mar 11 16:02:18 2019<br>
@@ -90,6 +90,7 @@ struct Configuration {<br>
bool NoEntry = false;<br>
std::string OutputFile;<br>
std::string ImportName;<br>
+ bool Demangle = true;<br>
bool DoGC = true;<br>
bool DoICF = true;<br>
bool TailMerge;<br>
<br>
Modified: lld/trunk/COFF/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/COFF/Driver.cpp (original)<br>
+++ lld/trunk/COFF/Driver.cpp Mon Mar 11 16:02:18 2019<br>
@@ -1081,6 +1081,9 @@ void LinkerDriver::link(ArrayRef<const c<br>
Config->Incremental = true;<br>
}<br>
<br>
+ // Handle /demangle<br>
+ Config->Demangle = Args.hasFlag(OPT_demangle, OPT_demangle_no);<br>
+<br>
// Handle /debugtype<br>
Config->DebugTypes = parseDebugTypes(Args);<br>
<br>
<br>
Modified: lld/trunk/COFF/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Options.td?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Options.td?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/COFF/Options.td (original)<br>
+++ lld/trunk/COFF/Options.td Mon Mar 11 16:02:18 2019<br>
@@ -154,6 +154,9 @@ def help_q : Flag<["/?", "-?"], "">, Ali<br>
// LLD extensions<br>
def exclude_all_symbols : F<"exclude-all-symbols">;<br>
def export_all_symbols : F<"export-all-symbols">;<br>
+defm demangle : B<"demangle",<br>
+ "Demangle symbols in output (default)",<br>
+ "Do not demangle symbols in output">;<br>
def kill_at : F<"kill-at">;<br>
def lldmingw : F<"lldmingw">;<br>
def output_def : Joined<["/", "-"], "output-def:">;<br>
@@ -178,11 +181,6 @@ def show_timing : F<"time">;<br>
<br>
class QF<string name> : Joined<["/", "-", "-?"], name#":">;<br>
<br>
-multiclass QB<string name> {<br>
- def "" : F<name>;<br>
- def _no : F<name#":no">;<br>
-}<br>
-<br>
def ignoreidl : F<"ignoreidl">;<br>
def nologo : F<"nologo">;<br>
def throwingnew : F<"throwingnew">;<br>
<br>
Modified: lld/trunk/COFF/Symbols.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.cpp?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.cpp?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/COFF/Symbols.cpp (original)<br>
+++ lld/trunk/COFF/Symbols.cpp Mon Mar 11 16:02:18 2019<br>
@@ -18,10 +18,13 @@<br>
using namespace llvm;<br>
using namespace llvm::object;<br>
<br>
+using namespace lld::coff;<br>
+<br>
// Returns a symbol name for an error message.<br>
std::string lld::toString(coff::Symbol &B) {<br>
- if (Optional<std::string> S = lld::demangleMSVC(B.getName()))<br>
- return ("\"" + *S + "\" (" + B.getName() + ")").str();<br>
+ if (Config->Demangle)<br>
+ if (Optional<std::string> S = lld::demangleMSVC(B.getName()))<br>
+ return *S;<br>
return B.getName();<br>
}<br>
<br>
<br>
Modified: lld/trunk/test/COFF/undefined-symbol-cv.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol-cv.s?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol-cv.s?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/COFF/undefined-symbol-cv.s (original)<br>
+++ lld/trunk/test/COFF/undefined-symbol-cv.s Mon Mar 11 16:02:18 2019<br>
@@ -2,19 +2,19 @@<br>
# RUN: llvm-mc -triple=x86_64-windows-msvc -filetype=obj -o %t.obj %s<br>
# RUN: not lld-link /out:%t.exe %t.obj 2>&1 | FileCheck %s<br>
<br>
-# CHECK: error: undefined symbol: "int __cdecl foo(void)" (?foo@@YAHXZ)<br>
+# CHECK: error: undefined symbol: int __cdecl foo(void)<br>
# CHECK-NEXT: >>> referenced by file1.cpp:1<br>
# CHECK-NEXT: >>> {{.*}}.obj:(main)<br>
# CHECK-NEXT: >>> referenced by file1.cpp:2<br>
# CHECK-NEXT: >>> {{.*}}.obj:(main)<br>
# CHECK-EMPTY:<br>
-# CHECK-NEXT: error: undefined symbol: "int __cdecl bar(void)" (?bar@@YAHXZ)<br>
+# CHECK-NEXT: error: undefined symbol: int __cdecl bar(void)<br>
# CHECK-NEXT: >>> referenced by file2.cpp:3<br>
# CHECK-NEXT: >>> {{.*}}.obj:(main)<br>
# CHECK-NEXT: >>> referenced by file1.cpp:4<br>
# CHECK-NEXT: >>> {{.*}}.obj:(f1)<br>
# CHECK-EMPTY:<br>
-# CHECK-NEXT: error: undefined symbol: "int __cdecl baz(void)" (?baz@@YAHXZ)<br>
+# CHECK-NEXT: error: undefined symbol: int __cdecl baz(void)<br>
# CHECK-NEXT: >>> referenced by file1.cpp:5<br>
# CHECK-NEXT: >>> {{.*}}.obj:(f2)<br>
<br>
<br>
Modified: lld/trunk/test/COFF/undefined-symbol.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol.s?rev=355878&r1=355877&r2=355878&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/undefined-symbol.s?rev=355878&r1=355877&r2=355878&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/COFF/undefined-symbol.s (original)<br>
+++ lld/trunk/test/COFF/undefined-symbol.s Mon Mar 11 16:02:18 2019<br>
@@ -1,16 +1,22 @@<br>
# REQUIRES: x86<br>
# RUN: llvm-mc -triple=x86_64-windows-msvc -filetype=obj -o %t.obj %s<br>
# RUN: not lld-link /out:%t.exe %t.obj 2>&1 | FileCheck %s<br>
+# RUN: not lld-link /out:%t.exe /demangle %t.obj 2>&1 | FileCheck %s<br>
+# RUN: not lld-link /out:%t.exe /demangle:no %t.obj 2>&1 | FileCheck --check-prefix=NODEMANGLE %s<br>
<br>
-# CHECK: error: undefined symbol: "int __cdecl foo(void)" (?foo@@YAHXZ)<br>
+# NODEMANGLE: error: undefined symbol: ?foo@@YAHXZ<br>
+# NODEMANGLE: error: undefined symbol: ?bar@@YAHXZ<br>
+# NODEMANGLE: error: undefined symbol: __imp_?baz@@YAHXZ<br>
+<br>
+# CHECK: error: undefined symbol: int __cdecl foo(void)<br>
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)<br>
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)<br>
# CHECK-EMPTY:<br>
-# CHECK-NEXT: error: undefined symbol: "int __cdecl bar(void)" (?bar@@YAHXZ)<br>
+# CHECK-NEXT: error: undefined symbol: int __cdecl bar(void)<br>
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(main)<br>
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(f1)<br>
# CHECK-EMPTY:<br>
-# CHECK-NEXT: error: undefined symbol: "__declspec(dllimport) int __cdecl baz(void)" (__imp_?baz@@YAHXZ)<br>
+# CHECK-NEXT: error: undefined symbol: __declspec(dllimport) int __cdecl baz(void)<br>
# CHECK-NEXT: >>> referenced by {{.*}}.obj:(f2)<br>
<br>
.section .text,"xr",one_only,main<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>