[Lldb-commits] [lldb] bf33835 - [lldb] Get rid of HAVE_SYS_TYPES_H

Nico Weber via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 3 13:15:23 PDT 2021


Author: Nico Weber
Date: 2021-08-03T22:14:56+02:00
New Revision: bf3383501fefc6cfe0d8f313a2814f7fa34d4492

URL: https://github.com/llvm/llvm-project/commit/bf3383501fefc6cfe0d8f313a2814f7fa34d4492
DIFF: https://github.com/llvm/llvm-project/commit/bf3383501fefc6cfe0d8f313a2814f7fa34d4492.diff

LOG: [lldb] Get rid of HAVE_SYS_TYPES_H

LLVM includes this header unconditionally on all platforms
(including Windows), so this define should no longer be necessary.

No behavior change.

Differential Revision: https://reviews.llvm.org/D107338

Added: 
    

Modified: 
    lldb/cmake/modules/LLDBGenerateConfig.cmake
    lldb/include/lldb/Host/Config.h.cmake
    lldb/include/lldb/Host/windows/PosixApi.h
    lldb/source/Expression/UserExpression.cpp
    lldb/source/Expression/UtilityFunction.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
    lldb/tools/driver/Platform.h

Removed: 
    


################################################################################
diff  --git a/lldb/cmake/modules/LLDBGenerateConfig.cmake b/lldb/cmake/modules/LLDBGenerateConfig.cmake
index 646720a74098..94332656b28c 100644
--- a/lldb/cmake/modules/LLDBGenerateConfig.cmake
+++ b/lldb/cmake/modules/LLDBGenerateConfig.cmake
@@ -12,7 +12,6 @@ set(CMAKE_REQUIRED_DEFINITIONS)
 check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
 
 check_include_file(termios.h HAVE_TERMIOS_H)
-check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
 check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
 
 check_cxx_symbol_exists(process_vm_readv "sys/uio.h" HAVE_PROCESS_VM_READV)

diff  --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
index f691ef3abb8f..777a6d1be541 100644
--- a/lldb/include/lldb/Host/Config.h.cmake
+++ b/lldb/include/lldb/Host/Config.h.cmake
@@ -13,9 +13,6 @@
 
 #cmakedefine01 LLDB_HAVE_EL_RFUNC_T
 
-
-#cmakedefine01 HAVE_SYS_TYPES_H
-
 #cmakedefine01 HAVE_SYS_EVENT_H
 
 #cmakedefine01 HAVE_PPOLL

diff  --git a/lldb/include/lldb/Host/windows/PosixApi.h b/lldb/include/lldb/Host/windows/PosixApi.h
index 26398ac5eb11..87908209d716 100644
--- a/lldb/include/lldb/Host/windows/PosixApi.h
+++ b/lldb/include/lldb/Host/windows/PosixApi.h
@@ -56,14 +56,12 @@
 #define S_IRWXO 0
 #endif
 
-#if HAVE_SYS_TYPES_H
 // pyconfig.h typedefs this.  We require python headers to be included before
 // any LLDB headers, but there's no way to prevent python's pid_t definition
 // from leaking, so this is the best option.
 #ifndef NO_PID_T
 #include <sys/types.h>
 #endif
-#endif // HAVE_SYS_TYPES_H
 
 #ifdef _MSC_VER
 

diff  --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp
index eac89c24bc1e..b61781c0b82b 100644
--- a/lldb/source/Expression/UserExpression.cpp
+++ b/lldb/source/Expression/UserExpression.cpp
@@ -6,12 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Host/Config.h"
-
 #include <cstdio>
-#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 
 #include <cstdlib>
 #include <map>

diff  --git a/lldb/source/Expression/UtilityFunction.cpp b/lldb/source/Expression/UtilityFunction.cpp
index d7a89a8e1446..1a4df9722706 100644
--- a/lldb/source/Expression/UtilityFunction.cpp
+++ b/lldb/source/Expression/UtilityFunction.cpp
@@ -6,13 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Host/Config.h"
-
 #include <cstdio>
-#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
-
 
 #include "lldb/Core/Module.h"
 #include "lldb/Core/StreamFile.h"

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 1b205b13113b..41e86a1f897e 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -6,12 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Host/Config.h"
-
 #include <cstdio>
-#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 
 #include <cstdlib>
 #include <map>

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index a78116352c2e..363ca2ec54cc 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -6,8 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Host/Config.h"
-
 #include "ClangUtilityFunction.h"
 #include "ClangExpressionDeclMap.h"
 #include "ClangExpressionParser.h"
@@ -15,9 +13,7 @@
 #include "ClangPersistentVariables.h"
 
 #include <cstdio>
-#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 
 
 #include "lldb/Core/Module.h"

diff  --git a/lldb/tools/driver/Platform.h b/lldb/tools/driver/Platform.h
index d7573b75bf32..ff017c4422b1 100644
--- a/lldb/tools/driver/Platform.h
+++ b/lldb/tools/driver/Platform.h
@@ -9,19 +9,16 @@
 #ifndef LLDB_TOOLS_DRIVER_PLATFORM_H
 #define LLDB_TOOLS_DRIVER_PLATFORM_H
 
-#include "lldb/Host/Config.h"
-
 #if defined(_WIN32)
 
 #include <io.h>
 #if defined(_MSC_VER)
 #include <csignal>
 #endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+
 #include "lldb/Host/windows/windows.h"
 #include <cinttypes>
+#include <sys/types.h>
 
 struct winsize {
   long ws_col;


        


More information about the lldb-commits mailing list