From patchwork Sun Jan 26 21:06:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1229407 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518279-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=mlLXJmpV; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485QSY4x6pz9sPJ for ; Mon, 27 Jan 2020 08:07:39 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=oLMLT0NtIO+5MzXfpV4z fSkzy80rHsiyeBxTaQguzV/pgSRR7XwjE+ebZe/KPkCPLjbJmR4a+pGbVFEyepzG b8OYKnAJ0je8IuHcr1lvhJswpNYX+AwPXv9sE8u9znaUo2kh8fhkxmMBIdAPqkLo wcFR+egSZK9XuLpyCrkYKKo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=V/d01+xGjusPJCi0PCC9wvm7yP A=; b=mlLXJmpVhtryqKkFZq9tgZws65npJj0HilC7qVdGx2yXf45wEXFVZT5DiR ghFjrtI52r0XFmNVvMOPLeiDXCGj6cOCaN9cBqKBJmoccqHLHt5J1wCbewIlDZ2I XAVS6ehxv21ZJM/qFXXLTgLwFagWlgseLXLSFgtw2hj60SruM= Received: (qmail 25879 invoked by alias); 26 Jan 2020 21:07:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25869 invoked by uid 89); 26 Jan 2020 21:07:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=await, 34, growing, 3.4 X-HELO: smtp1.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp1.wavenetuk.net) (195.26.36.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 Jan 2020 21:07:26 +0000 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 31DCC12005ED; Sun, 26 Jan 2020 21:07:23 +0000 (GMT) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [committed] coroutines: Fix whitespace and comment markers. Message-Id: Date: Sun, 26 Jan 2020 21:06:59 +0000 Cc: Nathan Sidwell To: GCC-patches This fixes up the uses of non-canonical forms Nathan obseved, for comments inlined in function calls and some uses of C++ style comment markers that had slipped through. Whitespace and comment changes only, NFC intended. tested in x86_64-darwin16, pushed to master, thanks Iain commit 8022264265dd39887a1723eeda8ae445afad1fde Author: Iain Sandoe Date: 2020-01-26 20:49:04 +0000 coroutines: Fix whitespace and comment markers. This amends the cases where inline comments in function calls were followed by a space. It also fixes some uses of C++ style and wrongly wrapped comment end markers. gcc/cp/ChangeLog: 2020-01-26 Iain Sandoe * coroutines.cc: Amend whitespace after inline comments throughout. Ensure use of C-style comment markers. diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index 81fb8c924a7..b222c1f7a8e 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -296,9 +296,8 @@ instantiate_coro_traits (tree fndecl, location_t kw) tree traits_class = lookup_template_class (coro_traits_templ, targ, - /*in_decl=*/ NULL_TREE, - /*context=*/ NULL_TREE /*std_node*/, - /*entering scope=*/ false, tf_warning_or_error); + /*in_decl=*/NULL_TREE, /*context=*/NULL_TREE, + /*entering scope=*/false, tf_warning_or_error); if (traits_class == error_mark_node || traits_class == NULL_TREE) { @@ -335,9 +334,9 @@ instantiate_coro_handle_for_promise_type (location_t kw, tree promise_type) TREE_VEC_ELT (targ, 0) = promise_type; tree handle_type = lookup_template_class (coro_handle_identifier, targ, - /* in_decl */ NULL_TREE, - /* context */ std_node, - /* entering scope */ false, tf_warning_or_error); + /* in_decl=*/NULL_TREE, + /* context=*/std_node, + /* entering scope=*/false, tf_warning_or_error); if (handle_type == error_mark_node) { @@ -356,7 +355,7 @@ find_promise_type (tree traits_class) { tree promise_type = lookup_member (traits_class, coro_promise_type_identifier, - /* protect */ 1, /*want_type=*/true, tf_warning_or_error); + /* protect=*/1, /*want_type=*/true, tf_warning_or_error); if (promise_type) promise_type @@ -539,7 +538,7 @@ coro_common_keyword_context_valid_p (tree fndecl, location_t kw_loc, /* This is arranged in order of prohibitions in the std. */ if (DECL_MAIN_P (fndecl)) { - // [basic.start.main] 3. The function main shall not be a coroutine. + /* [basic.start.main] 3. The function main shall not be a coroutine. */ error_at (kw_loc, "%qs cannot be used in the % function", kw_name); return false; @@ -547,7 +546,7 @@ coro_common_keyword_context_valid_p (tree fndecl, location_t kw_loc, if (DECL_DECLARED_CONSTEXPR_P (fndecl)) { - // [dcl.constexpr] 3.3 it shall not be a coroutine. + /* [dcl.constexpr] 3.3 it shall not be a coroutine. */ error_at (kw_loc, "%qs cannot be used in a % function", kw_name); cp_function_chain->invalid_constexpr = true; @@ -556,8 +555,8 @@ coro_common_keyword_context_valid_p (tree fndecl, location_t kw_loc, if (FNDECL_USED_AUTO (fndecl)) { - // [dcl.spec.auto] 15. A function declared with a return type that uses - // a placeholder type shall not be a coroutine . + /* [dcl.spec.auto] 15. A function declared with a return type that uses + a placeholder type shall not be a coroutine. */ error_at (kw_loc, "%qs cannot be used in a function with a deduced return type", kw_name); @@ -566,9 +565,9 @@ coro_common_keyword_context_valid_p (tree fndecl, location_t kw_loc, if (varargs_function_p (fndecl)) { - // [dcl.fct.def.coroutine] The parameter-declaration-clause of the - // coroutine shall not terminate with an ellipsis that is not part - // of a parameter-declaration. + /* [dcl.fct.def.coroutine] The parameter-declaration-clause of the + coroutine shall not terminate with an ellipsis that is not part + of a parameter-declaration. */ error_at (kw_loc, "%qs cannot be used in a varargs function", kw_name); return false; @@ -576,14 +575,14 @@ coro_common_keyword_context_valid_p (tree fndecl, location_t kw_loc, if (DECL_CONSTRUCTOR_P (fndecl)) { - // [class.ctor] 7. a constructor shall not be a coroutine. + /* [class.ctor] 7. a constructor shall not be a coroutine. */ error_at (kw_loc, "%qs cannot be used in a constructor", kw_name); return false; } if (DECL_DESTRUCTOR_P (fndecl)) { - // [class.dtor] 21. a destructor shall not be a coroutine. + /* [class.dtor] 21. a destructor shall not be a coroutine. */ error_at (kw_loc, "%qs cannot be used in a destructor", kw_name); return false; } @@ -685,7 +684,7 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind) /* To complete the lookups, we need an instance of 'e' which is built from 'o' according to [expr.await] 3.4. However, we don't want to materialize 'e' here (it might need to be placed in the coroutine frame) so we will - make a temp placeholder instead. */ + make a temp placeholder instead. */ tree e_proxy = build_lang_decl (VAR_DECL, NULL_TREE, o_type); /* I suppose we could check that this is contextually convertible to bool. */ @@ -793,7 +792,7 @@ finish_co_await_expr (location_t kw, tree expr) tree at_meth = lookup_promise_method (current_function_decl, coro_await_transform_identifier, kw, - /*musthave=*/ false); + /*musthave=*/false); if (at_meth == error_mark_node) return error_mark_node; @@ -869,7 +868,7 @@ finish_co_yield_expr (location_t kw, tree expr) call for p.yield_value(e). */ tree y_meth = lookup_promise_method (current_function_decl, coro_yield_value_identifier, kw, - /*musthave=*/ true); + /*musthave=*/true); if (!y_meth || y_meth == error_mark_node) return error_mark_node; @@ -956,7 +955,7 @@ finish_co_return_stmt (location_t kw, tree expr) tree crv_meth = lookup_promise_method (current_function_decl, coro_return_void_identifier, kw, - /*musthave=*/ true); + /*musthave=*/true); if (!crv_meth || crv_meth == error_mark_node) return error_mark_node; @@ -969,7 +968,7 @@ finish_co_return_stmt (location_t kw, tree expr) tree crv_meth = lookup_promise_method (current_function_decl, coro_return_value_identifier, kw, - /*musthave=*/ true); + /*musthave=*/true); if (!crv_meth || crv_meth == error_mark_node) return error_mark_node; @@ -1471,17 +1470,17 @@ co_await_expander (tree *stmt, int * /*do_subtree*/, void *d) /* Implement the suspend, a scope exit without clean ups. */ r = build_call_expr_internal_loc (loc, IFN_CO_SUSPN, void_type_node, 1, susp); r = coro_build_cvt_void_expr_stmt (r, loc); - add_stmt (r); // goto ret; + add_stmt (r); /* goto ret; */ r = build_case_label (build_int_cst (integer_type_node, 1), NULL_TREE, create_anon_label_with_ctx (loc, actor)); - add_stmt (r); // case 1: + add_stmt (r); /* case 1: */ r = build1_loc (loc, GOTO_EXPR, void_type_node, resume_label); - add_stmt (r); // goto resume; + add_stmt (r); /* goto resume; */ r = build_case_label (NULL_TREE, NULL_TREE, create_anon_label_with_ctx (loc, actor)); - add_stmt (r); // default:; + add_stmt (r); /* default:; */ r = build1_loc (loc, GOTO_EXPR, void_type_node, destroy_label); - add_stmt (r); // goto destroy; + add_stmt (r); /* goto destroy; */ /* part of finish switch. */ SWITCH_STMT_BODY (sw) = pop_stmt_list (SWITCH_STMT_BODY (sw)); @@ -1599,8 +1598,7 @@ transform_await_expr (tree await_expr, await_xform_data *xform) in : CO_AWAIT_EXPR (a, e_proxy, o, awr_call_vector, mode) We no longer need a [it had diagnostic value, maybe?] We need to replace the promise proxy in all elements - We need to replace the e_proxy in the awr_call. - */ + We need to replace the e_proxy in the awr_call. */ tree coro_frame_type = TREE_TYPE (xform->actor_frame); tree ah = NULL_TREE; @@ -1608,7 +1606,7 @@ transform_await_expr (tree await_expr, await_xform_data *xform) { tree ah_m = lookup_member (coro_frame_type, si->susp_handle_id, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); ah = build_class_member_access_expr (xform->actor_frame, ah_m, NULL_TREE, true, tf_warning_or_error); } @@ -1623,7 +1621,7 @@ transform_await_expr (tree await_expr, await_xform_data *xform) /* Get a reference to the initial suspend var in the frame. */ tree as_m = lookup_member (coro_frame_type, si->await_field_id, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree as = build_class_member_access_expr (xform->actor_frame, as_m, NULL_TREE, true, tf_warning_or_error); @@ -1730,7 +1728,7 @@ transform_local_var_uses (tree *stmt, int *do_subtree, void *d) tree fld_ref = lookup_member (lvd->coro_frame_type, local_var.field_id, - /*protect*/ 1, /*want_type*/ 0, + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree fld_idx = build3_loc (lvd->loc, COMPONENT_REF, TREE_TYPE (lvar), lvd->actor_frame, fld_ref, NULL_TREE); @@ -1749,7 +1747,7 @@ transform_local_var_uses (tree *stmt, int *do_subtree, void *d) if (local_var.field_id == NULL_TREE) pvar = &DECL_CHAIN (*pvar); /* Wasn't used. */ - *pvar = DECL_CHAIN (*pvar); // discard this one, we replaced it. + *pvar = DECL_CHAIN (*pvar); /* discard this one, we replaced it. */ } *do_subtree = 0; /* We've done the body already. */ @@ -1855,7 +1853,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, /* We will discard this, since it's connected to the original scope nest. */ tree block = BIND_EXPR_BLOCK (first); - if (block) // For this to be missing is probably a bug. + if (block) /* For this to be missing is probably a bug. */ { gcc_assert (BLOCK_SUPERCONTEXT (block) == NULL_TREE); gcc_assert (BLOCK_CHAIN (block) == NULL_TREE); @@ -1884,7 +1882,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, if (parm.field_id == NULL_TREE) continue; /* Wasn't used. */ tree fld_ref = lookup_member (coro_frame_type, parm.field_id, - /*protect*/ 1, /*want_type*/ 0, + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree fld_idx = build3_loc (loc, COMPONENT_REF, TREE_TYPE (arg), actor_frame, fld_ref, NULL_TREE); @@ -2032,7 +2030,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, tree return_void = NULL_TREE; tree rvm = lookup_promise_method (orig, coro_return_void_identifier, loc, - /*musthave=*/ false); + /*musthave=*/false); if (rvm && rvm != error_mark_node) return_void = build_new_method_call (ap, rvm, NULL, NULL_TREE, LOOKUP_NORMAL, NULL, @@ -2070,7 +2068,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, branch to the final resume, and fall through to the destroy. */ tree resume_m = lookup_member (coro_frame_type, get_identifier ("__resume"), - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree res_x = build_class_member_access_expr (actor_frame, resume_m, NULL_TREE, false, tf_warning_or_error); r = build1 (CONVERT_EXPR, act_des_fn_ptr, integer_zero_node); @@ -2186,7 +2184,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody, /* We need the resume index to work with. */ tree res_idx_m = lookup_member (coro_frame_type, resume_idx_name, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree res_idx = build_class_member_access_expr (actor_frame, res_idx_m, NULL_TREE, false, tf_warning_or_error); @@ -2313,7 +2311,7 @@ build_init_or_final_await (location_t loc, bool is_final) tree suspend_alt = is_final ? coro_final_suspend_identifier : coro_initial_suspend_identifier; tree setup_meth = lookup_promise_method (current_function_decl, suspend_alt, - loc, /*musthave=*/ true); + loc, /*musthave=*/true); if (!setup_meth || setup_meth == error_mark_node) return error_mark_node; @@ -2551,8 +2549,8 @@ register_awaits (tree *stmt, int *do_subtree ATTRIBUTE_UNUSED, void *d) await-suspend.resume() is evaluated. (5.1.2) if the type of await-suspend is bool, await-suspend is evaluated, and the coroutine is resumed if the result is false. - (5.1.3) Otherwise, await-suspend is evaluated. - */ + (5.1.3) Otherwise, await-suspend is evaluated. */ + tree susp_typ = get_await_suspend_return_type (aw_expr); tree handle_field_nam; if (VOID_TYPE_P (susp_typ) || TREE_CODE (susp_typ) == BOOLEAN_TYPE) @@ -2596,10 +2594,9 @@ maybe_promote_captured_temps (tree *stmt, void *d) /* When register_awaits sees an await, it walks the initializer for that await looking for temporaries captured by reference and notes - them in awpts->captured_temps. We only need to take any action - here if the statement contained any awaits, and any of those had - temporaries captured by reference in the initializers for their class. - */ + them in awpts->captured_temps. We only need to take any action here + if the statement contained any awaits, and any of those had temporaries + captured by reference in the initializers for their class. */ tree res = cp_walk_tree (stmt, register_awaits, d, &visited); if (!res && awpts->saw_awaits > 0 && !awpts->captured_temps.is_empty ()) @@ -2797,8 +2794,8 @@ register_local_var_uses (tree *stmt, int *do_subtree, void *d) /* As we enter a bind expression - record the vars there and then recurse. As we exit drop the nest depth. The bind index is a growing count of how many bind indices we've seen. - We build a space in the frame for each local var. - */ + We build a space in the frame for each local var. */ + if (TREE_CODE (*stmt) == BIND_EXPR) { lvd->bind_indx++; @@ -2828,7 +2825,7 @@ register_local_var_uses (tree *stmt, int *do_subtree, void *d) } else { - namsize += 10; // 'D' followed by an unsigned. + namsize += 10; /* 'D' followed by an unsigned. */ buf = (char *) alloca (namsize); snprintf (buf, namsize, "__%s.%u.%u.D%u", nm, lvd->bind_indx, lvd->nest_depth, DECL_UID (lvar)); @@ -2881,8 +2878,8 @@ register_local_var_uses (tree *stmt, int *do_subtree, void *d) void (*__resume)(_R_frame *); void (*__destroy)(_R_frame *); coro1::promise_type __p; - bool frame_needs_free; // free the coro frame mem if set. - short __resume_at; // this is where clang puts it - but it's a smaller entity. + bool frame_needs_free; free the coro frame mem if set. + short __resume_at; coro1::suspend_never_prt __is; (maybe) handle_type i_hand; coro1::suspend_always_prt __fs; @@ -2929,8 +2926,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) If we encounter a fatal error we might return a now-empty body. TODO: determine if it would help to restore the original. determine if looking for more errors in coro_function_valid_p() - and stashing types is a better solution. - */ + and stashing types is a better solution. */ tree newbody = push_stmt_list (); DECL_SAVED_TREE (orig) = newbody; @@ -3174,11 +3170,11 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) 2. Otherwise, we call new and the ramp is expected to terminate with an unhandled exception in the case of failure to allocate. - The get_return_object_on_allocation_failure() must be a static method. - */ + The get_return_object_on_allocation_failure() must be a static method. */ + tree grooaf_meth = lookup_promise_method (orig, coro_gro_on_allocation_fail_identifier, - fn_start, /*musthave=*/ false); + fn_start, /*musthave=*/false); /* The CO_FRAME internal function is a mechanism to allow the middle end to adjust the allocation in response to optimisations. We provide the @@ -3203,7 +3199,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) TREE_USED (fn) = 1; } tree nth_ns = lookup_qualified_name (std_node, get_identifier ("nothrow"), - 0, /*complain=*/ true, false); + 0, /*complain=*/true, false); arglist->quick_push (nth_ns); } @@ -3213,7 +3209,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) /* The user can (optionally) provide an allocation function in the promise type, it's not a failure for it to be absent. */ tree fns = lookup_promise_method (orig, nwname, fn_start, - /*musthave=*/ false); + /*musthave=*/false); tree new_fn = NULL_TREE; if (fns && fns != error_mark_node) { @@ -3233,7 +3229,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) { fns =lookup_name_real (nwname, 0, 1, /*block_p=*/true, 0, 0); new_fn = lookup_arg_dependent (nwname, fns, arglist); - new_fn = build_new_function_call (new_fn, &arglist, /*complain=*/ true); + new_fn = build_new_function_call (new_fn, &arglist, /*complain=*/true); } tree allocated = build1 (CONVERT_EXPR, coro_frame_ptr, new_fn); @@ -3256,7 +3252,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) grooaf); r = coro_build_cvt_void_expr_stmt (r, fn_start); append_to_statement_list (r, &early_ret_list); - // We know it's the correct type. + /* We know it's the correct type. */ r = DECL_RESULT (orig); r = build_stmt (fn_start, RETURN_EXPR, r); TREE_NO_WARNING (r) |= 1; @@ -3294,7 +3290,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) tree actor_addr = build1 (ADDR_EXPR, act_des_fn_ptr, actor); tree resume_m = lookup_member (coro_frame_type, resume_name, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree resume_x = build_class_member_access_expr (deref_fp, resume_m, NULL_TREE, false, tf_warning_or_error); r = build2_loc (fn_start, INIT_EXPR, act_des_fn_ptr, resume_x, actor_addr); @@ -3304,7 +3300,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) tree destroy_addr = build1 (ADDR_EXPR, act_des_fn_ptr, destroy); tree destroy_m = lookup_member (coro_frame_type, destroy_name, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree destroy_x = build_class_member_access_expr (deref_fp, destroy_m, NULL_TREE, false, tf_warning_or_error); @@ -3315,7 +3311,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) /* Set up the promise. */ tree promise_m = lookup_member (coro_frame_type, promise_name, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree p = build_class_member_access_expr (deref_fp, promise_m, NULL_TREE, false, tf_warning_or_error); @@ -3328,8 +3324,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) First try to find a constructor with the same parameter list as the original function (if it has params), failing that find a constructor - with no parameter list. - */ + with no parameter list. */ if (DECL_ARGUMENTS (orig)) { @@ -3368,7 +3363,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) continue; /* Wasn't used. */ tree fld_ref = lookup_member (coro_frame_type, parm.field_id, - /*protect*/ 1, /*want_type*/ 0, + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree fld_idx = build_class_member_access_expr (deref_fp, fld_ref, NULL_TREE, @@ -3381,7 +3376,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) && (CLASSTYPE_LAZY_MOVE_CTOR (parm.frame_type) || CLASSTYPE_LAZY_MOVE_ASSIGN (parm.frame_type) || classtype_has_move_assign_or_move_ctor_p - (parm.frame_type, /* user-declared */ true))) + (parm.frame_type, /*user_declared=*/true))) p_in = make_tree_vector_single (rvalue (arg)); else p_in = make_tree_vector_single (arg); @@ -3419,7 +3414,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) continue; tree fld_ref = lookup_member (coro_frame_type, cap.field_id, - /*protect*/ 1, /*want_type*/ 0, + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree fld_idx = build_class_member_access_expr (deref_fp, fld_ref, NULL_TREE, @@ -3439,7 +3434,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) && (CLASSTYPE_LAZY_MOVE_CTOR (cap_type) || CLASSTYPE_LAZY_MOVE_ASSIGN (cap_type) || classtype_has_move_assign_or_move_ctor_p - (cap_type, /* user-declared */ true))) + (cap_type, /*user_declared=*/true))) p_in = make_tree_vector_single (rvalue (cap.captured)); else p_in = make_tree_vector_single (cap.captured); @@ -3478,7 +3473,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) tree gro_meth = lookup_promise_method (orig, coro_get_return_object_identifier, - fn_start, /*musthave=*/ true ); + fn_start, /*musthave=*/true ); tree get_ro = build_new_method_call (p, gro_meth, NULL, NULL_TREE, LOOKUP_NORMAL, NULL, tf_warning_or_error); @@ -3495,7 +3490,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) if (same_type_p (TREE_TYPE (get_ro), fn_return_type)) { gro = DECL_RESULT (orig); - gro_bind_vars = NULL_TREE; // We don't need a separate var. + gro_bind_vars = NULL_TREE; /* We don't need a separate var. */ } else { @@ -3504,10 +3499,10 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) DECL_CONTEXT (gro) = current_scope (); r = build_stmt (fn_start, DECL_EXPR, gro); add_stmt (r); - gro_bind_vars = gro; // We need a temporary var. + gro_bind_vars = gro; /* We need a temporary var. */ } - // init our actual var. + /* Initialize our actual var. */ r = build2_loc (fn_start, INIT_EXPR, TREE_TYPE (gro), gro, get_ro); r = coro_build_cvt_void_expr_stmt (r, fn_start); add_stmt (r); @@ -3515,7 +3510,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) /* Initialize the resume_idx_name to 0, meaning "not started". */ tree resume_idx_m = lookup_member (coro_frame_type, resume_idx_name, - /*protect*/ 1, /*want_type*/ 0, tf_warning_or_error); + /*protect=*/1, /*want_type=*/0, tf_warning_or_error); tree resume_idx = build_class_member_access_expr (deref_fp, resume_idx_m, NULL_TREE, false, tf_warning_or_error); @@ -3540,7 +3535,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) } else { - // construct the return value with a single GRO param. + /* construct the return value with a single GRO param. */ vec *args = make_tree_vector_single (gro); r = build_special_member_call (DECL_RESULT (orig), complete_ctor_identifier, &args, @@ -3576,7 +3571,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) orig_fn_has_outer_bind = true; tree block = BIND_EXPR_BLOCK (first); replace_blk = make_node (BLOCK); - if (block) // missing block is probably an error. + if (block) /* missing block is probably an error. */ { gcc_assert (BLOCK_SUPERCONTEXT (block) == NULL_TREE); gcc_assert (BLOCK_CHAIN (block) == NULL_TREE); @@ -3592,7 +3587,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) { tree ueh_meth = lookup_promise_method (orig, coro_unhandled_exception_identifier, - fn_start, /*musthave=*/ true); + fn_start, /*musthave=*/true); /* Build promise.unhandled_exception(); */ tree ueh = build_new_method_call (p, ueh_meth, NULL, NULL_TREE, LOOKUP_NORMAL, @@ -3633,7 +3628,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) present. */ tree ueh_meth = lookup_promise_method (orig, coro_unhandled_exception_identifier, - fn_start, /*musthave=*/ false); + fn_start, /*musthave=*/false); if (!ueh_meth || ueh_meth == error_mark_node) warning_at (fn_start, 0, "no member named %qE in %qT", coro_unhandled_exception_identifier,