This is an archive of the discontinued LLVM Phabricator instance.

lld-link: Separate 'undefined symbol' errors with just one newline, not two.
ClosedPublic

Authored by thakis on Aug 22 2018, 11:55 AM.

Details

Reviewers
pcc
Summary

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.
Before:

lld-link: error: undefined symbol: _f
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)


lld-link: error: undefined symbol: _g
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)


lld-link: error: undefined symbol: _h
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)

After:

lld-link: error: undefined symbol: _f
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)

lld-link: error: undefined symbol: _g
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)

lld-link: error: undefined symbol: _h
>>> referenced by /Users/thakis/src/llvm-mono/test.c:4
>>>               test.obj:(_main)

Diff Detail

Event Timeline

thakis created this revision.Aug 22 2018, 11:55 AM
pcc accepted this revision.Aug 22 2018, 4:39 PM

LGTM

This revision is now accepted and ready to land.Aug 22 2018, 4:39 PM
thakis closed this revision.Aug 22 2018, 4:45 PM

r340482, thanks!