[lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 13 Dec 2019 18:37:33 +0000 (10:37 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 13 Dec 2019 21:41:11 +0000 (13:41 -0800)
This matches the naming scheme used by LLVM and all the other optional
dependencies in LLDB.

Differential revision: https://reviews.llvm.org/D71482

29 files changed:
lldb/CMakeLists.txt
lldb/cmake/modules/LLDBConfig.cmake
lldb/docs/CMakeLists.txt
lldb/docs/resources/build.rst
lldb/include/lldb/Host/Config.h.cmake
lldb/packages/Python/lldbsuite/test/dotest.py
lldb/source/API/CMakeLists.txt
lldb/source/API/SBHostOS.cpp
lldb/source/API/SystemInitializerFull.cpp
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/Interpreter/CommandObjectScript.cpp
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
lldb/test/API/lit.site.cfg.py.in
lldb/test/API/lldbtest.py
lldb/test/CMakeLists.txt
lldb/test/Shell/lit.cfg.py
lldb/test/Shell/lit.site.cfg.py.in
lldb/tools/intel-features/CMakeLists.txt
lldb/unittests/ScriptInterpreter/CMakeLists.txt

index e66fa49..3747c98 100644 (file)
@@ -40,7 +40,7 @@ if (WIN32)
   add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   execute_process(
     COMMAND ${PYTHON_EXECUTABLE}
         -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
@@ -91,7 +91,7 @@ if(LLDB_INCLUDE_TESTS)
   add_subdirectory(utils/lldb-dotest)
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
 
   if(LLDB_BUILD_FRAMEWORK)
index d2ae1ba..da00603 100644 (file)
@@ -24,16 +24,19 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw
   set(LLDB_LINKER_SUPPORTS_GROUPS ON)
 endif()
 
-set(default_disable_python OFF)
+set(default_enable_python ON)
 set(default_enable_libedit ON)
 set(default_enable_curses ON)
 
-# Temporary support the old LLDB_DISABLE_CURSES variable
+# Temporary support the old LLDB_DISABLE_* variables
 if (DEFINED LLDB_DISABLE_CURSES)
   if (LLDB_DISABLE_CURSES)
     set(default_enable_curses OFF)
-  else()
-    set(default_enable_curses ON)
+  endif()
+endif()
+if (DEFINED LLDB_DISABLE_PYTHON)
+  if (LLDB_DISABLE_PYTHON)
+    set(default_enable_python OFF)
   endif()
 endif()
 
@@ -45,14 +48,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
   set(default_enable_libedit OFF)
   set(default_enable_curses OFF)
 elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
-  set(default_disable_python ON)
+  set(default_enable_python OFF)
   set(default_enable_libedit OFF)
   set(default_enable_curses OFF)
 elseif(IOS)
-  set(default_disable_python ON)
+  set(default_enable_python OFF)
 endif()
 
-option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python})
+option(LLDB_ENABLE_PYTHON "Enable Python scripting integration." ${default_enable_python})
 option(LLDB_ENABLE_LIBEDIT "Enable the use of editline." ${default_enable_libedit})
 option(LLDB_ENABLE_CURSES "Enable Curses integration." ${default_enable_curses})
 option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF)
@@ -172,7 +175,7 @@ function(find_python_libs_windows_helper LOOKUP_DEBUG OUT_EXE_PATH_VARNAME OUT_L
 
   if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL)
     message(WARNING "Unable to find all Python components.  Python support will be disabled for this build.")
-    set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+    set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
     return()
   endif()
 
@@ -197,7 +200,7 @@ endfunction()
 function(find_python_libs_windows)
   if ("${PYTHON_HOME}" STREQUAL "")
     message(WARNING "LLDB embedded Python on Windows requires specifying a value for PYTHON_HOME.  Python support disabled.")
-    set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+    set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
     return()
   endif()
 
@@ -214,7 +217,7 @@ function(find_python_libs_windows)
   else()
     message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python installation is corrupt.")
     message(WARNING "Python support will be disabled for this build.")
-    set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+    set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
     return()
   endif()
 
@@ -226,8 +229,8 @@ function(find_python_libs_windows)
     # Lookup for both debug and release python installations
     find_python_libs_windows_helper(TRUE  PYTHON_DEBUG_EXE   PYTHON_DEBUG_LIB   PYTHON_DEBUG_DLL   PYTHON_DEBUG_VERSION_STRING)
     find_python_libs_windows_helper(FALSE PYTHON_RELEASE_EXE PYTHON_RELEASE_LIB PYTHON_RELEASE_DLL PYTHON_RELEASE_VERSION_STRING)
-    if(LLDB_DISABLE_PYTHON)
-      set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+    if(NOT LLDB_ENABLE_PYTHON)
+      set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
       return()
     endif()
 
@@ -250,8 +253,8 @@ function(find_python_libs_windows)
       set(LOOKUP_DEBUG_PYTHON FALSE)
     endif()
     find_python_libs_windows_helper(${LOOKUP_DEBUG_PYTHON} PYTHON_EXECUTABLE PYTHON_LIBRARY PYTHON_DLL PYTHON_VERSION_STRING)
-    if(LLDB_DISABLE_PYTHON)
-      set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+    if(NOT LLDB_ENABLE_PYTHON)
+      set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
       return()
     endif()
   endif()
@@ -286,12 +289,12 @@ endfunction(find_python_libs_windows)
 
 # Call find_python_libs_windows ahead of the rest of the python configuration.
 # It's possible that it won't find a python installation and will then set
-# LLDB_DISABLE_PYTHON to ON.
-if (NOT LLDB_DISABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+# LLDB_ENABLE_PYTHON to OFF.
+if (LLDB_ENABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
   find_python_libs_windows()
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
     if (NOT LLDB_RELOCATABLE_PYTHON)
       file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME)
@@ -320,7 +323,7 @@ if (NOT LLDB_DISABLE_PYTHON)
   endif()
 endif()
 
-if (LLDB_DISABLE_PYTHON)
+if (NOT LLDB_ENABLE_PYTHON)
   unset(PYTHON_INCLUDE_DIR)
   unset(PYTHON_LIBRARY)
   unset(PYTHON_EXECUTABLE)
index 1da6874..0082d00 100644 (file)
@@ -15,7 +15,7 @@ if(DOXYGEN_FOUND)
   )
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   find_program(EPYDOC_EXECUTABLE NAMES epydoc epydoc.py)
   if(EPYDOC_EXECUTABLE)
     message(STATUS "Found epydoc - ${EPYDOC_EXECUTABLE}")
index 4d9850c..499a79b 100644 (file)
@@ -401,7 +401,7 @@ further by passing the appropriate cmake options, such as:
 
 ::
 
-  -DLLDB_DISABLE_PYTHON=1
+  -DLLDB_ENABLE_PYTHON=0
   -DLLDB_ENABLE_LIBEDIT=0
   -DLLDB_ENABLE_CURSES=0
   -DLLVM_ENABLE_TERMINFO=0
@@ -453,7 +453,7 @@ to prepare the cmake build with the following parameters:
   -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu \
   -DLLVM_TABLEGEN=<path-to-host>/bin/llvm-tblgen \
   -DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \
-  -DLLDB_DISABLE_PYTHON=1 \
+  -DLLDB_ENABLE_PYTHON=0 \
   -DLLDB_ENABLE_LIBEDIT=0 \
   -DLLDB_ENABLE_CURSES=0
 
@@ -471,7 +471,7 @@ options. In my case it was sufficient to add the following arguments to
   -I /usr/aarch64-linux-gnu/include
 
 If you wanted to build a full version of LLDB and avoid passing
-``-DLLDB_DISABLE_PYTHON`` and other options, you would need to obtain the
+``-DLLDB_ENABLE_PYTHON=0`` and other options, you would need to obtain the
 target versions of the respective libraries. The easiest way to achieve this is
 to use the qemu-debootstrap utility, which can prepare a system image using
 qemu and chroot to simulate the target environment. Then you can install the
index fa95631..8012d79 100644 (file)
@@ -42,7 +42,7 @@
 
 #cmakedefine01 LLDB_ENABLE_LIBXML2
 
-#cmakedefine LLDB_DISABLE_PYTHON
+#cmakedefine01 LLDB_ENABLE_PYTHON
 
 #cmakedefine LLDB_PYTHON_HOME "${LLDB_PYTHON_HOME}"
 
index 1e3df73..3d67b45 100644 (file)
@@ -617,7 +617,7 @@ def setupSysPath():
         if not lldbPythonDir:
             print(
                 "Unable to load lldb extension module.  Possible reasons for this include:")
-            print("  1) LLDB was built with LLDB_DISABLE_PYTHON=1")
+            print("  1) LLDB was built with LLDB_ENABLE_PYTHON=0")
             print(
                 "  2) PYTHONPATH and PYTHONHOME are not set correctly.  PYTHONHOME should refer to")
             print(
index 934bbf2..1a99a26 100644 (file)
@@ -4,7 +4,7 @@ endif()
 
 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
-if(NOT LLDB_DISABLE_PYTHON)
+if(LLDB_ENABLE_PYTHON)
   get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
@@ -154,7 +154,7 @@ endif()
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
   # so only it needs to explicitly link against ${PYTHON_LIBRARY}
-  if (MSVC AND NOT LLDB_DISABLE_PYTHON)
+  if (MSVC AND LLDB_ENABLE_PYTHON)
     target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
   endif()
 else()
index 2a1d17a..6ac8717 100644 (file)
@@ -19,7 +19,7 @@
 #include "lldb/Utility/FileSpec.h"
 
 #include "Plugins/ExpressionParser/Clang/ClangHost.h"
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
 #endif
 
@@ -61,7 +61,7 @@ SBFileSpec SBHostOS::GetLLDBPath(lldb::PathType path_type) {
     fspec = HostInfo::GetHeaderDir();
     break;
   case ePathTypePythonDir:
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
     fspec = ScriptInterpreterPython::GetPythonDir();
 #endif
     break;
index ffb302d..35a02ec 100644 (file)
@@ -10,7 +10,7 @@
 #include "lldb/API/SBCommandInterpreter.h"
 #include "lldb/Host/Config.h"
 
-#if !defined(LLDB_DISABLE_PYTHON)
+#if LLDB_ENABLE_PYTHON
 #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
 #endif
 
@@ -179,11 +179,11 @@ llvm::Error SystemInitializerFull::Initialize() {
 
   ScriptInterpreterNone::Initialize();
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
   OperatingSystemPython::Initialize();
 #endif
 
-#if !defined(LLDB_DISABLE_PYTHON)
+#if LLDB_ENABLE_PYTHON
   ScriptInterpreterPython::Initialize();
 #endif
 
@@ -375,7 +375,7 @@ void SystemInitializerFull::Terminate() {
   DynamicLoaderStatic::Terminate();
   DynamicLoaderWindowsDYLD::Terminate();
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
   OperatingSystemPython::Terminate();
 #endif
 
index d743900..5669ce1 100644 (file)
@@ -852,7 +852,7 @@ Process 1234 stopped
 
 bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
                                                 CommandReturnObject &result) {
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
   if (m_options.m_class_name.empty()) {
     result.AppendErrorWithFormat(
         "%s needs a Python class name (-l argument).\n", m_cmd_name.c_str());
@@ -1106,7 +1106,7 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame(
                  CommandObjectSP(new CommandObjectFrameSelect(interpreter)));
   LoadSubCommand("variable",
                  CommandObjectSP(new CommandObjectFrameVariable(interpreter)));
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
   LoadSubCommand("recognizer", CommandObjectSP(new CommandObjectFrameRecognizer(
                                    interpreter)));
 #endif
index 265acb4..aca166e 100644 (file)
@@ -163,7 +163,7 @@ public:
                               std::string &data) override {
     StreamFileSP error_sp = io_handler.GetErrorStreamFileSP();
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
     ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter();
     if (interpreter) {
       StringList lines;
@@ -256,7 +256,7 @@ public:
           "error: script interpreter missing, didn't add python command.\n");
       error_sp->Flush();
     }
-#endif // LLDB_DISABLE_PYTHON
+#endif
     io_handler.SetIsDone(true);
   }
 
@@ -395,7 +395,7 @@ protected:
                               std::string &data) override {
     StreamFileSP error_sp = io_handler.GetErrorStreamFileSP();
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
     ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter();
     if (interpreter) {
       StringList lines;
@@ -475,7 +475,7 @@ protected:
       error_sp->Flush();
     }
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
     io_handler.SetIsDone(true);
   }
 
@@ -1168,12 +1168,6 @@ public:
                                        "Show a list of current formats.") {}
 };
 
-#ifndef LLDB_DISABLE_PYTHON
-
-// CommandObjectTypeSummaryAdd
-
-#endif // LLDB_DISABLE_PYTHON
-
 Status CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue(
     uint32_t option_idx, llvm::StringRef option_arg,
     ExecutionContext *execution_context) {
@@ -1256,7 +1250,7 @@ void CommandObjectTypeSummaryAdd::CommandOptions::OptionParsingStarting(
   m_category = "default";
 }
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary(
     Args &command, CommandReturnObject &result) {
@@ -1381,7 +1375,7 @@ bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary(
   return result.Succeeded();
 }
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 bool CommandObjectTypeSummaryAdd::Execute_StringSummary(
     Args &command, CommandReturnObject &result) {
@@ -1579,13 +1573,13 @@ bool CommandObjectTypeSummaryAdd::DoExecute(Args &command,
   WarnOnPotentialUnquotedUnsignedType(command, result);
 
   if (m_options.m_is_add_script) {
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
     return Execute_ScriptSummary(command, result);
 #else
     result.AppendError("python is disabled");
     result.SetStatus(eReturnStatusFailed);
     return false;
-#endif // LLDB_DISABLE_PYTHON
+#endif
   }
 
   return Execute_StringSummary(command, result);
@@ -2153,7 +2147,7 @@ public:
                                        "Show a list of current filters.") {}
 };
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 // CommandObjectTypeSynthList
 
@@ -2166,7 +2160,7 @@ public:
             "Show a list of current synthetic providers.") {}
 };
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 // CommandObjectTypeFilterDelete
 
@@ -2181,7 +2175,7 @@ public:
   ~CommandObjectTypeFilterDelete() override = default;
 };
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 // CommandObjectTypeSynthDelete
 
@@ -2197,7 +2191,7 @@ public:
   ~CommandObjectTypeSynthDelete() override = default;
 };
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 // CommandObjectTypeFilterClear
 
@@ -2210,7 +2204,7 @@ public:
             "type filter clear", "Delete all existing filter.") {}
 };
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 // CommandObjectTypeSynthClear
 
 class CommandObjectTypeSynthClear : public CommandObjectTypeFormatterClear {
@@ -2374,7 +2368,7 @@ bool CommandObjectTypeSynthAdd::AddSynth(ConstString type_name,
   }
 }
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 #define LLDB_OPTIONS_type_filter_add
 #include "CommandOptions.inc"
 
@@ -2924,7 +2918,7 @@ public:
   ~CommandObjectTypeFormat() override = default;
 };
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 class CommandObjectTypeSynth : public CommandObjectMultiword {
 public:
@@ -2953,7 +2947,7 @@ public:
   ~CommandObjectTypeSynth() override = default;
 };
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 class CommandObjectTypeFilter : public CommandObjectMultiword {
 public:
@@ -3039,10 +3033,10 @@ CommandObjectType::CommandObjectType(CommandInterpreter &interpreter)
                  CommandObjectSP(new CommandObjectTypeFormat(interpreter)));
   LoadSubCommand("summary",
                  CommandObjectSP(new CommandObjectTypeSummary(interpreter)));
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
   LoadSubCommand("synthetic",
                  CommandObjectSP(new CommandObjectTypeSynth(interpreter)));
-#endif // LLDB_DISABLE_PYTHON
+#endif
   LoadSubCommand("lookup",
                  CommandObjectSP(new CommandObjectTypeLookup(interpreter)));
 }
index 596de20..1dd9a6c 100644 (file)
@@ -303,7 +303,7 @@ bool ValueObject::UpdateFormatsIfNeeded() {
     SetValueFormat(DataVisualization::GetFormat(*this, eNoDynamicValues));
     SetSummaryFormat(
         DataVisualization::GetSummaryFormat(*this, GetDynamicValueType()));
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
     SetSyntheticChildren(
         DataVisualization::GetSyntheticChildren(*this, GetDynamicValueType()));
 #endif
index d9ee30c..fe365a5 100644 (file)
@@ -32,13 +32,7 @@ CommandObjectScript::~CommandObjectScript() {}
 
 bool CommandObjectScript::DoExecute(llvm::StringRef command,
                                     CommandReturnObject &result) {
-#ifdef LLDB_DISABLE_PYTHON
-  // if we ever support languages other than Python this simple #ifdef won't
-  // work
-  result.AppendError("your copy of LLDB does not support scripting.");
-  result.SetStatus(eReturnStatusFailed);
-  return false;
-#else
+#if LLDB_ENABLE_PYTHON
   if (m_interpreter.GetDebugger().GetScriptLanguage() ==
       lldb::eScriptLanguageNone) {
     result.AppendError(
@@ -72,5 +66,11 @@ bool CommandObjectScript::DoExecute(llvm::StringRef command,
     result.SetStatus(eReturnStatusFailed);
 
   return result.Succeeded();
+#else
+  // if we ever support languages other than Python this simple #ifdef won't
+  // work
+  result.AppendError("your copy of LLDB does not support scripting.");
+  result.SetStatus(eReturnStatusFailed);
+  return false;
 #endif
 }
index 3ed48e1..106457c 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 #include "OperatingSystemPython.h"
 
@@ -418,4 +418,4 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid,
   return ThreadSP();
 }
 
-#endif // #ifndef LLDB_DISABLE_PYTHON
+#endif // #if LLDB_ENABLE_PYTHON
index e38f0f8..4a594cf 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 #include "lldb/Target/OperatingSystem.h"
 #include "lldb/Utility/StructuredData.h"
@@ -82,6 +82,6 @@ protected:
   lldb_private::StructuredData::ObjectSP m_python_object_sp;
 };
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 #endif // liblldb_OperatingSystemPython_h_
index 5d8642e..416f680 100644 (file)
@@ -1,4 +1,4 @@
 add_subdirectory(None)
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   add_subdirectory(Python)
 endif()
index 7880c3a..e5a6765 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 #include "PythonDataObjects.h"
 #include "ScriptInterpreterPython.h"
index ea33d44..b75045b 100644 (file)
@@ -50,7 +50,7 @@
 
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 // LLDB Python header must be included first
 #include "lldb-python.h"
index 5c668bf..282c6e3 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_PYTHON
+#if LLDB_ENABLE_PYTHON
 
 // LLDB Python header must be included first
 #include "lldb-python.h"
@@ -3293,4 +3293,4 @@ void ScriptInterpreterPythonImpl::AddToSysPath(AddLocation location,
 //
 // void ScriptInterpreterPythonImpl::Terminate() { Py_Finalize (); }
 
-#endif // LLDB_DISABLE_PYTHON
+#endif
index 88f6975..e59fedb 100644 (file)
 
 #include "lldb/Host/Config.h"
 
-#ifdef LLDB_DISABLE_PYTHON
-
-// Python is disabled in this build
-
-#else
+#if LLDB_ENABLE_PYTHON
 
 #include "lldb/Breakpoint/BreakpointOptions.h"
 #include "lldb/Core/IOHandler.h"
@@ -62,5 +58,5 @@ protected:
 };
 } // namespace lldb_private
 
-#endif // LLDB_DISABLE_PYTHON
+#endif // LLDB_ENABLE_PYTHON
 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
index b2cd7a6..48f27b0 100644 (file)
@@ -14,9 +14,7 @@
 // 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
+#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
@@ -42,6 +40,6 @@
 
 // Include python for non windows machines
 #include <Python.h>
-#endif // LLDB_DISABLE_PYTHON
+#endif
 
 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H
index b5e8ed9..374ca92 100644 (file)
@@ -20,7 +20,7 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py"
 config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
-config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
+config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.dotest_lit_args_str = None
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
index e7ba5eb..349a67f 100644 (file)
@@ -55,7 +55,7 @@ class LLDBTest(TestFormat):
         if litConfig.noExecute:
             return lit.Test.PASS, ''
 
-        if test.config.lldb_disable_python:
+        if not test.config.lldb_enable_python:
             return (lit.Test.UNSUPPORTED, 'Python module disabled')
 
         if test.config.unsupported:
index e5704f6..d2fda3c 100644 (file)
@@ -143,7 +143,7 @@ endif()
 
 # These values are not canonicalized within LLVM.
 llvm_canonicalize_cmake_booleans(
-  LLDB_DISABLE_PYTHON
+  LLDB_ENABLE_PYTHON
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_SHARED_LIBS
   LLDB_IS_64_BITS)
index 68891e6..c0a6091 100644 (file)
@@ -100,7 +100,7 @@ if 'native' in config.available_features:
         else:
             lit_config.warning("lit-cpuid failed: %s" % err)
 
-if not config.lldb_disable_python:
+if config.lldb_enable_python:
     config.available_features.add('python')
 
 if config.lldb_enable_lzma:
index 39990a4..b391f8b 100644 (file)
@@ -18,7 +18,7 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
-config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
+config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
index b531654..aff75d7 100644 (file)
@@ -23,7 +23,7 @@ if (LLDB_BUILD_INTEL_PT)
 endif()
 
 # Add python wrapper if python not disabled
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   set(LLDB_INTEL_FEATURES_PYTHON_WRAP
      ${LLDB_BINARY_DIR}/tools/intel-features/scripts/IntelFeaturesPythonWrap.cpp)
   set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP}
@@ -59,7 +59,7 @@ add_lldb_library(lldbIntelFeatures SHARED
   )
 
 # Add link dependencies for python wrapper
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   add_dependencies(lldbIntelFeatures intel-features-swig_wrapper)
 endif()
 
index 667e7a7..06d909b 100644 (file)
@@ -1,3 +1,3 @@
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   add_subdirectory(Python)
 endif()