summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental/coroutine
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx] Do not implicitly #include assert.hDavid Zarzycki2019-09-261-1/+0
| | | | | | | | | Users should only get the assert() macros if they explicitly include them. Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib. llvm-svn: 372963
* Fix visibility for coroutine types on WindowsEric Fiselier2019-04-171-3/+3
| | | | llvm-svn: 358551
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2019-01-161-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: ldionne, EricWF Subscribers: jyknight, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 351289
* Revert "Move internal usages of `alignof`/`__alignof` to use ↵Eric Fiselier2018-11-281-3/+3
| | | | | | | | | | | `_LIBCPP_ALIGNOF`. " This reverts commit 087f065cb0c7463f521a62599884493aaee2ea12. The tests were failing on 32 bit builds, and I don't have time to clean them up right now. I'll recommit tomorrow with fixed tests. llvm-svn: 347816
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2018-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: EricWF Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 347787
* [libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-101-0/+1
| | | | | | | | | | | | | | | | | Summary: It was defined with the right visibility, but declared without any visibility. This function was left out of a prior revision that did the same to several functions in <compare> (r336665) because the compiler I used didn't support coroutines. This reinforces the need for automated checks -- there might still be several cases of this throughout the library. Reviewers: EricWF Subscribers: modocache, christof, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49145 llvm-svn: 336709
* [coroutines] libcxx, noop_coroutine, make bots even more happyGor Nishanov2018-04-051-3/+3
| | | | llvm-svn: 329245
* [coroutines] Allow compilation under c++03Gor Nishanov2018-04-041-1/+1
| | | | llvm-svn: 329239
* [coroutines] Add noop_coroutine to <experimental/coroutine>Gor Nishanov2018-04-041-29/+68
| | | | | | | | | | | | | | A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined coroutine noop_coroutine that does nothing. This patch implements require library types in <experimental/coroutine> Related clang and llvm patches: https://reviews.llvm.org/D45114 https://reviews.llvm.org/D45120 llvm-svn: 329237
* Allow coroutine_handle<const T> to support creation from const references to ↵Eric Fiselier2017-06-161-2/+4
| | | | | | | | | | | | | | | the promise_type It seems conceivable that a user would need to get a coroutine handle having only a const reference to the promise_type, for example from within a const member function of the promise. This patch allows that use case. A coroutine_handle<const T> can be used in essentially the same way a coroutine_handle<T>, ie to start and destroy the coroutine. The constness of the promise doesn't/shouldn't propagate to the handle. llvm-svn: 305536
* Fix <experimental/coroutine> in C++03Eric Fiselier2017-05-291-2/+2
| | | | llvm-svn: 304173
* [coroutines] Make coroutine_handle<T>::from_address ill-formed for ↵Eric Fiselier2017-05-291-2/+26
| | | | | | | | | | | | | everything but void*. from_address requires that the provided pointer refer to the suspended coroutine, which doesn't have a type, or at least not one knowable by the user. Therefore every use of `from_address` with a typed pointer is almost certainly a bug. This behavior is a part of the TS specification, but hopefully it will be in the future. llvm-svn: 304172
* Fix coroutine test failures caused by API misusages.Eric Fiselier2017-05-291-0/+9
| | | | | | | | More tests to come. I think that from_address overload should be deleted or ill-formed, except for the 'void*' one; The user cannot possibly have a typed pointer to the coroutine state. llvm-svn: 304131
* Fix multiple bugs in coroutine tests.Eric Fiselier2017-05-291-0/+3
| | | | llvm-svn: 304124
* Get <experimental/coroutine> working in C++03.Eric Fiselier2017-05-261-33/+37
| | | | | | | | | | | | | Clang supports coroutines in all dialects; Therefore libc++ should too, otherwise the Clang extension is unusable. I'm not convinced extending support to C++03 is a feasible long term plan, since as the library grows to offer things like generators it will be come increasingly difficult to limit the implementation to C++03. However for the time being supporting C++03 isn't a big deal. llvm-svn: 303963
* Guard <experimental/coroutine> against older Clang versions.Eric Fiselier2017-05-261-5/+5
| | | | | | | | | | | | | | Clang started providing -fcoroutines and defining __cpp_coroutines way before it implemented the __builtin_coro_foo functions. This means that simply checking if __cpp_coroutines is not a sufficient way of detecting the actual feature. This patch implements _LIBCPP_HAS_NO_COROUTINES which implements a slightly more complex feature check. Specifically it requires __cpp_coroutines >= 201703L, which only holds for Clang 5.0 built after 2017/05/24. llvm-svn: 303956
* Re-add <experimental/coroutine> to the module map.Eric Fiselier2017-05-251-3/+3
| | | | | | | | | | | | | The original issues were caused because <experimental/coroutine> didn't correctly #ifdef out enough of the header, which caused incomplete types to be used. This patch fixes the `#if defined(__cpp_coroutines)` guard and re-adds the headers to the module map. It also uglifies some incorrectly non-reserved names. llvm-svn: 303936
* Update more coroutine_handle signatures to reflect N4663.Eric Fiselier2017-05-251-3/+3
| | | | | | | Thanks to Casey Carter for pointing out the out-of-date tests and implementation. llvm-svn: 303900
* Update coroutine_handle<P>::promise to reflect N4663.Eric Fiselier2017-05-251-8/+2
| | | | | | | | | | | This patch updates the promise() member to match the current spec. Specifically it removes the non-const overload and make the return type of the const overload non-const. This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific, since other implementations may be free to strengthen the specification. llvm-svn: 303895
* Add <experimental/coroutine>Eric Fiselier2017-05-251-0/+260
This patch adds the library portions of the coroutines PDTS, which should now be supported by Clang. llvm-svn: 303836
OpenPOWER on IntegriCloud