Add a createUniqueFile function and switch llvm's users of unique_file.
[oota-llvm.git] / tools / llvm-ar / ArchiveWriter.cpp
index 048748a3c9ca2bd8dbc75e2781bd5582e6bf04b4..52ce045c16c2acd55ff7de2fc3faab36f6038bfc 100644 (file)
@@ -260,8 +260,8 @@ bool Archive::writeToDisk(bool TruncateNames, std::string *ErrMsg) {
   // Create a temporary file to store the archive in
   int TmpArchiveFD;
   SmallString<128> TmpArchive;
-  error_code EC = sys::fs::unique_file("temp-archive-%%%%%%%.a", TmpArchiveFD,
-                                       TmpArchive, true, sys::fs::all_read | sys::fs::all_write);
+  error_code EC = sys::fs::createUniqueFile("temp-archive-%%%%%%%.a",
+                                            TmpArchiveFD, TmpArchive);
   if (EC)
     return true;