[PATCH] D40378: Add an F_Delete flag

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 17:59:35 PST 2017


rafael created this revision.

For now this only changes the handle Access.

This is convenient to break the patches since we need DELETE access to change the LockFileManager implementation but if this were to set the file disposition we would need to squash all the patches.


https://reviews.llvm.org/D40378

Files:
  include/llvm/Support/FileSystem.h
  lib/Support/Windows/Path.inc


Index: lib/Support/Windows/Path.inc
===================================================================
--- lib/Support/Windows/Path.inc
+++ lib/Support/Windows/Path.inc
@@ -1031,6 +1031,8 @@
   DWORD Access = GENERIC_WRITE;
   if (Flags & F_RW)
     Access |= GENERIC_READ;
+  if (Flags & F_Delete)
+    Access |= DELETE;
 
   HANDLE H =
       ::CreateFileW(PathUTF16.begin(), Access,
Index: include/llvm/Support/FileSystem.h
===================================================================
--- include/llvm/Support/FileSystem.h
+++ include/llvm/Support/FileSystem.h
@@ -683,7 +683,11 @@
   F_Text = 4,
 
   /// Open the file for read and write.
-  F_RW = 8
+  F_RW = 8,
+
+  /// The returned handle can be used for deleting the file. Only makes a
+  /// difference on windows.
+  F_Delete = 16
 };
 
 /// @brief Create a uniquely named file.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40378.124027.patch
Type: text/x-patch
Size: 848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171123/ea43fd6c/attachment.bin>


More information about the llvm-commits mailing list