diff options
author | Reid Kleckner <rnk@google.com> | 2017-09-18 21:31:48 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-09-18 21:31:48 +0000 |
commit | 1aa4ea8104dd64933ca88133aefdf7ab75c9797c (patch) | |
tree | e0e36a1916195830eeffdf9a186f8d0bcbaf751a /llvm/lib/Transforms | |
parent | 0ac9524c9924636834f8a2058e81e95f334c440d (diff) | |
download | bcm5719-llvm-1aa4ea8104dd64933ca88133aefdf7ab75c9797c.tar.gz bcm5719-llvm-1aa4ea8104dd64933ca88133aefdf7ab75c9797c.zip |
[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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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; |