diff options
author | Pavel Labath <labath@google.com> | 2018-06-20 08:35:45 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-06-20 08:35:45 +0000 |
commit | 2df331b0f78b90a5b0be1e247f3cce97709af964 (patch) | |
tree | 3db24e1ba9d0a8ef84761453bd883172a98d587c /lldb/source/Host/macosx/objcxx | |
parent | f29d777f847b2a3d0aec2a499490fa34815fc918 (diff) | |
download | bcm5719-llvm-2df331b0f78b90a5b0be1e247f3cce97709af964.tar.gz bcm5719-llvm-2df331b0f78b90a5b0be1e247f3cce97709af964.zip |
Remove dependency from Host to python
Summary:
The only reason python was used in the Host module was to compute the
python path. I resolve this the same way as D47384 did for clang, by
moving the path computation into the python plugin and modifying
SBHostOS class to call into this module for ePathTypePythonDir.
Reviewers: zturner, jingham, davide
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D48215
llvm-svn: 335104
Diffstat (limited to 'lldb/source/Host/macosx/objcxx')
-rw-r--r-- | lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm index 085f553f1c9..a39d26aa31a 100644 --- a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm +++ b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -#if !defined(LLDB_DISABLE_PYTHON) -#include "Plugins/ScriptInterpreter/Python/lldb-python.h" -#endif - #include "lldb/Host/HostInfo.h" #include "lldb/Host/macosx/HostInfoMacOSX.h" #include "lldb/Utility/Args.h" @@ -188,36 +184,6 @@ bool HostInfoMacOSX::ComputeHeaderDirectory(FileSpec &file_spec) { return true; } -bool HostInfoMacOSX::ComputePythonDirectory(FileSpec &file_spec) { -#ifndef LLDB_DISABLE_PYTHON - FileSpec lldb_file_spec = GetShlibDir(); - if (!lldb_file_spec) - return false; - - std::string raw_path = lldb_file_spec.GetPath(); - - size_t framework_pos = raw_path.find("LLDB.framework"); - if (framework_pos != std::string::npos) { - framework_pos += strlen("LLDB.framework"); - raw_path.resize(framework_pos); - raw_path.append("/Resources/Python"); - } else { - llvm::SmallString<256> python_version_dir; - llvm::raw_svector_ostream os(python_version_dir); - os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION - << "/site-packages"; - - // We may get our string truncated. Should we protect this with an assert? - raw_path.append(python_version_dir.c_str()); - } - file_spec.GetDirectory().SetString( - llvm::StringRef(raw_path.c_str(), raw_path.size())); - return true; -#else - return false; -#endif -} - bool HostInfoMacOSX::ComputeSystemPluginsDirectory(FileSpec &file_spec) { FileSpec lldb_file_spec = GetShlibDir(); if (!lldb_file_spec) |