[profile] Fix file contention causing dropped counts on Windows under -fprofile-generate

See PR43425:

When writing profile data on Windows we were opening profile file with
exclusive read/write access.

In case we are trying to write to the file from multiple processes
simultaneously, subsequent calls to CreateFileA would return

To fix this, I changed to open without exclusive access and then take a

Patch by Michael Holman!

Differential revision: https://reviews.llvm.org/D70330

(cherry picked from commit 900d8a9a3b4efeefddd310e92219741d98e7270b)
4 files changed
tree: 397479a3271a09dfae0be95e9661cb2f6be5237d
  1. .arcconfig
  2. .clang-format
  3. .clang-tidy
  4. .github/
  5. .gitignore
  6. README.md
  7. clang-tools-extra/
  8. clang/
  9. compiler-rt/
  10. debuginfo-tests/
  11. libclc/
  12. libcxx/
  13. libcxxabi/
  14. libunwind/
  15. lld/
  16. lldb/
  17. llgo/
  18. llvm/
  19. openmp/
  20. parallel-libs/
  21. polly/
  22. pstl/

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.