r331176 - Remove unnecessary indirection. No behavior change.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 30 06:47:04 PDT 2018


Author: nico
Date: Mon Apr 30 06:47:04 2018
New Revision: 331176

URL: http://llvm.org/viewvc/llvm-project?rev=331176&view=rev
Log:
Remove unnecessary indirection. No behavior change.

Modified:
    cfe/trunk/lib/Driver/ToolChains/MSVC.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/MSVC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSVC.cpp?rev=331176&r1=331175&r2=331176&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/MSVC.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/MSVC.cpp Mon Apr 30 06:47:04 2018
@@ -31,13 +31,7 @@
 #include "llvm/Support/Process.h"
 #include <cstdio>
 
-// Include the necessary headers to interface with the Windows registry and
-// environment.
-#if defined(_WIN32)
-#define USE_WIN32
-#endif
-
-#ifdef USE_WIN32
+#ifdef _WIN32
   #define WIN32_LEAN_AND_MEAN
   #define NOGDI
   #ifndef NOMINMAX
@@ -476,7 +470,7 @@ void visualstudio::Linker::ConstructJob(
     // their own link.exe which may come first.
     linkPath = FindVisualStudioExecutable(TC, "link.exe");
 
-#ifdef USE_WIN32
+#ifdef _WIN32
     // When cross-compiling with VS2017 or newer, link.exe expects to have
     // its containing bin directory at the top of PATH, followed by the
     // native target bin directory.
@@ -841,7 +835,7 @@ MSVCToolChain::getSubDirectoryPath(SubDi
   return Path.str();
 }
 
-#ifdef USE_WIN32
+#ifdef _WIN32
 static bool readFullStringValue(HKEY hkey, const char *valueName,
                                 std::string &value) {
   std::wstring WideValueName;
@@ -885,7 +879,7 @@ static bool readFullStringValue(HKEY hke
 /// characters are compared.  This function only searches HKLM.
 static bool getSystemRegistryString(const char *keyPath, const char *valueName,
                                     std::string &value, std::string *phValue) {
-#ifndef USE_WIN32
+#ifndef _WIN32
   return false;
 #else
   HKEY hRootKey = HKEY_LOCAL_MACHINE;
@@ -967,7 +961,7 @@ static bool getSystemRegistryString(cons
     }
   }
   return returnValue;
-#endif // USE_WIN32
+#endif // _WIN32
 }
 
 // Find the most recent version of Universal CRT or Windows 10 SDK.
@@ -1128,7 +1122,7 @@ static VersionTuple getMSVCVersionFromTr
 
 static VersionTuple getMSVCVersionFromExe(const std::string &BinDir) {
   VersionTuple Version;
-#ifdef USE_WIN32
+#ifdef _WIN32
   SmallString<128> ClExe(BinDir);
   llvm::sys::path::append(ClExe, "cl.exe");
 




More information about the cfe-commits mailing list