[llvm] r269541 - ThinLTOCodeGenerator: handle std::error_code instead of silently dropping it.
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 21:58:38 PDT 2016
Author: mehdi_amini
Date: Fri May 13 23:58:38 2016
New Revision: 269541
URL: http://llvm.org/viewvc/llvm-project?rev=269541&view=rev
Log:
ThinLTOCodeGenerator: handle std::error_code instead of silently dropping it.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
Modified: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp?rev=269541&r1=269540&r2=269541&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp Fri May 13 23:58:38 2016
@@ -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);
+ }
}
};
More information about the llvm-commits
mailing list