From fb647300058cbc67b5ca8ad32aef7ff2db33cf3b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 10 Apr 2018 13:15:21 +0000 Subject: [PATCH] s/LLVM_ON_WIN32/_WIN32/, lld 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 | 2 +- lld/ELF/Filesystem.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 02b2208160d3..6dacac531892 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -97,7 +97,7 @@ typedef std::pair, 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 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; diff --git a/lld/ELF/Filesystem.cpp b/lld/ELF/Filesystem.cpp index 8d0b5d8a2f1c..5cf240eeca56 100644 --- a/lld/ELF/Filesystem.cpp +++ b/lld/ELF/Filesystem.cpp @@ -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) ||