[llvm] r185728 - Remove unique_file now that it is unused.

Rafael Espindola rafael.espindola at gmail.com
Fri Jul 5 14:19:35 PDT 2013


Author: rafael
Date: Fri Jul  5 16:19:35 2013
New Revision: 185728

URL: http://llvm.org/viewvc/llvm-project?rev=185728&view=rev
Log:
Remove unique_file now that it is unused.

Modified:
    llvm/trunk/include/llvm/Support/FileSystem.h
    llvm/trunk/lib/Support/Path.cpp

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=185728&r1=185727&r2=185728&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Fri Jul  5 16:19:35 2013
@@ -545,36 +545,6 @@ bool status_known(file_status s);
 ///          platform specific error_code.
 error_code status_known(const Twine &path, bool &result);
 
-/// @brief Generate a unique path and open it as a file.
-///
-/// Generates a unique path suitable for a temporary file and then opens it as a
-/// file. The name is based on \a model with '%' replaced by a random char in
-/// [0-9a-f]. If \a model is not an absolute path, a suitable temporary
-/// directory will be prepended.
-///
-/// This is an atomic operation. Either the file is created and opened, or the
-/// file system is left untouched.
-///
-/// clang-%%-%%-%%-%%-%%.s => /tmp/clang-a0-b1-c2-d3-e4.s
-///
-/// @param model Name to base unique path off of.
-/// @param result_fd Set to the opened file's file descriptor.
-/// @param result_path Set to the opened file's absolute path.
-/// @param makeAbsolute If true and \a model is not an absolute path, a temp
-///        directory will be prepended.
-/// @param mode Set to the file open mode; since this is most often used for
-///        temporary files, mode defaults to owner_read | owner_write.
-/// @returns errc::success if result_{fd,path} have been successfully set,
-///          otherwise a platform specific error_code.
-error_code unique_file(const Twine &model, int &result_fd,
-                       SmallVectorImpl<char> &result_path,
-                       bool makeAbsolute = true,
-                       unsigned mode = owner_read | owner_write);
-
-/// @brief Simpler version for clients that don't want an open file.
-error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute = true);
-
 /// @brief Create a uniquely named file.
 ///
 /// Generates a unique path suitable for a temporary file and then opens it as a

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=185728&r1=185727&r2=185728&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Fri Jul  5 16:19:35 2013
@@ -637,23 +637,6 @@ bool is_relative(const Twine &path) {
 
 namespace fs {
 
-// This is a mkostemps with a different pattern. Unfortunatelly OS X (ond *BSD)
-// don't have it. We should try using mkostemps on systems that have it.
-error_code unique_file(const Twine &Model, int &ResultFD,
-                       SmallVectorImpl<char> &ResultPath, bool MakeAbsolute,
-                       unsigned Mode) {
-  return createUniqueEntity(Model, ResultFD, ResultPath, MakeAbsolute, Mode,
-                            FS_File);
-}
-
-// This is a mktemp with a differet pattern. We use createUniqueEntity mostly
-// for consistency. We should try using mktemp.
-error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute) {
-  int Dummy;
-  return createUniqueEntity(Model, Dummy, ResultPath, MakeAbsolute, 0, FS_Name);
-}
-
 error_code createUniqueFile(const Twine &Model, int &ResultFd,
                             SmallVectorImpl<char> &ResultPath, unsigned Mode) {
   return createUniqueEntity(Model, ResultFd, ResultPath, false, Mode, FS_File);





More information about the llvm-commits mailing list