llvm-project/libcxx
Brian Gesiak 57839425aa [coroutines] Add std::experimental::task<T> type
Summary:
Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0.
See https://wg21.link/P1056R0.

This implementation allows customization of the allocator used to allocate the
coroutine frame by passing std::allocator_arg as the first argument, followed by
the allocator to use.

This supports co_awaiting the same task multiple times. The second and
subsequent times it returns a reference to the already-computed value.

This diff also adds some implementations of other utilities that have potential for
standardization as helpers within the test/... area:
- `sync_wait(awaitable)` - See P1171R0
- `manual_reset_event`

Move the definition of the __aligned_allocation_size helper function
from <experimental/memory_resource> to <experimental/__memory>
so it can be more widely used without pulling in memory_resource.

Outstanding work:
- Use C++14 keywords directly rather than macro versions
  eg. use `noexcept` instead of `_NOEXCEPT`).
- Add support for overaligned coroutine frames.
  This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`.
- Eliminate use of `if constexpr` if we want it to compile under C++14.

Patch by @lewissbaker (Lewis Baker).

llvm-svn: 357010
2019-03-26 17:46:06 +00:00
..
benchmarks Add relational benchmark against a string constant. 2019-03-21 16:06:15 +00:00
cmake [libc++][CMake] Clean up some of the libc++ re-exporting logic 2019-03-20 18:16:24 +00:00
docs [libc++] Re-document how to use <filesystem> with various versions of libc++ 2019-03-21 16:21:09 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include [coroutines] Add std::experimental::task<T> type 2019-03-26 17:46:06 +00:00
lib [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
src [NFC][libc++] Reindent #ifdefs 2019-03-21 18:19:21 +00:00
test [coroutines] Add std::experimental::task<T> type 2019-03-26 17:46:06 +00:00
utils [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
www [libc++][CMake] Clean up some of the libc++ re-exporting logic 2019-03-20 18:16:24 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00
appveyor.yml Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00