https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/182326
>From 47a27253bc65b40401214c29096a9302a31533db Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere <[email protected]> Date: Thu, 19 Feb 2026 09:39:29 -0800 Subject: [PATCH 1/3] [lldb] Remove check for LLDB_ENABLE_PYTHON in SWIGPythonBridge.h The header guard is redundant because source/Plugins/ScriptInterpreter/CMakeLists.txt already gates the entire Python/ subdirectory behind LLDB_ENABLE_PYTHON. --- .../Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h index 7a64d8e91e62c..16ad895ee9f26 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h @@ -12,10 +12,6 @@ #include <optional> #include <string> -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "lldb-python.h" @@ -277,5 +273,4 @@ void *LLDBSWIGPython_CastPyObjectToSBFrameList(PyObject *data); } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H >From 336fa99a81048454533678c3bfed8b946158831a Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere <[email protected]> Date: Thu, 19 Feb 2026 09:42:41 -0800 Subject: [PATCH 2/3] Do the same in PythonDataObjects.h --- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 71238cc4ad213..919c5d57ceb33 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -47,10 +47,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "lldb-python.h" @@ -779,6 +775,4 @@ int RunSimpleString(const char *str); } // namespace python } // namespace lldb_private -#endif - #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H >From 5dd70198b2ab47eaab7a3542501cddb6535ba290 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere <[email protected]> Date: Thu, 19 Feb 2026 10:06:15 -0800 Subject: [PATCH 3/3] Remove more redundant checks --- .../Python/Interfaces/OperatingSystemPythonInterface.cpp | 5 ----- .../Python/Interfaces/OperatingSystemPythonInterface.h | 4 ---- .../Interfaces/ScriptInterpreterPythonInterfaces.cpp | 5 ----- .../Python/Interfaces/ScriptInterpreterPythonInterfaces.h | 4 ---- .../Interfaces/ScriptedBreakpointPythonInterface.cpp | 5 ----- .../Python/Interfaces/ScriptedBreakpointPythonInterface.h | 4 ---- .../Interfaces/ScriptedFrameProviderPythonInterface.cpp | 5 ----- .../Interfaces/ScriptedFrameProviderPythonInterface.h | 5 ----- .../Python/Interfaces/ScriptedFramePythonInterface.cpp | 4 ---- .../Python/Interfaces/ScriptedFramePythonInterface.h | 5 ----- .../Python/Interfaces/ScriptedPlatformPythonInterface.cpp | 5 ----- .../Python/Interfaces/ScriptedPlatformPythonInterface.h | 4 ---- .../Python/Interfaces/ScriptedProcessPythonInterface.cpp | 5 ----- .../Python/Interfaces/ScriptedProcessPythonInterface.h | 4 ---- .../Python/Interfaces/ScriptedPythonInterface.cpp | 4 ---- .../Python/Interfaces/ScriptedPythonInterface.h | 4 ---- .../Python/Interfaces/ScriptedStopHookPythonInterface.cpp | 5 ----- .../Python/Interfaces/ScriptedStopHookPythonInterface.h | 4 ---- .../Interfaces/ScriptedThreadPlanPythonInterface.cpp | 5 ----- .../Python/Interfaces/ScriptedThreadPlanPythonInterface.h | 4 ---- .../Python/Interfaces/ScriptedThreadPythonInterface.cpp | 4 ---- .../Python/Interfaces/ScriptedThreadPythonInterface.h | 5 ----- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 5 ----- .../ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 6 ------ .../ScriptInterpreter/Python/ScriptInterpreterPython.h | 5 ----- .../ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 5 ----- lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h | 7 ------- 27 files changed, 127 deletions(-) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp index d8b2ea984fd88..d293406069395 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp @@ -7,13 +7,10 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // clang-format off // LLDB Python header must be included first #include "../lldb-python.h" @@ -105,5 +102,3 @@ void OperatingSystemPythonInterface::Initialize() { void OperatingSystemPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h index cefcc352670a3..00de819ef92ac 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h @@ -9,11 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/OperatingSystemInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedThreadPythonInterface.h" #include <optional> @@ -59,5 +56,4 @@ class OperatingSystemPythonInterface }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp index f6c707b2bd168..5fbccb67fe173 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp @@ -7,11 +7,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptInterpreterPythonInterfaces.h" using namespace lldb; @@ -43,5 +40,3 @@ void ScriptInterpreterPythonInterfaces::Terminate() { ScriptedThreadPlanPythonInterface::Terminate(); ScriptedFrameProviderPythonInterface::Terminate(); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h index 721902ec1e253..58b19760cb8e1 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h @@ -10,11 +10,8 @@ #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTINTERPRETERPYTHONINTERFACES_H #include "lldb/Core/PluginInterface.h" -#include "lldb/Host/Config.h" #include "lldb/lldb-private.h" -#if LLDB_ENABLE_PYTHON - #include "OperatingSystemPythonInterface.h" #include "ScriptedBreakpointPythonInterface.h" #include "ScriptedFrameProviderPythonInterface.h" @@ -36,5 +33,4 @@ class ScriptInterpreterPythonInterfaces : public PluginInterface { }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTINTERPRETERPYTHONINTERFACES_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp index c9bb38d213c99..71e5585f7b8df 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp @@ -7,14 +7,11 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "../lldb-python.h" @@ -122,5 +119,3 @@ void ScriptedBreakpointPythonInterface::Initialize() { void ScriptedBreakpointPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.h index 3da5e7eddc95a..34e63792fb257 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.h @@ -10,11 +10,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedBreakpointInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" namespace lldb_private { @@ -55,5 +52,4 @@ class ScriptedBreakpointPythonInterface : public ScriptedBreakpointInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp index 2d87c1b10bfec..d4d7a63ce4010 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp @@ -7,13 +7,10 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "../lldb-python.h" @@ -127,5 +124,3 @@ void ScriptedFrameProviderPythonInterface::Initialize() { void ScriptedFrameProviderPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.h index 00be064866639..145d5fefd4546 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.h @@ -9,10 +9,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Interpreter/Interfaces/ScriptedFrameProviderInterface.h" @@ -61,5 +57,4 @@ class ScriptedFrameProviderPythonInterface }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp index 9cc7b04fc9dba..b8613578bdbd1 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.cpp @@ -11,8 +11,6 @@ #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "../lldb-python.h" @@ -181,5 +179,3 @@ ScriptedFramePythonInterface::GetValueObjectForVariableExpression( return val; } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h index 8aa950f19e6ea..2e215bbe6aea2 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFramePythonInterface.h @@ -9,10 +9,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPYTHONINTERFACE_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" #include "lldb/Interpreter/Interfaces/ScriptedFrameInterface.h" #include <optional> @@ -61,5 +57,4 @@ class ScriptedFramePythonInterface : public ScriptedFrameInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp index 0c078f019b8f3..8b7f84c5af037 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp @@ -7,14 +7,11 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // clang-format off // LLDB Python header must be included first #include "../lldb-python.h" @@ -104,5 +101,3 @@ void ScriptedPlatformPythonInterface::Initialize() { void ScriptedPlatformPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif // LLDB_ENABLE_PYTHON diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h index f214f13e9c1bd..80287f2a685ed 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h @@ -9,11 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedPlatformInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" namespace lldb_private { @@ -60,5 +57,4 @@ class ScriptedPlatformPythonInterface : public ScriptedPlatformInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp index f5fc337a8028e..b99bf9f627310 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp @@ -7,13 +7,10 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // clang-format off // LLDB Python header must be included first #include "../lldb-python.h" @@ -232,5 +229,3 @@ void ScriptedProcessPythonInterface::Initialize() { void ScriptedProcessPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h index 18c212c1f3407..f04beffc2914d 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h @@ -9,11 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedProcessInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" #include <optional> @@ -87,5 +84,4 @@ class ScriptedProcessPythonInterface : public ScriptedProcessInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp index f5fd8b2d2d802..68aea7d223f7b 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp @@ -10,8 +10,6 @@ #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "../lldb-python.h" @@ -310,5 +308,3 @@ ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::ValueObjectListSP>( return out; } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h index 4aadee584b2e2..055d4dc8707d6 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h @@ -9,15 +9,12 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPYTHONINTERFACE_H -#if LLDB_ENABLE_PYTHON - #include <optional> #include <sstream> #include <tuple> #include <type_traits> #include <utility> -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedInterface.h" #include "lldb/Utility/DataBufferHeap.h" @@ -830,5 +827,4 @@ ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::ValueObjectListSP>( } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.cpp index eb052c24bab6d..d10f7f07bd33e 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.cpp @@ -7,13 +7,10 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // clang-format off // LLDB Python header must be included first #include "../lldb-python.h" @@ -71,5 +68,3 @@ void ScriptedStopHookPythonInterface::Initialize() { void ScriptedStopHookPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.h index d36384b369d49..479422aa52b26 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.h @@ -9,11 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedStopHookInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" namespace lldb_private { @@ -47,5 +44,4 @@ class ScriptedStopHookPythonInterface : public ScriptedStopHookInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp index 14c48a4e4a117..b27fcd64d3892 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp @@ -7,12 +7,9 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/PluginManager.h" -#include "lldb/Host/Config.h" #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // clang-format off // LLDB Python header must be included first #include "../lldb-python.h" @@ -119,5 +116,3 @@ void ScriptedThreadPlanPythonInterface::Initialize() { void ScriptedThreadPlanPythonInterface::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h index 1805b896fc03b..cd400f1d6b489 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h @@ -9,11 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H -#include "lldb/Host/Config.h" #include "lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h" -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" #include <optional> @@ -57,5 +54,4 @@ class ScriptedThreadPlanPythonInterface : public ScriptedThreadPlanInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp index fd4d231a747fe..7181e039b640a 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp @@ -11,8 +11,6 @@ #include "lldb/Utility/Log.h" #include "lldb/lldb-enumerations.h" -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "../lldb-python.h" @@ -160,5 +158,3 @@ lldb::ScriptedFrameInterfaceSP ScriptedThreadPythonInterface::CreateScriptedFrameInterface() { return m_interpreter.CreateScriptedFrameInterface(); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h index e61365d210ba2..d57f1d6598f76 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h @@ -9,10 +9,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "ScriptedPythonInterface.h" #include "lldb/Interpreter/Interfaces/ScriptedThreadInterface.h" #include <optional> @@ -59,5 +55,4 @@ class ScriptedThreadPythonInterface : public ScriptedThreadInterface, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 74b1c3a6e1ac8..800f991680c85 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -6,10 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "PythonDataObjects.h" #include "ScriptInterpreterPython.h" @@ -1488,4 +1484,3 @@ int lldb_private::python::RunSimpleString(const char *str) { return 0; } -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index b002a081d364b..3daa24472864e 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -6,10 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - // LLDB Python header must be included first #include "lldb-python.h" @@ -3096,5 +3092,3 @@ void ScriptInterpreterPythonImpl::AddToSysPath(AddLocation location, // when the process exits). // // void ScriptInterpreterPythonImpl::Terminate() { Py_Finalize (); } - -#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h index 4a56278e3df1a..bade88614f3d9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h @@ -9,10 +9,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "lldb/Breakpoint/BreakpointOptions.h" #include "lldb/Core/IOHandler.h" #include "lldb/Core/StructuredDataImpl.h" @@ -59,5 +55,4 @@ class ScriptInterpreterPython : public ScriptInterpreter, }; } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index 1eac78e6360f2..f08b2334f9ccb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -9,10 +9,6 @@ #ifndef LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H #define LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON - #include "lldb-python.h" #include "PythonDataObjects.h" @@ -498,5 +494,4 @@ class IOHandlerPythonInterpreter : public IOHandler { } // namespace lldb_private -#endif // LLDB_ENABLE_PYTHON #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h index c335e6dc6de36..cf1e2836b78fb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h @@ -16,12 +16,6 @@ static llvm::Expected<bool> *g_fcxx_modules_workaround [[maybe_unused]]; // END -#include "lldb/Host/Config.h" - -// Python.h needs to be included before any system headers in order to avoid -// redefinition of macros - -#if LLDB_ENABLE_PYTHON #include "llvm/Support/Compiler.h" #if defined(_WIN32) // If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We @@ -66,6 +60,5 @@ static_assert(PY_VERSION_HEX >= LLDB_MINIMUM_PYTHON_VERSION, #ifndef PyBUF_READ #define PyBUF_READ 0x100 #endif -#endif #endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
