[RFC] Make lto native object file names more readable

Currently the lto native object files have names like main.exe.lto.1.obj. In PDB, those names are used as names for each compiland. Microsoft’s tools SizeBench uses those names to present to users the size of each object files. So, names like main.exe.lto.1.obj is not user friendly. I want to make it more readable by having names contains input bitcode file names. For example, path/to/bitcode1.obj → path/to/main.exe.lto.bitcode1.obj.

When lto cache is not enabled, we can easily get the bitcode file names from input. When lto cache is enabled, those cache files don’t have any information about the original bitcode file names.
I’m proposing that a extra text file can be used to keep the original bitcode file name for each cache file in the cache folder. Each line is something like: “llvmcache-{some hash}”, “path/to/bitcode1.obj”. When lld needs to use the lto cache files, it knows the original bitcode file names for each cache file and embedded them into pdb.

NVM. It’s not necessary to use a file to keep that info because we using the hash to check if a cache is hit or not and we know the mapping from input files to lto cache files already.