1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[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
This commit is contained in:
Eli Friedman 2016-11-07 23:43:07 +00:00
parent acf03cea42
commit cded552ec7

View File

@ -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;