Changes summary:
- Log the reason for a PDB or precompiled-OBJ load failure. The format looks like this:
lld-link: warning: Cannot use debug info for 'pdb-type-server-missing.yaml.tmp1.obj' >>> failed to load reference 'C:\src\llvm-project\build\definitely_not_found_for_sure.pdb': no such file or directory.
- Properly handle out-of-date PDB or precompiled-OBJ signature by displaying a corresponding error:
lld-link: warning: Cannot use debug info for 'pdb-type-server-invalid-signature.yaml.tmp.obj' >>> failed to load reference 'pdb-diff-cl.pdb': The signature does not match; the file(s) might be out of date.
- Slightly change behavior on PDB failure: any subsequent load attempt from another OBJ would result in the same error message being logged:
lld-link: warning: Cannot use debug info for 'pdb-type-server-missing.yaml.tmp1.obj' >>> failed to load reference 'C:\src\llvm-project\build\definitely_not_found_for_sure.pdb': no such file or directory. lld-link: warning: Cannot use debug info for 'pdb-type-server-missing.yaml.tmp2.obj' >>> failed to load reference 'C:\src\llvm-project\build\definitely_not_found_for_sure.pdb': no such file or directory.
- Slightly change behavior on PDB failure: retry with filename only if previous error was ENOENT ("no such file or directory")
- Tests: a. for native PDB errors; b. cover all the cases above.
We generally don't use std::map because it's slower than llvm::DenseMap and in most cases we don't need an ordered map (std::map is ordered). But this use may be okay because original code uses std::set. Or, we don't need to care about it at all if the number of data inserted into this map/set is small. Zach?