diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 21:05:36 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 21:05:36 +0000 |
| commit | 8f3be7a32b631e9ba584872c1f0dde8fd8536c07 (patch) | |
| tree | b4cfca7eb1e0996decd88a2b1dd1954ff3d7ff28 /lldb/source/Host/common/Editline.cpp | |
| parent | 8487d22d12f5b7b5c745e5a5cdda61f8a07391e1 (diff) | |
| download | bcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.tar.gz bcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.zip | |
[FileSystem] Move path resolution logic out of FileSpec
This patch removes the logic for resolving paths out of FileSpec and
updates call sites to rely on the FileSystem class instead.
Differential revision: https://reviews.llvm.org/D53915
llvm-svn: 345890
Diffstat (limited to 'lldb/source/Host/common/Editline.cpp')
| -rw-r--r-- | lldb/source/Host/common/Editline.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 71b0332458e..a330eca8582 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -13,6 +13,7 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Editline.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/LLDBAssert.h" @@ -172,7 +173,8 @@ private: const char *GetHistoryFilePath() { if (m_path.empty() && m_history && !m_prefix.empty()) { - FileSpec parent_path{"~/.lldb", true}; + FileSpec parent_path("~/.lldb"); + FileSystem::Instance().Resolve(parent_path); char history_path[PATH_MAX]; if (!llvm::sys::fs::create_directory(parent_path.GetPath())) { snprintf(history_path, sizeof(history_path), "~/.lldb/%s-history", @@ -181,7 +183,9 @@ private: snprintf(history_path, sizeof(history_path), "~/%s-widehistory", m_prefix.c_str()); } - m_path = FileSpec(history_path, true).GetPath(); + auto file_spec = FileSpec(history_path); + FileSystem::Instance().Resolve(file_spec); + m_path = file_spec.GetPath(); } if (m_path.empty()) return NULL; |

