summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-10-24 01:26:22 +0000
committerBob Haarman <llvm@inglorion.net>2017-10-24 01:26:22 +0000
commit9ce2d03e5421979f9f007ec01d5aa429c36822ed (patch)
treea8015bd7c4e8e0d6b30bf383027547f881a786df /llvm/lib/LTO
parent0501f97cef778f7ebdb0441a359f62dbd93ca87d (diff)
downloadbcm5719-llvm-9ce2d03e5421979f9f007ec01d5aa429c36822ed.tar.gz
bcm5719-llvm-9ce2d03e5421979f9f007ec01d5aa429c36822ed.zip
[raw_fd_ostream] report actual error in error messages
Summary: Previously, we would emit error messages like "IO failure on output stream". This change causes use to include information about what actually went wrong, e.g. "No space left on device". Reviewers: sunfish, rnk Reviewed By: rnk Subscribers: mehdi_amini, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39203 llvm-svn: 316404
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 9693a7c254c..ba5c04d5b1a 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -218,7 +218,7 @@ bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
ToolOutputFile Out(Path, EC, sys::fs::F_None);
if (EC) {
std::string ErrMsg = "could not open bitcode file for writing: ";
- ErrMsg += Path;
+ ErrMsg += Path.str() + ": " + EC.message();
emitError(ErrMsg);
return false;
}
@@ -229,7 +229,7 @@ bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
if (Out.os().has_error()) {
std::string ErrMsg = "could not write bitcode file: ";
- ErrMsg += Path;
+ ErrMsg += Path.str() + ": " + Out.os().error().message();
emitError(ErrMsg);
Out.os().clear_error();
return false;
@@ -260,7 +260,9 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
bool genResult = compileOptimized(&objFile.os());
objFile.os().close();
if (objFile.os().has_error()) {
- emitError((Twine("could not write object file: ") + Filename).str());
+ emitError((Twine("could not write object file: ") + Filename + ": " +
+ objFile.os().error().message())
+ .str());
objFile.os().clear_error();
sys::fs::remove(Twine(Filename));
return false;
OpenPOWER on IntegriCloud