summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-10-06 17:14:36 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-10-06 17:14:36 +0000
commit80e31f1f84b3d28e0eb91607dea08b7c63f555c9 (patch)
tree83db02b3336f7807ba701c75e59c54dacb7c8b22 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentfd658950de1eb193da9887d7531a8f761d976550 (diff)
downloadbcm5719-llvm-80e31f1f84b3d28e0eb91607dea08b7c63f555c9.tar.gz
bcm5719-llvm-80e31f1f84b3d28e0eb91607dea08b7c63f555c9.zip
Support: Rewrite Windows implementation of sys::fs::rename to be more POSIXy.
The current implementation of rename uses ReplaceFile if the destination file already exists. According to the documentation for ReplaceFile, the source file is opened without a sharing mode. This means that there is a short interval of time between when ReplaceFile renames the file and when it closes the file during which the destination file cannot be opened. This behaviour is not POSIX compliant because rename is supposed to be atomic. It was also causing intermittent link failures when linking with a ThinLTO cache; the ThinLTO cache implementation expects all cache files to be openable. This patch addresses that problem by re-implementing rename using CreateFile and SetFileInformationByHandle. It is roughly a reimplementation of ReplaceFile with a better sharing policy as well as support for renaming in the case where the destination file does not exist. This implementation is still not fully POSIX. Specifically in the case where the destination file is open at the point when rename is called, there will be a short interval of time during which the destination file will not exist. It isn't clear whether it is possible to avoid this using the Windows API. Differential Revision: https://reviews.llvm.org/D38570 llvm-svn: 315079
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud