From patchwork Tue Jun 16 21:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1310726 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=d/KQVSYR; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 49mhvv1PXxz9sR4 for ; Wed, 17 Jun 2020 08:00:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CFE02383F871; Tue, 16 Jun 2020 22:00:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFE02383F871 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592344824; bh=3LI/R8gwrLMBa/Qp9ppa+lkvEitF4NoIVTg0Su3ZyT4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=d/KQVSYRLQowlHwSSBD/ixwZeeNIwaWW/bV1uLLIOxzFDQzmSYpeVnyBS0eomV0LV qo4bOOvj8OjDoHq/kTz7tksmdrgtfAZLFDoHA2az86gIDRMrpUuRspQrgYITWPvhvy XcRJiuxYV+LOuVCRJDQL2mSE9O+LqUJsXQV5kqhE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by sourceware.org (Postfix) with ESMTPS id 53CE3388A815 for ; Tue, 16 Jun 2020 22:00:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 53CE3388A815 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 49mhvm3L70zKmhY; Wed, 17 Jun 2020 00:00:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id t55_2H5AiM4T; Wed, 17 Jun 2020 00:00:11 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Remove names of unused function parameters. Date: Tue, 16 Jun 2020 23:59:28 +0200 Message-Id: <20200616215933.3858164-5-ibuclaw@gdcproject.org> In-Reply-To: <20200616215933.3858164-1-ibuclaw@gdcproject.org> References: <20200616215933.3858164-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 520F21768 X-Rspamd-Score: 1.27 / 15.00 / 15.00 X-Spam-Status: No, score=-17.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, 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: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch replaces ARG_UNUSED and ATTRIBUTE_UNUSED with unnamed parameters. As the unused attribute was being used incorrectly. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-attribs.cc (handle_noreturn_attribute): Remove names of unused function parameters. (handle_leaf_attribute): Likewise. (handle_const_attribute): Likewise. (handle_malloc_attribute): Likewise. (handle_pure_attribute): Likewise. (handle_novops_attribute): Likewise. (handle_nonnull_attribute): Likewise. (handle_nothrow_attribute): Likewise. (handle_type_generic_attribute): Likewise. (handle_transaction_pure_attribute): Likewise. (handle_returns_twice_attribute): Likewise. (handle_fnspec_attribute): Likewise. (handle_always_inline_attribute): Likewise. (d_handle_noinline_attribute): Likewise. (d_handle_forceinline_attribute): Likewise. (d_handle_flatten_attribute): Likewise. (d_handle_noclone_attribute): Likewise. (d_handle_section_attribute): Likewise. (d_handle_alias_attribute): Likewise. (d_handle_weak_attribute): Likewise. --- gcc/d/d-attribs.cc | 96 +++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 65 deletions(-) diff --git a/gcc/d/d-attribs.cc b/gcc/d/d-attribs.cc index 31137957c46..964f59f96f4 100644 --- a/gcc/d/d-attribs.cc +++ b/gcc/d/d-attribs.cc @@ -344,15 +344,15 @@ apply_user_attributes (Dsymbol *sym, tree node) input_location = saved_location; } -/* Built-in attribute handlers. */ +/* Built-in attribute handlers. + These functions take the arguments: + (tree *node, tree name, tree args, int flags, bool *no_add_attrs) */ /* Handle a "noreturn" attribute; arguments as in struct attribute_spec.handler. */ static tree -handle_noreturn_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_noreturn_attribute (tree *node, tree, tree, int, bool *) { tree type = TREE_TYPE (*node); @@ -374,9 +374,7 @@ handle_noreturn_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -handle_leaf_attribute (tree *node, tree name, - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), bool *no_add_attrs) +handle_leaf_attribute (tree *node, tree name, tree, int, bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_DECL) { @@ -396,9 +394,7 @@ handle_leaf_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -handle_const_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_const_attribute (tree *node, tree, tree, int, bool *) { tree type = TREE_TYPE (*node); @@ -420,9 +416,7 @@ handle_const_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ tree -handle_malloc_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_malloc_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node)))); @@ -434,9 +428,7 @@ handle_malloc_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -handle_pure_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_pure_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); DECL_PURE_P (*node) = 1; @@ -447,9 +439,7 @@ handle_pure_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -handle_novops_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_novops_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); DECL_IS_NOVOPS (*node) = 1; @@ -473,9 +463,7 @@ get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp) /* Handle the "nonnull" attribute. */ static tree -handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), - tree args, int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_nonnull_attribute (tree *node, tree, tree args, int, bool *) { tree type = *node; @@ -525,9 +513,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -handle_nothrow_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_nothrow_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); TREE_NOTHROW (*node) = 1; @@ -537,9 +523,7 @@ handle_nothrow_attribute (tree *node, tree ARG_UNUSED (name), /* Handle a "type_generic" attribute. */ static tree -handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_type_generic_attribute (tree *node, tree, tree, int, bool *) { /* Ensure we have a function type. */ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); @@ -553,10 +537,7 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), /* Handle a "transaction_pure" attribute. */ static tree -handle_transaction_pure_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_transaction_pure_attribute (tree *node, tree, tree, int, bool *) { /* Ensure we have a function type. */ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); @@ -567,10 +548,7 @@ handle_transaction_pure_attribute (tree *node, tree ARG_UNUSED (name), /* Handle a "returns_twice" attribute. */ static tree -handle_returns_twice_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +handle_returns_twice_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); @@ -583,9 +561,7 @@ handle_returns_twice_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ tree -handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name), - tree args, int ARG_UNUSED (flags), - bool *no_add_attrs ATTRIBUTE_UNUSED) +handle_fnspec_attribute (tree *, tree, tree args, int, bool *) { gcc_assert (args && TREE_CODE (TREE_VALUE (args)) == STRING_CST @@ -597,23 +573,22 @@ handle_fnspec_attribute (tree *node ATTRIBUTE_UNUSED, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -handle_always_inline_attribute (tree *node, tree ARG_UNUSED (name), - tree ARG_UNUSED (args), int ARG_UNUSED (flags), - bool *no_add_attrs ATTRIBUTE_UNUSED) +handle_always_inline_attribute (tree *node, tree, tree, int, bool *) { gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); return NULL_TREE; } -/* Language specific attribute handlers. */ +/* Language specific attribute handlers. + These functions take the arguments: + (tree *node, tree name, tree args, int flags, bool *no_add_attrs) */ /* Handle a "noinline" attribute. */ static tree -d_handle_noinline_attribute (tree *node, tree name, - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), bool *no_add_attrs) +d_handle_noinline_attribute (tree *node, tree name, tree, int, + bool *no_add_attrs) { Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node)); @@ -631,9 +606,7 @@ d_handle_noinline_attribute (tree *node, tree name, /* Handle a "forceinline" attribute. */ static tree -d_handle_forceinline_attribute (tree *node, tree name, - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), +d_handle_forceinline_attribute (tree *node, tree name, tree, int, bool *no_add_attrs) { Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node)); @@ -663,9 +636,8 @@ d_handle_forceinline_attribute (tree *node, tree name, /* Handle a "flatten" attribute. */ static tree -d_handle_flatten_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +d_handle_flatten_attribute (tree *node, tree name, tree, int, + bool *no_add_attrs) { Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node)); @@ -701,10 +673,8 @@ d_handle_target_attribute (tree *node, tree name, tree args, int flags, /* Handle a "noclone" attribute. */ static tree -d_handle_noclone_attribute (tree *node, tree name, - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), - bool *no_add_attrs) +d_handle_noclone_attribute (tree *node, tree name, tree, int, + bool *no_add_attrs) { Type *t = TYPE_LANG_FRONTEND (TREE_TYPE (*node)); @@ -730,8 +700,8 @@ d_handle_noclone_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -d_handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args, - int ARG_UNUSED (flags), bool *no_add_attrs) +d_handle_section_attribute (tree *node, tree, tree args, int, + bool *no_add_attrs) { tree decl = *node; @@ -791,9 +761,8 @@ d_handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args, struct attribute_spec.handler. */ static tree -d_handle_alias_attribute (tree *node, tree ARG_UNUSED (name), - tree args, int ARG_UNUSED (flags), - bool *no_add_attrs ATTRIBUTE_UNUSED) +d_handle_alias_attribute (tree *node, tree name, tree args, int, + bool *no_add_attrs) { tree decl = *node; @@ -850,10 +819,7 @@ d_handle_alias_attribute (tree *node, tree ARG_UNUSED (name), struct attribute_spec.handler. */ static tree -d_handle_weak_attribute (tree *node, tree name, - tree ARG_UNUSED (args), - int ARG_UNUSED (flags), - bool * ARG_UNUSED (no_add_attrs)) +d_handle_weak_attribute (tree *node, tree name, tree, int, bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (*node))