summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2016-11-07 23:43:07 +0000
committerEli Friedman <efriedma@codeaurora.org>2016-11-07 23:43:07 +0000
commit8649fc053be167bfdf93e19c40fc9f78b3d5ebfa (patch)
tree8cfdf3c19cfc42c2fd0b3dabce8a54d062069d3c /llvm/lib
parent65d86e4fa5dd383dfebe2fc11c4cdf404c8914d2 (diff)
downloadbcm5719-llvm-8649fc053be167bfdf93e19c40fc9f78b3d5ebfa.tar.gz
bcm5719-llvm-8649fc053be167bfdf93e19c40fc9f78b3d5ebfa.zip
[LTO] Add error message on IO error in compileOptimizedToFile.
(No testcase because it's difficult to force an error here.) Differential Revision: https://reviews.llvm.org/D26371 llvm-svn: 286177
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 98ce550c7dd..ab4f9681880 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -257,6 +257,8 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
bool genResult = compileOptimized(&objFile.os());
objFile.os().close();
if (objFile.os().has_error()) {
+ Twine ErrMsg = "could not write object file: " + Filename.str();
+ emitError(ErrMsg.str());
objFile.os().clear_error();
sys::fs::remove(Twine(Filename));
return false;
OpenPOWER on IntegriCloud