1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

ThinLTOCodeGenerator: handle std::error_code instead of silently dropping it.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269541
This commit is contained in:
Mehdi Amini 2016-05-14 04:58:38 +00:00
parent cd8ee7b56a
commit a08e32bab1

View File

@ -502,7 +502,11 @@ public:
OS << OutputBuffer.getBuffer();
}
// Rename to final destination (hopefully race condition won't matter here)
sys::fs::rename(TempFilename, EntryPath);
EC = sys::fs::rename(TempFilename, EntryPath);
if (EC) {
errs() << "Error: " << EC.message() << "\n";
report_fatal_error("ThinLTO: Can't rename temporary file " + TempFilename + " to " + EntryPath);
}
}
};