diff options
| author | Zachary Turner <zturner@google.com> | 2018-06-04 17:41:00 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2018-06-04 17:41:00 +0000 |
| commit | bdf089246e9f77babf811fd5811b7947d7cab6ac (patch) | |
| tree | 2360b62c5aa9bf9b066db9fdc88134d05a4c862b /lldb/source/Host/common/HostInfoBase.cpp | |
| parent | d0f9a87215e0a25c640229d04dcd4b806b1c2433 (diff) | |
| download | bcm5719-llvm-bdf089246e9f77babf811fd5811b7947d7cab6ac.tar.gz bcm5719-llvm-bdf089246e9f77babf811fd5811b7947d7cab6ac.zip | |
Remove dependency from Host to clang.
Host depended on clang because HostInfo had a function to get
the directory where clang was installed. We move this over to
the clang expression parser plugin where it's more at home.
Differential Revision: https://reviews.llvm.org/D47384
llvm-svn: 333933
Diffstat (limited to 'lldb/source/Host/common/HostInfoBase.cpp')
| -rw-r--r-- | lldb/source/Host/common/HostInfoBase.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp index d905491b7a7..51eba38eb36 100644 --- a/lldb/source/Host/common/HostInfoBase.cpp +++ b/lldb/source/Host/common/HostInfoBase.cpp @@ -114,6 +114,8 @@ llvm::Optional<HostInfoBase::ArchitectureKind> HostInfoBase::ParseArchitectureKi bool HostInfoBase::GetLLDBPath(lldb::PathType type, FileSpec &file_spec) { file_spec.Clear(); + assert(type != lldb::ePathTypeClangDir); + #if defined(LLDB_DISABLE_PYTHON) if (type == lldb::ePathTypePythonDir) return false; @@ -176,21 +178,6 @@ bool HostInfoBase::GetLLDBPath(lldb::PathType type, FileSpec &file_spec) { if (success) result = &g_fields->m_lldb_python_dir; } break; - case lldb::ePathTypeClangDir: { - static llvm::once_flag g_once_flag; - static bool success = false; - llvm::call_once(g_once_flag, []() { - success = - HostInfo::ComputeClangDirectory(g_fields->m_lldb_clang_resource_dir); - Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); - if (log) - log->Printf( - "HostInfoBase::GetLLDBPath(ePathTypeClangResourceDir) => '%s'", - g_fields->m_lldb_clang_resource_dir.GetPath().c_str()); - }); - if (success) - result = &g_fields->m_lldb_clang_resource_dir; - } break; case lldb::ePathTypeLLDBSystemPlugins: { static llvm::once_flag g_once_flag; static bool success = false; @@ -251,6 +238,8 @@ bool HostInfoBase::GetLLDBPath(lldb::PathType type, FileSpec &file_spec) { if (success) result = &g_fields->m_lldb_global_tmp_dir; } break; + default: + llvm_unreachable("Unreachable!"); } if (!result) @@ -351,8 +340,6 @@ bool HostInfoBase::ComputeSystemPluginsDirectory(FileSpec &file_spec) { return false; } -bool HostInfoBase::ComputeClangDirectory(FileSpec &file_spec) { return false; } - bool HostInfoBase::ComputeUserPluginsDirectory(FileSpec &file_spec) { // TODO(zturner): Figure out how to compute the user plugins directory for // all platforms. |

