Similarly to how undefined symbol diagnostics were changed in D128184,
we now show where in the source file duplicate symbols are defined at:
ld64.lld: error: duplicate symbol: _foo >> defined in bar.c:42 >> /path/to/bar.o >> defined in baz.c:1 >> /path/to/libbaz.a(baz.o)
For objects that don't contain DWARF data, the format is unchanged.
A slight difference to undefined symbol diagnostics is that we don't
print the name of the symbol on the third line, as it's already
contained on the first line.
I've requested commit access, but while I'm waiting for that, please commit this patch with the following author info:
Daniel Bertalan <dani@danielbertalan.dev>
If you use dyn_cast_or_null here, you don't need the 3 new lines above.