[llvm] r286177 - [LTO] Add error message on IO error in compileOptimizedToFile.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 15:43:07 PST 2016


Author: efriedma
Date: Mon Nov  7 17:43:07 2016
New Revision: 286177

URL: http://llvm.org/viewvc/llvm-project?rev=286177&view=rev
Log:
[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


Modified:
    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp

Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=286177&r1=286176&r2=286177&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Mon Nov  7 17:43:07 2016
@@ -257,6 +257,8 @@ bool LTOCodeGenerator::compileOptimizedT
   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;




More information about the llvm-commits mailing list