[PATCH] D83272: [LLD][ELF][Windows] small improvement to D82567

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 04:02:45 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6bda276f9302: [LLD][ELF][Windows] small improvement to D82567 (authored by Ben Dunbobbin <Ben.Dunbobbin at sony.com>).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83272/new/

https://reviews.llvm.org/D83272

Files:
  lld/Common/Filesystem.cpp


Index: lld/Common/Filesystem.cpp
===================================================================
--- lld/Common/Filesystem.cpp
+++ lld/Common/Filesystem.cpp
@@ -40,6 +40,9 @@
 // This function spawns a background thread to remove the file.
 // The calling thread returns almost immediately.
 void lld::unlinkAsync(StringRef path) {
+  if (!sys::fs::exists(path) || !sys::fs::is_regular_file(path))
+    return;
+
 // Removing a file is async on windows.
 #if defined(_WIN32)
   // On Windows co-operative programs can be expected to open LLD's
@@ -71,8 +74,7 @@
   }
   sys::fs::remove(path);
 #else
-  if (parallel::strategy.ThreadsRequested == 1 || !sys::fs::exists(path) ||
-      !sys::fs::is_regular_file(path))
+  if (parallel::strategy.ThreadsRequested == 1)
     return;
 
   // We cannot just remove path from a different thread because we are now going


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83272.277376.patch
Type: text/x-patch
Size: 867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200713/08907b86/attachment.bin>


More information about the llvm-commits mailing list