diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-02 22:34:51 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-02 22:34:51 +0000 |
commit | 50bc1ed290824218a1bb46f70ec731712da610b0 (patch) | |
tree | 1d3e18cd42de622121b266b93322ec7d6e6c4507 /lldb/source/Host/common/FileCache.cpp | |
parent | d1932dcdd3e3212ad6ad21f586cfa8a44940b8f9 (diff) | |
download | bcm5719-llvm-50bc1ed290824218a1bb46f70ec731712da610b0.tar.gz bcm5719-llvm-50bc1ed290824218a1bb46f70ec731712da610b0.zip |
[FileSystem] Open File instances through the FileSystem.
This patch modifies how we open File instances in LLDB. Rather than
passing a path or FileSpec to the constructor, we now go through the
virtual file system. This is needed in order to make things work with
the VFS in the future.
Differential revision: https://reviews.llvm.org/D54020
llvm-svn: 346049
Diffstat (limited to 'lldb/source/Host/common/FileCache.cpp')
-rw-r--r-- | lldb/source/Host/common/FileCache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Host/common/FileCache.cpp b/lldb/source/Host/common/FileCache.cpp index b4629255c85..0e4a05a8c7f 100644 --- a/lldb/source/Host/common/FileCache.cpp +++ b/lldb/source/Host/common/FileCache.cpp @@ -10,6 +10,7 @@ #include "lldb/Host/FileCache.h" #include "lldb/Host/File.h" +#include "lldb/Host/FileSystem.h" using namespace lldb; using namespace lldb_private; @@ -25,13 +26,12 @@ FileCache &FileCache::GetInstance() { lldb::user_id_t FileCache::OpenFile(const FileSpec &file_spec, uint32_t flags, uint32_t mode, Status &error) { - std::string path(file_spec.GetPath()); - if (path.empty()) { + if (!file_spec) { error.SetErrorString("empty path"); return UINT64_MAX; } FileSP file_sp(new File()); - error = file_sp->Open(path.c_str(), flags, mode); + error = FileSystem::Instance().Open(*file_sp, file_spec, flags, mode); if (file_sp->IsValid() == false) return UINT64_MAX; lldb::user_id_t fd = file_sp->GetDescriptor(); |