For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Archive/ArchiveWriter.cpp b/lib/Bytecode/Archive/ArchiveWriter.cpp
index c99d851..c3fda5f 100644
--- a/lib/Bytecode/Archive/ArchiveWriter.cpp
+++ b/lib/Bytecode/Archive/ArchiveWriter.cpp
@@ -389,7 +389,8 @@
// Create a temporary file to store the archive in
sys::Path TmpArchive = archPath;
- TmpArchive.createTemporaryFileOnDisk();
+ if (TmpArchive.createTemporaryFileOnDisk(error))
+ return false;
// Make sure the temporary gets removed if we crash
sys::RemoveFileOnSignal(TmpArchive);
@@ -452,7 +453,8 @@
// Open another temporary file in order to avoid invalidating the
// mmapped data
sys::Path FinalFilePath = archPath;
- FinalFilePath.createTemporaryFileOnDisk();
+ if (FinalFilePath.createTemporaryFileOnDisk(error))
+ return false;
sys::RemoveFileOnSignal(FinalFilePath);
std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);