From patchwork Wed May 6 19:10:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1284670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49HR5C3VWcz9sSs for ; Thu, 7 May 2020 05:10:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DEBFC3938C3A; Wed, 6 May 2020 19:10:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.wavenetuk.net (smtp.wavenetuk.net [195.26.36.10]) by sourceware.org (Postfix) with ESMTP id 17348389203E for ; Wed, 6 May 2020 19:10:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17348389203E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 157C4120049E; Wed, 6 May 2020 20:10:46 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [pushed] coroutines: Remove references to n4849 (NFC). Message-Id: <5D31FA8E-34B2-4A3F-ABDF-90D451981F8E@sandoe.co.uk> Date: Wed, 6 May 2020 20:10:43 +0100 To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-20.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nathan Sidwell Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, Another minor cleanup. This just strips out references to the draft standard numbered n4849. The implementation is now intended to be applicable to the expected final version. tested on x86_64-darwin16, applied to master as obvious thanks Iain gcc/cp/ChangeLog: 2020-05-05 Iain Sandoe * coroutines.cc: Remove references to n4849 throughout. --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/coroutines.cc | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index ed871e1bab1..fc319a58cc2 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -2184,11 +2184,11 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, /* Expand co_returns in the saved function body */ fnbody = expand_co_returns (&fnbody, promise_proxy, ap, fs_label); - /* n4849 adds specific behaviour to treat exceptions thrown by the - await_resume () of the initial suspend expression. In order to - implement this, we need to treat the initial_suspend expression - as if it were part of the user-authored function body. This - only applies if exceptions are enabled. */ + /* Specific behaviour to treat exceptions thrown by the await_resume () + of the initial suspend expression. In order to implement this, we + need to treat the initial_suspend expression as if it were part of the + user-authored function body. This only applies if exceptions are + enabled. */ if (flag_exceptions) { tree outer = fnbody; @@ -2290,7 +2290,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, } } - /* n4849 [dcl.fct.def.coroutine] / 12 + /* [dcl.fct.def.coroutine] / 12 The deallocation function’s name is looked up in the scope of the promise type. If this lookup fails, the deallocation function’s name is looked up in the global scope. If deallocation function lookup finds both a usual @@ -3845,7 +3845,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) = build_call_expr_internal_loc (fn_start, IFN_CO_FRAME, size_type_node, 2, frame_size, coro_fp); - /* n4849 [dcl.fct.def.coroutine] / 10 (part1) + /* [dcl.fct.def.coroutine] / 10 (part1) The unqualified-id get_return_object_on_allocation_failure is looked up in the scope of the promise type by class member access lookup. */ @@ -3871,7 +3871,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) } /* Allocate the frame, this has several possibilities: - n4849 [dcl.fct.def.coroutine] / 9 (part 1) + [dcl.fct.def.coroutine] / 9 (part 1) The allocation function’s name is looked up in the scope of the promise type. It's not a failure for it to be absent see part 4, below. */ tree nwname = ovl_op_identifier (false, NEW_EXPR); @@ -3880,7 +3880,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) tree new_fn = NULL_TREE; if (fns && BASELINK_P (fns)) { - /* n4849 [dcl.fct.def.coroutine] / 9 (part 2) + /* [dcl.fct.def.coroutine] / 9 (part 2) If the lookup finds an allocation function in the scope of the promise type, overload resolution is performed on a function call created by assembling an argument list. The first argument is the amount of space @@ -3920,7 +3920,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) if (!new_fn || new_fn == error_mark_node) { - /* n4849 [dcl.fct.def.coroutine] / 9 (part 3) + /* [dcl.fct.def.coroutine] / 9 (part 3) If no viable function is found, overload resolution is performed again on a function call created by passing just the amount of space required as an argument of type std::size_t. */ @@ -3946,7 +3946,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) } else { - /* n4849 [dcl.fct.def.coroutine] / 9 (part 4) + /* [dcl.fct.def.coroutine] / 9 (part 4) If this lookup fails, the allocation function’s name is looked up in the global scope. */ @@ -3957,7 +3957,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) if (grooaf) { - /* n4849 [dcl.fct.def.coroutine] / 10 (part 2) + /* [dcl.fct.def.coroutine] / 10 (part 2) If any declarations (of the get return on allocation fail) are found, then the result of a call to an allocation function used to obtain storage for the coroutine state is assumed to return @@ -3998,7 +3998,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) if (grooaf) { - /* n4849 [dcl.fct.def.coroutine] / 10 (part 3) + /* [dcl.fct.def.coroutine] / 10 (part 3) If the allocation function returns nullptr,the coroutine returns control to the caller of the coroutine and the return value is obtained by a call to T::get_return_object_on_allocation_failure(), @@ -4062,7 +4062,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) r = coro_build_cvt_void_expr_stmt (r, fn_start); add_stmt (r); - /* n4849 [dcl.fct.def.coroutine] /13 + /* [dcl.fct.def.coroutine] /13 When a coroutine is invoked, a copy is created for each coroutine parameter. Each such copy is an object with automatic storage duration that is direct-initialized from an lvalue referring to the corresponding