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
This commit is contained in:
Pavel Labath
2018-06-20 08:35:45 +00:00
parent f29d777f84
commit 2df331b0f7
12 changed files with 87 additions and 137 deletions

View File

@@ -445,6 +445,8 @@ public:
static const char *GetPluginDescriptionStatic();
static FileSpec GetPythonDir();
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
@@ -509,6 +511,10 @@ protected:
static void AddToSysPath(AddLocation location, std::string path);
static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);
static void ComputePythonDirForPosix(llvm::SmallVectorImpl<char> &path);
static void ComputePythonDirForWindows(llvm::SmallVectorImpl<char> &path);
bool EnterSession(uint16_t on_entry_flags, FILE *in, FILE *out, FILE *err);
void LeaveSession();