From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yQT7D0UTuGliEiwAWB0awg (envelope-from ) for ; Mon, 16 Mar 2026 10:27:17 -0400 Received: by simark.ca (Postfix, from userid 112) id 314201E0BC; Mon, 16 Mar 2026 10:27:17 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 73AD01E0BC for ; Mon, 16 Mar 2026 10:27:16 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 08A514BB3BFB for ; Mon, 16 Mar 2026 14:27:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08A514BB3BFB Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 0FACB4B9DB74 for ; Mon, 16 Mar 2026 14:26:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FACB4B9DB74 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 0FACB4B9DB74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773671211; cv=none; b=QMfLPF7cJ5YtJ5JbacS4WyBT+YzZOK9U5taQ6T7U+jScm28I1Ma/mXxopbfB1uKa2yZTjpG4/c4huYPVaeeeW6lHD1K13hpDBMSzgLZzWY45nrL6kDaSt0Dd0tnweH6iC3XyQkctbXsaToFmAx8GiObKXqf9mFFM6hNb5hsTF6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773671211; c=relaxed/simple; bh=ScR2WmqLBOYYQ6yIKoIV6p7fYceNIGt8+7NQTkkcOWs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=P20iOpIMDbh1H2Eq8Djvrxj4dA9CCKW6K7lKtA434ReyWoENjsbONJrlCgmjclTkY2+nqyI3uIq1B5Fi16x+g/4vbruTtHF/X9Xe2EzJ4olN03SMYTA2Pt0S/xBX2exg/SxcuulqSmW4om3RKenvNRqrV9B8dYwDPMMGwgMfgzE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FACB4B9DB74 Received: by simark.ca (Postfix) id 7D8401E0CA; Mon, 16 Mar 2026 10:26:49 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 4/6] gdb: remove TYPE_REFERENCE_TYPE Date: Mon, 16 Mar 2026 10:25:21 -0400 Message-ID: <20260316142645.26877-5-simon.marchi@efficios.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260316142645.26877-1-simon.marchi@efficios.com> References: <20260316142645.26877-1-simon.marchi@efficios.com> 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 From: Simon Marchi IMO, there is no point in keeping this macro. Remove it and access the field directly. If we ever want some kind of abstraction in front of the field, then we'll add a method. Change-Id: Iabdb3a3eecd8274ddefc32ad835644bc4a0d2087 --- gdb/gdbtypes.c | 8 ++++---- gdb/gdbtypes.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b6b6a95b8a6c..feea1e9333be 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -418,7 +418,7 @@ make_reference_type (type *type, type_code refcode) gdb_assert (refcode == TYPE_CODE_REF || refcode == TYPE_CODE_RVALUE_REF); - ntype = (refcode == TYPE_CODE_REF ? TYPE_REFERENCE_TYPE (type) + ntype = (refcode == TYPE_CODE_REF ? type->reference_type : TYPE_RVALUE_REFERENCE_TYPE (type)); if (ntype) @@ -426,7 +426,7 @@ make_reference_type (type *type, type_code refcode) ntype = type_allocator (type).new_type (); ntype->set_target_type (type); - reftype = (refcode == TYPE_CODE_REF ? &TYPE_REFERENCE_TYPE (type) + reftype = (refcode == TYPE_CODE_REF ? &type->reference_type : &TYPE_RVALUE_REFERENCE_TYPE (type)); *reftype = ntype; @@ -615,7 +615,7 @@ make_qualified_type (struct type *type, type_instance_flags new_flags, /* Pointers or references to the original type are not relevant to the new type. */ ntype->pointer_type = (struct type *) 0; - TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0; + ntype->reference_type = nullptr; /* Chain the new qualified type to the old type. */ TYPE_CHAIN (ntype) = TYPE_CHAIN (type); @@ -4985,7 +4985,7 @@ recursive_dump_type (struct type *type, int spaces) gdb_printf ("%*spointer_type %s\n", spaces, "", host_address_to_string (type->pointer_type)); gdb_printf ("%*sreference_type %s\n", spaces, "", - host_address_to_string (TYPE_REFERENCE_TYPE (type))); + host_address_to_string (type->reference_type)); gdb_printf ("%*stype_chain %s\n", spaces, "", host_address_to_string (TYPE_CHAIN (type))); gdb_printf ("%*sinstance_flags 0x%x", spaces, "", diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 5bbaa846dc33..e241da402808 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1897,7 +1897,6 @@ extern void allocate_gnat_aux_type (struct type *); (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_FIXED_POINT, \ allocate_fixed_point_type_info (type)) -#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type #define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type #define TYPE_CHAIN(thistype) (thistype)->chain -- 2.53.0