From 01c9d28fece665972c9d355ae738cf3fc73d22d4 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 5 Jul 2013 21:19:35 +0000 Subject: [PATCH] Remove unique_file now that it is unused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185728 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/FileSystem.h | 30 ------------------------------ lib/Support/Path.cpp | 17 ----------------- 2 files changed, 47 deletions(-) diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index b729a992c3b..194f5f5c6a8 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -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 &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 &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 diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index 58c7c96c662..69dd6f5a71d 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -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 &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 &ResultPath, - bool MakeAbsolute) { - int Dummy; - return createUniqueEntity(Model, Dummy, ResultPath, MakeAbsolute, 0, FS_Name); -} - error_code createUniqueFile(const Twine &Model, int &ResultFd, SmallVectorImpl &ResultPath, unsigned Mode) { return createUniqueEntity(Model, ResultFd, ResultPath, false, Mode, FS_File); -- 2.34.1