diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 00:33:27 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 00:33:27 +0000 |
commit | 35e4c84c1fa4ffb09011c5f87fe6b5ccc7035740 (patch) | |
tree | 95e868e0c0054ad41069b56172daeff38cb1d5b9 /lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | |
parent | 9ca491da2f336150d700dd1e00f27bcee23bdd09 (diff) | |
download | bcm5719-llvm-35e4c84c1fa4ffb09011c5f87fe6b5ccc7035740.tar.gz bcm5719-llvm-35e4c84c1fa4ffb09011c5f87fe6b5ccc7035740.zip |
[FileSystem] Move EnumerateDirectory from FileSpec to FileSystem.
This patch moves the EnumerateDirectory functionality and related enum
and typedef from FileSpec to FileSystem.
This is part of a set of patches that extracts file system related
convenience methods from FileSpec. The long term goal is to remove this
method altogether and use the iterators directly, but for introducing
the VFS into LLDB this change is sufficient.
Differential revision: https://reviews.llvm.org/D53785
llvm-svn: 345800
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 9c10c06f193..9c4e89d0bed 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -1417,16 +1417,17 @@ bool PlatformDarwin::SDKSupportsModules(SDKType desired_type, return false; } -FileSpec::EnumerateDirectoryResult PlatformDarwin::DirectoryEnumerator( - void *baton, llvm::sys::fs::file_type file_type, const FileSpec &spec) { +FileSystem::EnumerateDirectoryResult PlatformDarwin::DirectoryEnumerator( + void *baton, llvm::sys::fs::file_type file_type, llvm::StringRef path) { SDKEnumeratorInfo *enumerator_info = static_cast<SDKEnumeratorInfo *>(baton); + FileSpec spec(path, false); if (SDKSupportsModules(enumerator_info->sdk_type, spec)) { enumerator_info->found_path = spec; - return FileSpec::EnumerateDirectoryResult::eEnumerateDirectoryResultNext; + return FileSystem::EnumerateDirectoryResult::eEnumerateDirectoryResultNext; } - return FileSpec::EnumerateDirectoryResult::eEnumerateDirectoryResultNext; + return FileSystem::EnumerateDirectoryResult::eEnumerateDirectoryResultNext; } FileSpec PlatformDarwin::FindSDKInXcodeForModules(SDKType sdk_type, @@ -1445,9 +1446,9 @@ FileSpec PlatformDarwin::FindSDKInXcodeForModules(SDKType sdk_type, enumerator_info.sdk_type = sdk_type; - FileSpec::EnumerateDirectory(sdks_spec.GetPath(), find_directories, - find_files, find_other, DirectoryEnumerator, - &enumerator_info); + FileSystem::Instance().EnumerateDirectory( + sdks_spec.GetPath(), find_directories, find_files, find_other, + DirectoryEnumerator, &enumerator_info); if (llvm::sys::fs::is_directory(enumerator_info.found_path.GetPath())) return enumerator_info.found_path; |