[ELF] --warn-backrefs: save the referenced InputFile *
authorFangrui Song <i@maskray.me>
Thu, 22 Oct 2020 22:26:52 +0000 (15:26 -0700)
committerFangrui Song <i@maskray.me>
Thu, 22 Oct 2020 22:27:19 +0000 (15:27 -0700)
commitce3c5dae06566eb3ae31e44a459cc8c9cb9e060d
treef0e2b7c81b5e1d2ed9630ff798b7ddff326bc793
parent3fbf9d10fdf21abedfd68bf53ad7098c00c6850c
[ELF] --warn-backrefs: save the referenced InputFile *

For a diagnostic `A refers to B` where B refers to a bitcode file, if the
symbol gets optimized out, the user may see `A refers to <internal>`; if the
symbol is retained, the user may see `A refers to lto.tmp`.

Save the reference InputFile * in the DenseMap so that the original filename is
available in reportBackrefs().
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/test/ELF/lto/warn-backrefs.ll [new file with mode: 0644]