[lld] r317536 - Use Path instead of Config->OutputFile. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 18:00:51 PST 2017


Author: rafael
Date: Mon Nov  6 18:00:51 2017
New Revision: 317536

URL: http://llvm.org/viewvc/llvm-project?rev=317536&view=rev
Log:
Use Path instead of Config->OutputFile. NFC.

This function is always called with Config->OutputFile. That is not
obvious from reading the function. It should always use Path or take
no argument and always use Config->OutputFile.

Modified:
    lld/trunk/ELF/Filesystem.cpp

Modified: lld/trunk/ELF/Filesystem.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Filesystem.cpp?rev=317536&r1=317535&r2=317536&view=diff
==============================================================================
--- lld/trunk/ELF/Filesystem.cpp (original)
+++ lld/trunk/ELF/Filesystem.cpp Mon Nov  6 18:00:51 2017
@@ -38,8 +38,8 @@ using namespace lld::elf;
 // This function spawns a background thread to call unlink.
 // The calling thread returns almost immediately.
 void elf::unlinkAsync(StringRef Path) {
-  if (!ThreadsEnabled || !sys::fs::exists(Config->OutputFile) ||
-      !sys::fs::is_regular_file(Config->OutputFile))
+  if (!ThreadsEnabled || !sys::fs::exists(Path) ||
+      !sys::fs::is_regular_file(Path))
     return;
 
   // First, rename Path to avoid race condition. We cannot remove




More information about the llvm-commits mailing list