This is an archive of the discontinued LLVM Phabricator instance.

Change the error message format for duplicate symbols.
ClosedPublic

Authored by ruiu on Mar 30 2017, 1:15 PM.

Details

Summary

This patch is intended to improve readability of "duplicate symbol"
error messages.

Without this patch:

/ssd/clang/bin/ld.lld: error: /ssd/llvm-project/lld/ELF/Relocations.cpp:1054: duplicate symbol 'lld::elf::demangle(llvm::StringRef)'
/ssd/clang/bin/ld.lld: error: /ssd/llvm-project/lld/ELF/Strings.cpp:93: previous definition was here

With this patch:

/ssd/clang/bin/ld.lld: error: duplicate symbol: lld::elf::demangle(llvm::StringRef)
>>> defined at Strings.cpp:93 (/ssd/llvm-project/lld/ELF/Strings.cpp:93)
>>>            Strings.cpp.o:(lld::elf::demangle(llvm::StringRef)) in archive lib/liblldELF.a
>>> defined at Relocations.cpp:1054 (/ssd/llvm-project/lld/ELF/Relocations.cpp:1054)
>>>            Relocations.cpp.o:(.text+0x4C30) in archive lib/liblldELF.a

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2017-March/111459.html

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Mar 30 2017, 1:15 PM
rafael accepted this revision.Mar 31 2017, 2:02 PM

LGTM.

If we ever want to get fancier with our errors the only thing I can think of in accumulating info and printing at once during exit so that we can do things like

undefined foo, used in

>> use1
>> use2
>> use3

....

and correspondently for duplicates.

This revision is now accepted and ready to land.Mar 31 2017, 2:02 PM
This revision was automatically updated to reflect the committed changes.