s/LLVM_ON_WIN32/_WIN32/, lld
authorNico Weber <nicolasweber@gmx.de>
Tue, 10 Apr 2018 13:15:21 +0000 (13:15 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 10 Apr 2018 13:15:21 +0000 (13:15 +0000)
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too.  Just use the
default macro instead of a reinvented one.

See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.

llvm-svn: 329696

lld/COFF/Driver.cpp
lld/ELF/Filesystem.cpp

index 02b2208..6dacac5 100644 (file)
@@ -97,7 +97,7 @@ typedef std::pair<std::unique_ptr<MemoryBuffer>, std::error_code> MBErrPair;
 // Create a std::future that opens and maps a file using the best strategy for
 // the host platform.
 static std::future<MBErrPair> createFutureForFile(std::string Path) {
-#if LLVM_ON_WIN32
+#if _WIN32
   // On Windows, file I/O is relatively slow so it is best to do this
   // asynchronously.
   auto Strategy = std::launch::async;
index 8d0b5d8..5cf240e 100644 (file)
@@ -44,7 +44,7 @@ using namespace lld::elf;
 // The calling thread returns almost immediately.
 void elf::unlinkAsync(StringRef Path) {
 // Removing a file is async on windows.
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
   sys::fs::remove(Path);
 #else
   if (!ThreadsEnabled || !sys::fs::exists(Path) ||