From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6vBZAmUTuGl7EiwAWB0awg (envelope-from ) for ; Mon, 16 Mar 2026 10:27:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 004481E08C; Mon, 16 Mar 2026 10:27:48 -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 E3C401E08C for ; Mon, 16 Mar 2026 10:27:47 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DAFDA4B1A2F8 for ; Mon, 16 Mar 2026 14:27:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAFDA4B1A2F8 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 72FA34B9DB56 for ; Mon, 16 Mar 2026 14:26:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 72FA34B9DB56 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 72FA34B9DB56 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=1773671210; cv=none; b=UXlQ8AQX01KOjwWSuGIEM3WahlP1QeFbRI83ZMSX39HCSS+5ddjBXMQOBNkz0d1+YKixeH5b+9ixeTDGt3Pz/bykICwOl9ehXB/R435RZLC57FGdbYTpyMI5/tVYvsmfDTf8aGgP+W+lFd9ATSlBwgke+V2ygpC+y+e5ClTWuYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773671210; c=relaxed/simple; bh=BwuGcamp/4LuksINYnW6ZEVez4rCTKZaBTTvdqHP+GA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vJCoLkYiiml6iwZadPPKk6ybxAm1FuY8NAOWcX3EyhHQ1l8Lgq0ydlKKlJeSwsirgFn04Po/l5PntVB5rFsfb1jk8H3Ro0AA1JMoSJWkII85ly1EO0f6PGM5tDGknv1GRjRgwoYGk1qeZe4Uh0A5CdU7rNloVEC0zSCNBOg0y8k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72FA34B9DB56 Received: by simark.ca (Postfix) id 004881E0C3; Mon, 16 Mar 2026 10:26:48 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 3/6] gdb: remove TYPE_POINTER_TYPE Date: Mon, 16 Mar 2026 10:25:20 -0400 Message-ID: <20260316142645.26877-4-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: I592789130ad81776c7a8b39c4721ebb4aa7293f7 --- gdb/gdbtypes.c | 8 ++++---- gdb/gdbtypes.h | 1 - gdb/p-exp.y | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index bbefa3ff6b4b..b6b6a95b8a6c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -368,14 +368,14 @@ make_pointer_type (type *type) struct type *ntype; /* New type */ struct type *chain; - ntype = TYPE_POINTER_TYPE (type); + ntype = type->pointer_type; if (ntype) return ntype; ntype = type_allocator (type).new_type (); ntype->set_target_type (type); - TYPE_POINTER_TYPE (type) = ntype; + type->pointer_type = ntype; /* FIXME! Assumes the machine has only one representation for pointers! */ @@ -614,7 +614,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. */ - TYPE_POINTER_TYPE (ntype) = (struct type *) 0; + ntype->pointer_type = (struct type *) 0; TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0; /* Chain the new qualified type to the old type. */ @@ -4983,7 +4983,7 @@ recursive_dump_type (struct type *type, int spaces) recursive_dump_type (type->target_type (), spaces + 2); } gdb_printf ("%*spointer_type %s\n", spaces, "", - host_address_to_string (TYPE_POINTER_TYPE (type))); + host_address_to_string (type->pointer_type)); gdb_printf ("%*sreference_type %s\n", spaces, "", host_address_to_string (TYPE_REFERENCE_TYPE (type))); gdb_printf ("%*stype_chain %s\n", spaces, "", diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 2058f2c8bb94..5bbaa846dc33 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_POINTER_TYPE(thistype) (thistype)->pointer_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 diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 00b67647fc56..2e24da095c03 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -222,7 +222,7 @@ exp : exp '^' %prec UNARY exp : '@' exp %prec UNARY { pstate->wrap (); if (current_type) - current_type = TYPE_POINTER_TYPE (current_type); } + current_type = current_type->pointer_type; } ; exp : '-' exp %prec UNARY -- 2.53.0