[COFF] Print the file name on errors writing the pdb file

This avoids confusing contextless error messages such as "No such file
or directory" if e.g. the pdb output file should be written to a
nonexistent directory. (This can happen with linkrepro scripts, at least
old ones.)

Differential Revision: https://reviews.llvm.org/D66466

llvm-svn: 369425
This commit is contained in:
Martin Storsjo 2019-08-20 18:56:48 +00:00
parent 1271521ed8
commit 8a91aa53a0
1 changed files with 1 additions and 0 deletions

View File

@ -1693,6 +1693,7 @@ void PDBLinker::addSections(ArrayRef<OutputSection *> outputSections,
}
void PDBLinker::commit(codeview::GUID *guid) {
ExitOnError exitOnErr((config->pdbPath + ": ").str());
// Write to a file.
exitOnErr(builder.commit(config->pdbPath, guid));
}