diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-10-10 22:19:46 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-10-10 22:19:46 +0000 |
commit | 0dfdb44797fa2ce4273e38f13403b62a5ce0a9b0 (patch) | |
tree | 7b4289f7eca8c5267e89a0a1fad53657e56dfe69 /lldb/source/Commands/CommandCompletions.cpp | |
parent | ae5e9ed422be46d63384b7a9efdf925c4507994f (diff) | |
download | bcm5719-llvm-0dfdb44797fa2ce4273e38f13403b62a5ce0a9b0.tar.gz bcm5719-llvm-0dfdb44797fa2ce4273e38f13403b62a5ce0a9b0.zip |
Support: Have directory_iterator::status() return FindFirstFileEx/FindNextFile results on Windows.
This allows clients to avoid an unnecessary fs::status() call on each
directory entry. Because the information returned by FindFirstFileEx
is a subset of the information returned by a regular status() call,
I needed to extract a base class from file_status that contains only
that information.
On my machine, this reduces the time required to enumerate a ThinLTO
cache directory containing 520k files from almost 4 minutes to less
than 2 seconds.
Differential Revision: https://reviews.llvm.org/D38716
llvm-svn: 315378
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r-- | lldb/source/Commands/CommandCompletions.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index fd84e1c4f85..34cad970ff6 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -199,14 +199,14 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name, // We have a match. - fs::file_status st; - if ((EC = Entry.status(st))) + llvm::ErrorOr<fs::basic_file_status> st = Entry.status(); + if (!st) continue; // If it's a symlink, then we treat it as a directory as long as the target // is a directory. - bool is_dir = fs::is_directory(st); - if (fs::is_symlink_file(st)) { + bool is_dir = fs::is_directory(*st); + if (fs::is_symlink_file(*st)) { fs::file_status target_st; if (!fs::status(Entry.path(), target_st)) is_dir = fs::is_directory(target_st); |