[ThinLTO] Update ThinLTO cache file atimes when on Windows
authorAndrew Ng <anng.sw@gmail.com>
Wed, 4 Jul 2018 14:17:10 +0000 (14:17 +0000)
committerAndrew Ng <anng.sw@gmail.com>
Wed, 4 Jul 2018 14:17:10 +0000 (14:17 +0000)
commit089303d8ffeda0426de8c134fc40f0c2bd772abe
tree52cea07ddf68eb151714396f2847111f9341e1e5
parent67676e9c9913e30690f8f01eba1c9bb2b354c860
[ThinLTO] Update ThinLTO cache file atimes when on Windows

ThinLTO cache file access times are used for expiration based pruning
and since Vista, file access times are not updated by Windows by
default:

https://blogs.technet.microsoft.com/filecab/2006/11/07/disabling-last-access-time-in-windows-vista-to-improve-ntfs-performance

This means on Windows, cache files are currently being pruned from
creation time. This change manually updates cache files that are
accessed by ThinLTO, when on Windows.

Patch by Owen Reynolds.

Differential Revision: https://reviews.llvm.org/D47266

llvm-svn: 336276
llvm/include/llvm/Support/FileSystem.h
llvm/lib/LTO/Caching.cpp
llvm/lib/LTO/ThinLTOCodeGenerator.cpp
llvm/lib/Support/Windows/Path.inc
llvm/test/ThinLTO/X86/cache.ll
llvm/unittests/Support/Path.cpp