Skip to content

Commit d951575

Browse files
authored
[libc++][NFC] Remove guard around noop_coroutine_handle.h (#160044)
This check is always true, since all supported version of Clang have `__builtin_coro_noop` and the only other supported compiler is GCC.
1 parent 08de00a commit d951575

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

libcxx/include/__coroutine/noop_coroutine_handle.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
_LIBCPP_BEGIN_NAMESPACE_STD
2222

23-
# if __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)
24-
2523
// [coroutine.noop]
2624
// [coroutine.promise.noop]
2725
struct noop_coroutine_promise {};
@@ -56,12 +54,12 @@ struct coroutine_handle<noop_coroutine_promise> {
5654
private:
5755
_LIBCPP_HIDE_FROM_ABI friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept;
5856

59-
# if __has_builtin(__builtin_coro_noop)
57+
# if __has_builtin(__builtin_coro_noop)
6058
_LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept { this->__handle_ = __builtin_coro_noop(); }
6159

6260
void* __handle_ = nullptr;
6361

64-
# elif defined(_LIBCPP_COMPILER_GCC)
62+
# elif defined(_LIBCPP_COMPILER_GCC)
6563
// GCC doesn't implement __builtin_coro_noop().
6664
// Construct the coroutine frame manually instead.
6765
struct __noop_coroutine_frame_ty_ {
@@ -78,20 +76,18 @@ struct coroutine_handle<noop_coroutine_promise> {
7876

7977
_LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept = default;
8078

81-
# endif // __has_builtin(__builtin_coro_noop)
79+
# endif // __has_builtin(__builtin_coro_noop)
8280
};
8381

8482
using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
8583

86-
# if defined(_LIBCPP_COMPILER_GCC)
84+
# if defined(_LIBCPP_COMPILER_GCC)
8785
inline noop_coroutine_handle::__noop_coroutine_frame_ty_ noop_coroutine_handle::__noop_coroutine_frame_{};
88-
# endif
86+
# endif
8987

9088
// [coroutine.noop.coroutine]
9189
inline _LIBCPP_HIDE_FROM_ABI noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); }
9290

93-
# endif // __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)
94-
9591
_LIBCPP_END_NAMESPACE_STD
9692

9793
#endif // _LIBCPP_STD_VER >= 20

0 commit comments

Comments
 (0)