[gcov] Emit errors when opening the notes file fails

No time to write a test case, on to the next bug. =P

Discovered while investigating PR34659

llvm-svn: 313571
This commit is contained in:
Reid Kleckner 2017-09-18 21:31:48 +00:00
parent 0ac9524c99
commit 1aa4ea8104

View File

@ -519,6 +519,12 @@ void GCOVProfiler::emitProfileNotes() {
std::error_code EC;
raw_fd_ostream out(mangleName(CU, GCovFileType::GCNO), EC, sys::fs::F_None);
if (EC) {
Ctx->emitError(Twine("failed to open coverage notes file for writing: ") +
EC.message());
continue;
}
std::string EdgeDestinations;
unsigned FunctionIdent = 0;