[PATCH] D26371: [LTO] Add error message on IO error in compileOptimizedToFile.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 14:53:22 PST 2016


efriedma created this revision.
efriedma added a reviewer: mehdi_amini.
efriedma added a subscriber: llvm-commits.
efriedma set the repository for this revision to rL LLVM.

(No testcase because it's difficult to force an error here.)


Repository:
  rL LLVM

https://reviews.llvm.org/D26371

Files:
  lib/LTO/LTOCodeGenerator.cpp


Index: lib/LTO/LTOCodeGenerator.cpp
===================================================================
--- lib/LTO/LTOCodeGenerator.cpp
+++ lib/LTO/LTOCodeGenerator.cpp
@@ -257,6 +257,9 @@
   bool genResult = compileOptimized(&objFile.os());
   objFile.os().close();
   if (objFile.os().has_error()) {
+    std::string ErrMsg = "could not write object file: ";
+    ErrMsg += Filename;
+    emitError(ErrMsg);
     objFile.os().clear_error();
     sys::fs::remove(Twine(Filename));
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26371.77103.patch
Type: text/x-patch
Size: 502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161107/bed141c3/attachment.bin>


More information about the llvm-commits mailing list