[PATCH] D133110: lld: Include name of output file in "failed to write output" diag
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 1 09:11:29 PDT 2022
thakis updated this revision to Diff 457298.
thakis added a comment.
fix test that only runs on windows
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133110/new/
https://reviews.llvm.org/D133110
Files:
lld/COFF/Writer.cpp
lld/ELF/Writer.cpp
lld/MachO/Writer.cpp
lld/test/ELF/link-open-file.test
lld/wasm/Writer.cpp
Index: lld/wasm/Writer.cpp
===================================================================
--- lld/wasm/Writer.cpp
+++ lld/wasm/Writer.cpp
@@ -1661,7 +1661,8 @@
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.
Index: lld/test/ELF/link-open-file.test
===================================================================
--- lld/test/ELF/link-open-file.test
+++ lld/test/ELF/link-open-file.test
@@ -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
Index: lld/MachO/Writer.cpp
===================================================================
--- lld/MachO/Writer.cpp
+++ lld/MachO/Writer.cpp
@@ -1118,7 +1118,8 @@
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() {
Index: lld/ELF/Writer.cpp
===================================================================
--- lld/ELF/Writer.cpp
+++ lld/ELF/Writer.cpp
@@ -587,7 +587,8 @@
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)));
}
}
Index: lld/COFF/Writer.cpp
===================================================================
--- lld/COFF/Writer.cpp
+++ lld/COFF/Writer.cpp
@@ -648,7 +648,8 @@
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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133110.457298.patch
Type: text/x-patch
Size: 2180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/9f9c3c36/attachment.bin>
More information about the llvm-commits
mailing list