lld: Include name of output file in "failed to write output" diag

Differential Revision: https://reviews.llvm.org/D133110
This commit is contained in:
Nico Weber 2022-09-01 10:01:54 -04:00
parent 3b44c9af8e
commit cd7ffa2e52
5 changed files with 9 additions and 5 deletions

View File

@ -648,7 +648,8 @@ void Writer::run() {
ScopedTimer t2(ctx.outputCommitTimer);
if (auto e = buffer->commit())
fatal("failed to write the output file: " + toString(std::move(e)));
fatal("failed to write output '" + buffer->getPath() +
"': " + toString(std::move(e)));
}
static StringRef getOutputSectionName(StringRef name) {

View File

@ -589,7 +589,8 @@ template <class ELFT> void Writer<ELFT>::run() {
return;
if (auto e = buffer->commit())
error("failed to write to the output file: " + toString(std::move(e)));
fatal("failed to write output '" + buffer->getPath() +
"': " + toString(std::move(e)));
}
}

View File

@ -1118,7 +1118,8 @@ void Writer::writeOutputFile() {
writeCodeSignature();
if (auto e = buffer->commit())
error("failed to write to the output file: " + toString(std::move(e)));
fatal("failed to write output '" + buffer->getPath() +
"': " + toString(std::move(e)));
}
template <class LP> void Writer::run() {

View File

@ -12,7 +12,7 @@
# RUN: %python %s %t.o 7
# RUN: not %python %s %t.o 3 2>&1 | FileCheck %s
# CHECK: error: failed to write to the output file
# CHECK: error: failed to write output '{{.*}}': {{.*}}
import contextlib
import ctypes

View File

@ -1661,7 +1661,8 @@ void Writer::run() {
return;
if (Error e = buffer->commit())
fatal("failed to write the output file: " + toString(std::move(e)));
fatal("failed to write output '" + buffer->getPath() +
"': " + toString(std::move(e)));
}
// Open a result file.