]> granicus.if.org Git - llvm/commit
Support: Have directory_iterator::status() return FindFirstFileEx/FindNextFile result...
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 10 Oct 2017 22:19:46 +0000 (22:19 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 10 Oct 2017 22:19:46 +0000 (22:19 +0000)
commitdaa4acc2eb60a47d75fcc440312d5d800985e6cf
treeb1d2df4ef71e1beaf5811949de1a690f350828fc
parent4f80a5f9b0b21a106d5ffeb42371da7a292c0137
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315378 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/FileSystem.h
lib/Support/CachePruning.cpp
lib/Support/Path.cpp
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc
unittests/Support/Path.cpp