2021-11-16 14:05:34 +08:00
|
|
|
// -*- C++ -*-
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP_COROUTINE
|
|
|
|
#define _LIBCPP_COROUTINE
|
|
|
|
|
|
|
|
/**
|
|
|
|
coroutine synopsis
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
// [coroutine.traits]
|
|
|
|
template <class R, class... ArgTypes>
|
|
|
|
struct coroutine_traits;
|
|
|
|
// [coroutine.handle]
|
|
|
|
template <class Promise = void>
|
|
|
|
struct coroutine_handle;
|
|
|
|
// [coroutine.handle.compare]
|
|
|
|
constexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept;
|
|
|
|
constexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept;
|
|
|
|
// [coroutine.handle.hash]
|
|
|
|
template <class T> struct hash;
|
|
|
|
template <class P> struct hash<coroutine_handle<P>>;
|
|
|
|
// [coroutine.noop]
|
|
|
|
struct noop_coroutine_promise;
|
|
|
|
template<> struct coroutine_handle<noop_coroutine_promise>;
|
|
|
|
using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
|
|
|
|
noop_coroutine_handle noop_coroutine() noexcept;
|
|
|
|
// [coroutine.trivial.awaitables]
|
|
|
|
struct suspend_never;
|
|
|
|
struct suspend_always;
|
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2022-03-26 00:55:36 +08:00
|
|
|
#include <__assert> // all public C++ headers provide the assertion handler
|
2021-11-16 14:05:34 +08:00
|
|
|
#include <__config>
|
|
|
|
#include <__coroutine/coroutine_handle.h>
|
|
|
|
#include <__coroutine/coroutine_traits.h>
|
2022-01-07 22:45:05 +08:00
|
|
|
#include <__coroutine/noop_coroutine_handle.h>
|
2021-11-16 14:05:34 +08:00
|
|
|
#include <__coroutine/trivial_awaitables.h>
|
|
|
|
#include <version>
|
|
|
|
|
[libc++] Re-add transitive includes that had been removed since LLVM 14
This commit re-adds transitive includes that had been removed by
4cd04d1687f1, c36870c8e79c, a83f4b9cda57, 1458458b558d, 2e2f3158c604,
and 489637e66dd3. This should cover almost all the includes that had
been removed since LLVM 14 and that would contribute to breaking user
code when releasing LLVM 15.
It is possible to disable the inclusion of these headers by defining
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES. The intent is that vendors will
enable that macro and start fixing downstream issues immediately. We
can then remove the macro (and the transitive includes) by default in
a future release. That way, we will break users only once by removing
transitive includes in bulk instead of doing it bit by bit a every
release, which is more disruptive for users.
Note 1: The set of headers to re-add was found by re-generating the
transitive include test on a checkout of release/14.x, which
provided the list of all transitive includes we used to provide.
Note 2: Several includes of <vector>, <optional>, <array> and <unordered_map>
have been added in this commit. These transitive inclusions were
added when we implemented boyer_moore_searcher in <functional>.
Note 3: This is a best effort patch to try and resolve downstream breakage
caused since branching LLVM 14. I wasn't able to perfectly mirror
transitive includes in LLVM 14 for a few headers, so I added a
release note explaining it. To summarize, adding boyer_moore_searcher
created a bunch of circular dependencies, so we have to break
backwards compatibility in a few cases.
Differential Revision: https://reviews.llvm.org/D128661
2022-06-28 03:53:41 +08:00
|
|
|
#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
|
|
|
|
# include <iosfwd>
|
|
|
|
#endif
|
|
|
|
|
2022-06-17 04:43:46 +08:00
|
|
|
// standard-mandated includes
|
|
|
|
#include <compare>
|
|
|
|
|
2021-11-16 14:05:34 +08:00
|
|
|
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
|
2022-02-02 09:16:40 +08:00
|
|
|
# pragma GCC system_header
|
2021-11-16 14:05:34 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _LIBCPP_COROUTINE
|