summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBFileSpec.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-01 21:05:36 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-01 21:05:36 +0000
commit8f3be7a32b631e9ba584872c1f0dde8fd8536c07 (patch)
treeb4cfca7eb1e0996decd88a2b1dd1954ff3d7ff28 /lldb/source/API/SBFileSpec.cpp
parent8487d22d12f5b7b5c745e5a5cdda61f8a07391e1 (diff)
downloadbcm5719-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/API/SBFileSpec.cpp')
-rw-r--r--lldb/source/API/SBFileSpec.cpp12
1 files changed, 8 insertions, 4 deletions
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());
}
OpenPOWER on IntegriCloud