From patchwork Tue Jul 4 15:58:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 115845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1316543vqx; Tue, 4 Jul 2023 08:59:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFbwnu3KpHcz4YCWHq8k5ttywUlXpPVihnjeftw+HwFP5jrQgqL64F8P75kKxfGJQzUrh5 X-Received: by 2002:a17:906:f9d6:b0:993:74b5:1359 with SMTP id lj22-20020a170906f9d600b0099374b51359mr4762587ejb.27.1688486369458; Tue, 04 Jul 2023 08:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688486369; cv=none; d=google.com; s=arc-20160816; b=pi4PFFXstVJy4DNz+tVG2fLmOofMRrfmIAW68MJ/yXdcKpOynvd0l9bVCRmy5Fc4Dn Rl+wixeYXa3AJIr8EXPAm+XEQI2FPaSrRhD0gtd/iXt1f8q/fCAKbauaein2HkF43JJC cw1Yie1BwLw+F6zRqZGn9kNm1IyGqA8DbT41JpGUnmoWe51C/JMRNS2+J1N2tHXwWUiy FyK4ukx5xxZfon2smah7msP62GvywVR5qUpoAoLR6HYPlgNu3vB4e9Sd/j0VXHTrL1KE ATuJTUF/LAFqBNmL0I+haTZiHq6yjltS+94jFaBr9tP8M4ciopxUVilJQuu9nUItuVMp Oe/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=41VZ9AO4SJj3SA/sQmv2tMwhJEj6UlvZ7rc1UtW1rCo=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=LYy/VgzM8v6DXqzzb76fBXfGUkSsYuDSRs8JyUU7ZRvIXXgQ0PFBB1WExa+ETLuo6q DiWb90+f31bFNRPMXQ5SVYLu+aRpLAqYicB2jXE8ZB8ayTLkdMXCxVW2vSSNlIynLiJP Ay5hRG75QJHd4UW4OlbymAHI3T65JEvao/O5SYNcAEEuj8cKCEEhEXA6cYXiRq7GHnvz kLH2FsVITITVc8SthJK6fQVzj60bF4jbFx2+UFFoAF3fWbV3hEuBVXVW+HsJe0XlC+7b ka+rd2gzr37lXvYvWmM7MhzgPIhrXUju36Bg+Nru8m+VjcGevyoZC4bu8jRAjlX8CeTq Ceog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hb10-20020a170906b88a00b009929566f00asi8165799ejb.467.2023.07.04.08.59.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 08:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D2D7385701E for ; Tue, 4 Jul 2023 15:59:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 7518E3858D35 for ; Tue, 4 Jul 2023 15:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7518E3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.01,181,1684828800"; d="scan'208,223";a="10892651" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 04 Jul 2023 07:58:57 -0800 IronPort-SDR: d0uISZ1w02vhknTrdAENYuIURnmh3yfJBQ01FVRkhnm21LrTJSsfexTJGf6f7YykK4VReCbnNN ElNDqByyegJzLOcaj7prd9G3SUQ6dNudzFpU2THaYXJWd7Bm3xmM7K8XQuZQRAH6GI8O047sqh +XA85+sfJOkhd4PAKcTpV0QHARVdBYxy9OGEhdM52phi8NdTeNxh7nrKnm7h6Ks7uTpWqJ5CEn /2NZKIXUo4cJ2BJuO1cw7lxMsnMRWDkmgVsf2MRa0bvW6GTI5H4Z6eRkpolNZYGgYeP0JV6USR 76E= From: Thomas Schwinge To: Subject: GGC: Remove unused 'bool is_string' arguments to 'ggc_pch_{count,alloc,write}_object' (was: RFA - Remove GC zone allocator) In-Reply-To: References: <20130122143307.GA3824@google.com> <50FFAB3C.6060202@arm.com> <72a04a5e-7da6-4809-a9a8-b5ecffd01351@email.android.com> <20130123143258.GH7269@tucnak.redhat.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Tue, 4 Jul 2023 17:58:51 +0200 Message-ID: <87edlnvfb8.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770506283459367000?= X-GMAIL-MSGID: =?utf-8?q?1770506283459367000?= Hi! On 2013-01-24T10:14:58-0500, Diego Novillo wrote: > [...] the patch [...] committed [...] This did clean up some things: > --- a/gcc/ggc-internal.h > +++ b/gcc/ggc-internal.h > @@ -55,8 +55,7 @@ extern struct ggc_pch_data *init_ggc_pch (void); > of an object. Update the ggc_pch_data structure with as much of > that information as is necessary. The bool argument should be true > if the object is a string. */ > -extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool, > - enum gt_types_enum); > +extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool); > > /* Return the total size of the data to be written to hold all > the objects previously passed to ggc_pch_count_object. */ > @@ -69,8 +68,7 @@ extern void ggc_pch_this_base (struct ggc_pch_data *, void *); > /* Assuming that the objects really do end up at the address > passed to ggc_pch_this_base, return the address of this object. > The bool argument should be true if the object is a string. */ > -extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t, bool, > - enum gt_types_enum); > +extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t, bool); > --- a/gcc/ggc-page.c > +++ b/gcc/ggc-page.c > @@ -2230,8 +2221,7 @@ init_ggc_pch (void) > > void > ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, > - size_t size, bool is_string ATTRIBUTE_UNUSED, > - enum gt_types_enum type ATTRIBUTE_UNUSED) > + size_t size, bool is_string ATTRIBUTE_UNUSED) > { > unsigned order; > > @@ -2274,8 +2264,7 @@ ggc_pch_this_base (struct ggc_pch_data *d, void *base) > > char * > ggc_pch_alloc_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, > - size_t size, bool is_string ATTRIBUTE_UNUSED, > - enum gt_types_enum type ATTRIBUTE_UNUSED) > + size_t size, bool is_string ATTRIBUTE_UNUSED) > { > unsigned order; > char *result; ..., but left in other 'ATTRIBUTE_UNUSED's. To enable another thing I'm working on, OK to push the attached clean-up "GGC: Remove unused 'bool is_string' arguments to 'ggc_pch_{count,alloc,write}_object'"? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 1267d24dde89b2e8dfb8e5f3b6e2928052b344c5 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 1 Jul 2023 00:25:05 +0200 Subject: [PATCH] GGC: Remove unused 'bool is_string' arguments to 'ggc_pch_{count,alloc,write}_object' They're unused since the removal of 'gcc/ggc-zone.c' in 2013 Subversion r195426 (Git commit cd030c079e5e42fe3f49261fe01f384e6b7f0111) "Remove zone allocator". Should any future 'gcc/ggc-[...].cc' ever need this again, it'll be a conscious decision at that time. gcc/ * ggc-internal.h (ggc_pch_count_object, ggc_pch_alloc_object) (ggc_pch_write_object): Remove 'bool is_string' argument. * ggc-common.cc: Adjust. * ggc-page.cc: Likewise. --- gcc/ggc-common.cc | 9 +++------ gcc/ggc-internal.h | 15 ++++++--------- gcc/ggc-page.cc | 6 +++--- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/gcc/ggc-common.cc b/gcc/ggc-common.cc index db317f49993..173ab64cb73 100644 --- a/gcc/ggc-common.cc +++ b/gcc/ggc-common.cc @@ -336,8 +336,7 @@ ggc_call_count (ptr_data **slot, traversal_state *state) { struct ptr_data *d = *slot; - ggc_pch_count_object (state->d, d->obj, d->size, - d->note_ptr_fn == gt_pch_p_S); + ggc_pch_count_object (state->d, d->obj, d->size); state->count++; return 1; } @@ -347,8 +346,7 @@ ggc_call_alloc (ptr_data **slot, traversal_state *state) { struct ptr_data *d = *slot; - d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size, - d->note_ptr_fn == gt_pch_p_S); + d->new_addr = ggc_pch_alloc_object (state->d, d->obj, d->size); state->ptrs[state->ptrs_i++] = d; return 1; } @@ -642,8 +640,7 @@ gt_pch_save (FILE *f) state.ptrs[i]->note_ptr_cookie, relocate_ptrs, &state); ggc_pch_write_object (state.d, state.f, state.ptrs[i]->obj, - state.ptrs[i]->new_addr, state.ptrs[i]->size, - state.ptrs[i]->note_ptr_fn == gt_pch_p_S); + state.ptrs[i]->new_addr, state.ptrs[i]->size); if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S) memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size); #if defined ENABLE_VALGRIND_ANNOTATIONS && defined VALGRIND_GET_VBITS diff --git a/gcc/ggc-internal.h b/gcc/ggc-internal.h index 25e6ce66ebc..33874bcec99 100644 --- a/gcc/ggc-internal.h +++ b/gcc/ggc-internal.h @@ -52,9 +52,8 @@ extern struct ggc_pch_data *init_ggc_pch (void); /* The second parameter and third parameters give the address and size of an object. Update the ggc_pch_data structure with as much of - that information as is necessary. The bool argument should be true - if the object is a string. */ -extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool); + that information as is necessary. */ +extern void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t); /* Return the total size of the data to be written to hold all the objects previously passed to ggc_pch_count_object. */ @@ -65,17 +64,15 @@ extern size_t ggc_pch_total_size (struct ggc_pch_data *); extern void ggc_pch_this_base (struct ggc_pch_data *, void *); /* Assuming that the objects really do end up at the address - passed to ggc_pch_this_base, return the address of this object. - The bool argument should be true if the object is a string. */ -extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t, bool); + passed to ggc_pch_this_base, return the address of this object. */ +extern char *ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t); /* Write out any initial information required. */ extern void ggc_pch_prepare_write (struct ggc_pch_data *, FILE *); -/* Write out this object, including any padding. The last argument should be - true if the object is a string. */ +/* Write out this object, including any padding. */ extern void ggc_pch_write_object (struct ggc_pch_data *, FILE *, void *, - void *, size_t, bool); + void *, size_t); /* All objects have been written, write out any final information required. */ diff --git a/gcc/ggc-page.cc b/gcc/ggc-page.cc index c25218d7415..62b1b5cbc11 100644 --- a/gcc/ggc-page.cc +++ b/gcc/ggc-page.cc @@ -2409,7 +2409,7 @@ init_ggc_pch (void) void ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, - size_t size, bool is_string ATTRIBUTE_UNUSED) + size_t size) { unsigned order; @@ -2452,7 +2452,7 @@ ggc_pch_this_base (struct ggc_pch_data *d, void *base) char * ggc_pch_alloc_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, - size_t size, bool is_string ATTRIBUTE_UNUSED) + size_t size) { unsigned order; char *result; @@ -2481,7 +2481,7 @@ ggc_pch_prepare_write (struct ggc_pch_data *d ATTRIBUTE_UNUSED, void ggc_pch_write_object (struct ggc_pch_data *d, FILE *f, void *x, void *newx ATTRIBUTE_UNUSED, - size_t size, bool is_string ATTRIBUTE_UNUSED) + size_t size) { unsigned order; static const char emptyBytes[256] = { 0 }; -- 2.34.1