[Lldb-commits] [lldb] r329697 - s/LLVM_ON_WIN32/_WIN32/, lldb

Nico Weber via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 10 06:33:45 PDT 2018


Author: nico
Date: Tue Apr 10 06:33:45 2018
New Revision: 329697

URL: http://llvm.org/viewvc/llvm-project?rev=329697&view=rev
Log:
s/LLVM_ON_WIN32/_WIN32/, lldb
                                                                                
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.

Modified:
    lldb/trunk/include/lldb/Host/windows/PosixApi.h
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/source/Core/ModuleList.cpp
    lldb/trunk/source/Core/PluginManager.cpp
    lldb/trunk/source/Host/common/File.cpp
    lldb/trunk/source/Host/common/MainLoop.cpp
    lldb/trunk/source/Host/common/Symbols.cpp
    lldb/trunk/source/Host/common/TCPSocket.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h
    lldb/trunk/source/Utility/FileSpec.cpp
    lldb/trunk/source/Utility/Log.cpp
    lldb/trunk/source/Utility/TildeExpressionResolver.cpp

Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original)
+++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Tue Apr 10 06:33:45 2018
@@ -11,7 +11,7 @@
 #define liblldb_Host_windows_PosixApi_h
 
 #include "llvm/Support/Compiler.h"
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
 #error "windows/PosixApi.h being #included on non Windows system!"
 #endif
 

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Apr 10 06:33:45 2018
@@ -48,7 +48,7 @@
 #include "lldb/Utility/StreamCallback.h"
 #include "lldb/Utility/StreamString.h"
 
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
 #endif
 

Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Tue Apr 10 06:33:45 2018
@@ -46,7 +46,7 @@
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/Timer.h"
 
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
 #endif
 

Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Tue Apr 10 06:33:45 2018
@@ -26,7 +26,7 @@
 #include "lldb/Utility/UUID.h"    // for UUID, operator!=, operator==
 #include "lldb/lldb-defines.h"    // for LLDB_INVALID_INDEX32
 
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
 #endif
 

Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Tue Apr 10 06:33:45 2018
@@ -17,7 +17,7 @@
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/StringList.h" // for StringList
 
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
 #endif
 

Modified: lldb/trunk/source/Host/common/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/File.cpp (original)
+++ lldb/trunk/source/Host/common/File.cpp Tue Apr 10 06:33:45 2018
@@ -100,7 +100,7 @@ int File::GetDescriptor() const {
   // Don't open the file descriptor if we don't need to, just get it from the
   // stream if we have one.
   if (StreamIsValid()) {
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
     return _fileno(m_stream);
 #else
     return fileno(m_stream);

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 10 06:33:45 2018
@@ -26,7 +26,7 @@
 
 #if HAVE_SYS_EVENT_H
 #include <sys/event.h>
-#elif defined(LLVM_ON_WIN32)
+#elif defined(_WIN32)
 #include <winsock2.h>
 #elif defined(__ANDROID__)
 #include <sys/syscall.h>
@@ -34,14 +34,14 @@
 #include <poll.h>
 #endif
 
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
 #define POLL WSAPoll
 #else
 #define POLL poll
 #endif
 
 #if SIGNAL_POLLING_UNSUPPORTED
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
 typedef int sigset_t;
 typedef int siginfo_t;
 #endif
@@ -262,7 +262,7 @@ MainLoop::~MainLoop() {
 MainLoop::ReadHandleUP MainLoop::RegisterReadObject(const IOObjectSP &object_sp,
                                                     const Callback &callback,
                                                     Status &error) {
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
   if (object_sp->GetFdType() != IOObject:: eFDTypeSocket) {
     error.SetErrorString("MainLoop: non-socket types unsupported on Windows");
     return nullptr;

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Tue Apr 10 06:33:45 2018
@@ -233,7 +233,7 @@ FileSpec Symbols::LocateExecutableSymbol
     // Add current working directory.
     debug_file_search_paths.AppendIfUnique(FileSpec(".", true));
 
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
 #if defined(__NetBSD__)
     // Add /usr/libdata/debug directory.
     debug_file_search_paths.AppendIfUnique(
@@ -242,7 +242,7 @@ FileSpec Symbols::LocateExecutableSymbol
     // Add /usr/lib/debug directory.
     debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true));
 #endif
-#endif // LLVM_ON_WIN32
+#endif // _WIN32
 
     std::string uuid_str;
     const UUID &module_uuid = module_spec.GetUUID();

Modified: lldb/trunk/source/Host/common/TCPSocket.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/TCPSocket.cpp (original)
+++ lldb/trunk/source/Host/common/TCPSocket.cpp Tue Apr 10 06:33:45 2018
@@ -26,11 +26,11 @@
 #include <sys/socket.h>
 #endif
 
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include <winsock2.h>
 #endif
 
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
 #define CLOSE_SOCKET closesocket
 typedef const char *set_socket_option_arg_type;
 #else

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h Tue Apr 10 06:33:45 2018
@@ -18,7 +18,7 @@
 // Python is disabled in this build
 #else
 #include "llvm/Support/Compiler.h"
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 // If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t.  We
 // need to ensure this doesn't happen.  At the same time, Python.h will also try
 // to redefine a bunch of stuff that PosixApi.h defines.  So define it all now

Modified: lldb/trunk/source/Utility/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/FileSpec.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Utility/FileSpec.cpp (original)
+++ lldb/trunk/source/Utility/FileSpec.cpp Tue Apr 10 06:33:45 2018
@@ -17,7 +17,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Triple.h"         // for Triple
 #include "llvm/ADT/Twine.h"          // for Twine
-#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
 #include "llvm/Support/ErrorOr.h"    // for ErrorOr
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
@@ -38,7 +37,7 @@ using namespace lldb_private;
 namespace {
 
 static constexpr FileSpec::PathSyntax GetNativeSyntax() {
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
   return FileSpec::ePathSyntaxWindows;
 #else
   return FileSpec::ePathSyntaxPosix;

Modified: lldb/trunk/source/Utility/Log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Log.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Utility/Log.cpp (original)
+++ lldb/trunk/source/Utility/Log.cpp Tue Apr 10 06:33:45 2018
@@ -28,7 +28,7 @@
 #include <utility> // for pair
 
 #include <assert.h>  // for assert
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
 #include <process.h> // for getpid
 #else
 #include <unistd.h>

Modified: lldb/trunk/source/Utility/TildeExpressionResolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/TildeExpressionResolver.cpp?rev=329697&r1=329696&r2=329697&view=diff
==============================================================================
--- lldb/trunk/source/Utility/TildeExpressionResolver.cpp (original)
+++ lldb/trunk/source/Utility/TildeExpressionResolver.cpp Tue Apr 10 06:33:45 2018
@@ -14,12 +14,11 @@
 
 #include "llvm/ADT/STLExtras.h"      // for any_of
 #include "llvm/ADT/SmallVector.h"    // for SmallVectorImpl
-#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h" // for fs
 
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
 #include <pwd.h>
 #endif
 
@@ -49,7 +48,7 @@ bool StandardTildeExpressionResolver::Re
   assert(Expr.empty() || Expr[0] == '~');
 
   Output.clear();
-#if defined(LLVM_ON_WIN32) || defined(__ANDROID__)
+#if defined(_WIN32) || defined(__ANDROID__)
   return false;
 #else
   if (Expr.empty())




More information about the lldb-commits mailing list