From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id g8C7LWpF2mpOIwwAWB0awg (envelope-from ) for ; Thu, 22 Oct 2026 13:18:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 8BDFE1E033; Thu, 22 Oct 2026 13:18:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D04371E007 for ; Thu, 22 Oct 2026 13:18:33 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B48474BA23D5 for ; Thu, 22 Oct 2026 17:18:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B48474BA23D5 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E12984BA2E29 for ; Thu, 22 Oct 2026 17:18:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E12984BA2E29 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E12984BA2E29 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792689490; cv=none; b=fdLlTE7ikM7QoKi+yMKRaX0hRkgVagNyavnFE5OFErWFsZYSOOLrMrEL6QurCraO4FBwkUYcsXAfwjJQs5E/sf/X4SJ3Kz+/UMJh0WJ9mN+ZfSnsYINCHGqxChFgz4bQ43eHnDQXt4OXek6qzHcSMe0whsWX8za3x2I2Yfu/0BI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792689490; c=relaxed/simple; bh=gZXFwep2MeTWeviHQCvTCwOvjpXmbM6ihHItQ1gme/w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=mEehFWVhgYbb7LRl60NF1GgVZp5INuZXuflFgajMmHoom6DJLbCu1RdZdCvVNdtX2TCVHHbSZLDdbIe1/ZDAPOuCs5pH+PUciC53S7GXR8cPHPcU9WiwM4TpvvYDVnMzhyG0e3q0aWUIh3CNCXThvEsJpG9ApviZ2ZuZHej4MkI= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E12984BA2E29 Received: by simark.ca (Postfix) id 95F441E007; Thu, 22 Oct 2026 13:18:08 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdb: remove replace_type Date: Thu, 22 Oct 2026 13:18:06 -0400 Message-ID: <20261022171807.273513-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org replace_type has been unused since commit eaea19f98d87 ("gdb: Fully remove stabs code from GDB", 2025-02-12), which removed its last caller in stabsread.c. Remove it. Change-Id: Ifb7aebb13a5d179cf22bacc7fabe265333288e99 --- gdb/gdbtypes.c | 46 ---------------------------------------------- gdb/gdbtypes.h | 2 -- 2 files changed, 48 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 97e7a012b0c5..7bdd2744cf54 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -652,52 +652,6 @@ make_atomic_type (struct type *type) return make_qualified_type (type, new_flags, nullptr); } -/* Replace the contents of ntype with the type *type. This changes the - contents, rather than the pointer for TYPE_MAIN_TYPE (ntype); thus - the changes are propagated to all types in the TYPE_CHAIN. - - In order to build recursive types, it's inevitable that we'll need - to update types in place --- but this sort of indiscriminate - smashing is ugly, and needs to be replaced with something more - controlled. TYPE_MAIN_TYPE is a step in this direction; it's not - clear if more steps are needed. */ - -void -replace_type (struct type *ntype, struct type *type) -{ - struct type *chain; - - /* These two types had better be in the same objfile. Otherwise, - the assignment of one type's main type structure to the other - will produce a type with references to objects (names; field - lists; etc.) allocated on an objfile other than its own. */ - gdb_assert (ntype->objfile_owner () == type->objfile_owner ()); - - *ntype->main_type = *type->main_type; - - /* The type length is not a part of the main type. Update it for - each type on the variant chain. */ - chain = ntype; - do - { - /* Assert that this element of the chain has no address-class bits - set in its flags. Such type variants might have type lengths - which are supposed to be different from the non-address-class - variants. This assertion shouldn't ever be triggered because - symbol readers which do construct address-class variants don't - call replace_type(). */ - gdb_assert (chain->address_class () == 0); - - chain->set_length (type->length ()); - chain = chain->chain; - } - while (ntype != chain); - - /* Assert that the two types have equivalent instance qualifiers. - This should be true for at least all of our debug readers. */ - gdb_assert (ntype->instance_flags () == type->instance_flags ()); -} - /* See gdbtypes.h. */ type * diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index af3d47c4a20d..9650d1463322 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -2495,8 +2495,6 @@ extern struct type *make_unqualified_type (struct type *); extern struct type *make_atomic_type (struct type *); -extern void replace_type (struct type *, struct type *); - extern struct type *make_type_with_harvard_address_space (struct type *type, enum harvard_address_space aspace); base-commit: 638f6237867858a849f3d6ffa1a1f8d6cd669636 -- 2.56.0