Remove Path::createFileOnDisk.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 13:59:17 +0000 (13:59 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 13:59:17 +0000 (13:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183827 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc

index 4d6064ac01d5d197f40b86cbc977dcc9f17c7f5c..bc15cd3beb8dff99943ce30b8b4aebad1a5bac53 100644 (file)
@@ -458,17 +458,6 @@ namespace sys {
         std::string* ErrMsg = 0 ///< Optional place to put error messages.
       );
 
-      /// This method attempts to create a file in the file system with the same
-      /// name as the Path object. The intermediate directories must all exist
-      /// at the time this method is called. Use createDirectoriesOnDisk to
-      /// accomplish that. The created file will be empty upon return from this
-      /// function.
-      /// @returns true if the file could not be created, false otherwise.
-      /// @brief Create the file this Path refers to.
-      bool createFileOnDisk(
-        std::string* ErrMsg = 0 ///< Optional place to put error messages.
-      );
-
       /// This is like createFile except that it creates a temporary file. A
       /// unique temporary file name is generated based on the contents of
       /// \p this before the call. The new name is assigned to \p this and the
index 201a7c9a669f27ab248cac720695228ab8986d3a..39538d0e0616a350efc31da68e2e0c7b9566207f 100644 (file)
@@ -584,16 +584,6 @@ Path::createDirectoryOnDisk( bool create_parents, std::string* ErrMsg ) {
   return false;
 }
 
-bool
-Path::createFileOnDisk(std::string* ErrMsg) {
-  // Create the file
-  int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR);
-  if (fd < 0)
-    return MakeErrMsg(ErrMsg, path + ": can't create file");
-  ::close(fd);
-  return false;
-}
-
 bool
 Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) {
   // Make this into a unique file name
index 5ee1e0abf8b380b2c613f7c3d4dd1143767b3a87..b5a703a1519933d56a5f1545cf5c32908350bc56 100644 (file)
@@ -559,18 +559,6 @@ Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) {
   return false;
 }
 
-bool
-Path::createFileOnDisk(std::string* ErrMsg) {
-  // Create the file
-  HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW,
-                        FILE_ATTRIBUTE_NORMAL, NULL);
-  if (h == INVALID_HANDLE_VALUE)
-    return MakeErrMsg(ErrMsg, path + ": Can't create file: ");
-
-  CloseHandle(h);
-  return false;
-}
-
 bool
 Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
   WIN32_FILE_ATTRIBUTE_DATA fi;