summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-06-21 17:36:32 +0000
committerPavel Labath <labath@google.com>2018-06-21 17:36:32 +0000
commitd68983e3d5168bcd1f156232bff7101561cb44fb (patch)
tree6218e4ce69f9ce14ba4bad3e0d2ba9d61fe03035 /lldb/source/Plugins/ScriptInterpreter/Python
parentb2431c6c337e7fb340e79dbd65dd96f599268121 (diff)
downloadbcm5719-llvm-d68983e3d5168bcd1f156232bff7101561cb44fb.tar.gz
bcm5719-llvm-d68983e3d5168bcd1f156232bff7101561cb44fb.zip
Partially revert r335236
Jim pointed out that XCode has build configurations that build without python and removing the ifdefs around the python code breaks them. This reverts the #ifdef part of the above patch, while keeping the cmake parts. llvm-svn: 335260
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h4
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp4
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h4
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h4
7 files changed, 40 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 671e8f9f23b..6a9d57d5a30 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -7,6 +7,12 @@
//
//===----------------------------------------------------------------------===//
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
#include "PythonDataObjects.h"
#include "ScriptInterpreterPython.h"
@@ -1028,3 +1034,5 @@ bool PythonFile::GetUnderlyingFile(File &file) const {
file.SetOptions(PythonFile::GetOptionsFromMode(py_mode.GetString()));
return file.IsValid();
}
+
+#endif
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index c818cbbd8b5..beeb6478236 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -10,6 +10,8 @@
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
+#ifndef LLDB_DISABLE_PYTHON
+
// LLDB Python header must be included first
#include "lldb-python.h"
@@ -468,3 +470,5 @@ public:
} // namespace lldb_private
#endif
+
+#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
index 5a173164643..d28a8033820 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+#ifndef LLDB_DISABLE_PYTHON
+
// LLDB Python header must be included first
#include "lldb-python.h"
@@ -164,3 +166,5 @@ std::string PythonExceptionState::ReadBacktrace() const {
return retval;
}
+
+#endif
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
index bcdf6e183ff..20f4b4c6329 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
@@ -10,6 +10,8 @@
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
+#ifndef LLDB_DISABLE_PYTHON
+
#include "PythonDataObjects.h"
namespace lldb_private {
@@ -51,3 +53,5 @@ private:
}
#endif
+
+#endif
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 8729a7353e9..2a196ab1cc8 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -7,6 +7,12 @@
//
//===----------------------------------------------------------------------===//
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
// LLDB Python header must be included first
#include "lldb-python.h"
@@ -3200,3 +3206,5 @@ void ScriptInterpreterPython::AddToSysPath(AddLocation location,
// when the process exits).
//
// void ScriptInterpreterPython::Terminate() { Py_Finalize (); }
+
+#endif // LLDB_DISABLE_PYTHON
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
index 527853bb624..628b71f3f47 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -10,6 +10,12 @@
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
// C Includes
// C++ Includes
#include <memory>
@@ -565,4 +571,6 @@ protected:
} // namespace lldb_private
+#endif // LLDB_DISABLE_PYTHON
+
#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
index c0998636fcb..f929baade2e 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
@@ -13,6 +13,9 @@
// Python.h needs to be included before any system headers in order to avoid
// redefinition of macros
+#ifdef LLDB_DISABLE_PYTHON
+// Python is disabled in this build
+#else
#include "llvm/Support/Compiler.h"
#if defined(_WIN32)
// If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We
@@ -32,5 +35,6 @@
// Include python for non windows machines
#include <Python.h>
+#endif // LLDB_DISABLE_PYTHON
#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H
OpenPOWER on IntegriCloud