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 db8dd5515d
commit 2a16a5fae5
1 changed files with 5 additions and 1 deletions

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);
}
}
};