From 8f3be7a32b631e9ba584872c1f0dde8fd8536c07 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 1 Nov 2018 21:05:36 +0000 Subject: [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 --- lldb/source/API/SBFileSpec.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lldb/source/API/SBFileSpec.cpp') diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp index 067db0d6255..0a8a281c1a2 100644 --- a/lldb/source/API/SBFileSpec.cpp +++ b/lldb/source/API/SBFileSpec.cpp @@ -32,11 +32,15 @@ SBFileSpec::SBFileSpec(const lldb_private::FileSpec &fspec) : m_opaque_ap(new lldb_private::FileSpec(fspec)) {} // Deprecated!!! -SBFileSpec::SBFileSpec(const char *path) - : m_opaque_ap(new FileSpec(path, true)) {} +SBFileSpec::SBFileSpec(const char *path) : m_opaque_ap(new FileSpec(path)) { + FileSystem::Instance().Resolve(*m_opaque_ap); +} SBFileSpec::SBFileSpec(const char *path, bool resolve) - : m_opaque_ap(new FileSpec(path, resolve)) {} + : m_opaque_ap(new FileSpec(path)) { + if (resolve) + FileSystem::Instance().Resolve(*m_opaque_ap); +} SBFileSpec::~SBFileSpec() {} @@ -68,7 +72,7 @@ bool SBFileSpec::ResolveExecutableLocation() { int SBFileSpec::ResolvePath(const char *src_path, char *dst_path, size_t dst_len) { llvm::SmallString<64> result(src_path); - lldb_private::FileSpec::Resolve(result); + FileSystem::Instance().Resolve(result); ::snprintf(dst_path, dst_len, "%s", result.c_str()); return std::min(dst_len - 1, result.size()); } -- cgit v1.2.1