[lldb] Remove check for LLDB_ENABLE_PYTHON in SWIGPythonBridge.h (#182326)

The header guard is redundant because
`source/Plugins/ScriptInterpreter/CMakeLists.txt` already gates the
entire `Python/` subdirectory behind `LLDB_ENABLE_PYTHON`.
This commit is contained in:
Jonas Devlieghere 2026-02-19 11:05:45 -08:00 committed by GitHub
parent e467947047
commit fece61b281
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 0 additions and 138 deletions

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_OPERATINGSYSTEMPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTINTERPRETERPYTHONINTERFACES_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDBREAKPOINTPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPROVIDERPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDFRAMEPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPLATFORMPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ private:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDPROCESSPYTHONINTERFACE_H

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDSTOPHOOKPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ public:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPLANPYTHONINTERFACE_H

View file

@ -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

View file

@ -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 @@ protected:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_INTERFACES_SCRIPTEDTHREADPYTHONINTERFACE_H

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 @@ protected:
};
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H

View file

@ -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 @@ protected:
} // namespace lldb_private
#endif // LLDB_ENABLE_PYTHON
#endif // LLDB_SOURCE_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONIMPL_H

View file

@ -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