From 1aa4ea8104dd64933ca88133aefdf7ab75c9797c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 18 Sep 2017 21:31:48 +0000 Subject: [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 --- llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 56d0f5e983c..b2033536ac8 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -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; -- cgit v1.2.3