[libc++] Make sure we use the libdispatch backend on Apple platforms
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 18 Jul 2023 22:02:09 +0000 (18:02 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Thu, 20 Jul 2023 19:53:27 +0000 (15:53 -0400)
commit503f2ee4a86a740c4b4f442d95ff4e6d7f66a670
treea4faac1c2042f63c4e022bd171f880d108e38890
parent571178a21a8bc105bf86cf4bf92f842e07792e1a
[libc++] Make sure we use the libdispatch backend on Apple platforms

The Apple.cmake cache wasn't set up properly, so we wouldn't enable
the libdispatch backend by default on Apple platforms. This patch
fixes the issue and adds a test.

We also need to make various drive-by fixes:
- Drop the usage of std::vector in libdispatch.h to avoid changing
  the transitive includes only on Apple platforms.
- Fix includes
- Use __construct at since construct_at is unavailable in C++17
- Get rid of the (unused) __get_memory_resource function since that
  adds a back-deployment requirement and we don't use it right now.
- Fix bugs in the chunking logic around boundary conditions.

Differential Revision: https://reviews.llvm.org/D155649
libcxx/cmake/caches/Apple.cmake
libcxx/include/__algorithm/pstl_backends/cpu_backends/libdispatch.h
libcxx/src/pstl/libdispatch.cpp
libcxx/test/libcxx/algorithms/pstl.libdispatch.chunk_partitions.pass.cpp
libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp