[all-commits] [llvm/llvm-project] 2ff866: [libcxx] Implement the stat function family on top...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Jan 29 03:40:08 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ff8662b5d16129ec6d1ee60dcec4f6ff8f717e2
      https://github.com/llvm/llvm-project/commit/2ff8662b5d16129ec6d1ee60dcec4f6ff8f717e2
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

  Changed paths:
    M libcxx/src/CMakeLists.txt
    M libcxx/src/filesystem/filesystem_common.h
    M libcxx/src/filesystem/operations.cpp
    A libcxx/src/filesystem/posix_compat.h

  Log Message:
  -----------
  [libcxx] Implement the stat function family on top of native windows APIs

While the windows CRTs (the modern UCRT, and the legacy msvcrt.dll
that mingw still often defaults to) do provide stat functions, they're
a bit lacking - they only provide second precision on the modification
time, lack support for symlinks and a few other details.

Instead reimplement them using a couple windows native functions,
getting exactly the info we need. (Technically, the implementation
within the CRT calls these functions anyway.)

If we only need a few fields, we could also do with fewer calls, as a
later optimization.

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


  Commit: 592d62352933d34af62334d172c6fc665933e0de
      https://github.com/llvm/llvm-project/commit/592d62352933d34af62334d172c6fc665933e0de
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

  Changed paths:
    M libcxx/src/filesystem/filesystem_common.h
    M libcxx/src/filesystem/operations.cpp
    M libcxx/src/filesystem/posix_compat.h

  Log Message:
  -----------
  [libcxx] Implement _FilesystemClock::now() and __last_write_time for windows

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


  Commit: efec3cc6524bc536459b9cb6faca190b1e3804b6
      https://github.com/llvm/llvm-project/commit/efec3cc6524bc536459b9cb6faca190b1e3804b6
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

  Changed paths:
    M libcxx/src/filesystem/operations.cpp
    M libcxx/src/filesystem/posix_compat.h

  Log Message:
  -----------
  [libcxx] Hook up a number of operation functions to their windows counterparts

Use the corresponding wchar functions, named "_wfunc" instead of "func",
where feasible, or reimplement functions with native windows APIs.

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


  Commit: f65ba25cf37a57dc87db7af389c9dc637ca7dd8c
      https://github.com/llvm/llvm-project/commit/f65ba25cf37a57dc87db7af389c9dc637ca7dd8c
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

  Changed paths:
    M libcxx/src/filesystem/posix_compat.h
    M libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp

  Log Message:
  -----------
  [libcxx] Sanitize paths before creating symlinks on windows

The MS STL does even more cleanup (corresponding to lexically_normal
I think), but this seems to be the very minimum needed for making the
symlinks work when the target path contains non-native paths.

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


Compare: https://github.com/llvm/llvm-project/compare/305ac81e1d4b...f65ba25cf37a


More information about the All-commits mailing list