From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mW2gGJCncGqarQIAWB0awg (envelope-from ) for ; Mon, 03 Aug 2026 10:37:04 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=jcHqN/i4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5FCD71E099; Mon, 03 Aug 2026 10:37:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 D6AC31E099 for ; Mon, 03 Aug 2026 10:37:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 566234BA2E1A for ; Mon, 3 Aug 2026 14:37:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 566234BA2E1A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=jcHqN/i4 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11012033.outbound.protection.outlook.com [40.107.200.33]) by sourceware.org (Postfix) with ESMTPS id 131EE4BA2E05 for ; Mon, 3 Aug 2026 14:36:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 131EE4BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 131EE4BA2E05 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.107.200.33 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1785767764; cv=pass; b=qPov8JboKjDnxid1PehahvqaN1eQQLS/dOL7eSiiFnGvVM30z4hFrQ+HvZKUJmWMXNbpJe631h3y16XW928dkE35aVdTwQA2D1pyu+hK6HUkcfir4qjsiv0B5lcmIOnqC9IgD+7r18IO2JrVaqu/zO2SHjMS4Ix2n5BlNlCFtFI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1785767764; c=relaxed/simple; bh=8PWY64qTDaQTUZfjzR9eTcgUWTSdtmWYHGKNG9mOhQA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cexyV4bJKqhI2ALz1Q/1wZV3hGcL4rPtpl8btlcyKI9JIGZ9yWRlCzadD4DJVSqMEs+QV/w/a27F180Zd4F6nHEWaUVQmL+Uusal2AO6Ovb7gdW3yl2s8MefjBUZSQXEB639gFI4voaavvYIB+Dx+KMDuIsxRqZuST/TPac6zdM= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=jcHqN/i4 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 131EE4BA2E05 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XAtaNrJQdO+ptVR491RjdsViF1d4W85F/ZyT/cC65xiQzh5W/KjODluf+k9cOb6MwRleJjbmTA5LLO853P3+e3d4PvxFKy8LPqhwxAR0K9t/ewSDULf/lyMEs0jHGr3vaSWGzRjpvVAe8JBkTbrC2jv7ku1+G/VK6ylcaFrPTXsPpXxzHkPCbIWxgx6AKIdgL3URbqnJWsygH8vMKUnM+YzPefh6vVrPvllgWK8x0zgLH+3yUbWhnlfQlBY8nT6eyzovnGWNM9y1oM2xXJ9oF6w3rB92pKQ2yRgGgdtes+K63NsqsQsgXIPDuAyokIVbpe8YL3kNTwAU3ksjqNka5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SeKj19bzKaSEi49bcb95hrq1qmENtcYWcIiKQt1+vmc=; b=FRmVUWcGsgjWC8/b8muVuIFxWHunhZosFBJchXhsPclmL+05HxrzaGWQ3VcmrM1W9UB6YmXoCIfhctfHyo6W57979JfJVDWXlJ7uLtvgTt9iEPUfx9rEjjGcSLzTzNsTE6b0jajBzPsLJW9qpFFvmJn/VKEmMPe+y487grLlnB5ernrDKtf10k8tjciJsFZT4z7rBH59loWb4wVdK6DxRY3pQEFMyh+iSv0LXkWetkNzW/Mv+pyKy6AjEBlZw3xigoMbqnhcOFTiVHNU7MuCNPHjU5nQV4hD/OuZURP0tj9yM8P9ZcvrJVqfcXMqrsEt4K5ErxNqGIUhHxPgjqp3Dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SeKj19bzKaSEi49bcb95hrq1qmENtcYWcIiKQt1+vmc=; b=jcHqN/i4moB003EgU7PB5KJIP6eZXwQ1FfODEOHSBuLJMFCupsxHshK1aLVB7Es+L9YEpWGWHKwYnH5EQ+hHuPkHI2KXnlteOr3Yas/+kb6UMDcaIQNX61omsaJorjqJ+MzaggKC68Si1HZ9M2wjq96fplgnYqUe1EoM7lbxSfs= Received: from BL1P223CA0033.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:5b6::8) by CYYPR12MB8701.namprd12.prod.outlook.com (2603:10b6:930:bf::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.18; Mon, 3 Aug 2026 14:35:59 +0000 Received: from BN2PEPF000055DB.namprd21.prod.outlook.com (2603:10b6:208:5b6:cafe::1a) by BL1P223CA0033.outlook.office365.com (2603:10b6:208:5b6::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.18 via Frontend Transport; Mon, 3 Aug 2026 14:35:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN2PEPF000055DB.mail.protection.outlook.com (10.167.245.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.0 via Frontend Transport; Mon, 3 Aug 2026 14:35:59 +0000 Received: from rocgdb-taktemur.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 3 Aug 2026 09:35:57 -0500 From: Tankut Baris Aktemur To: Subject: [PATCH 2/2] gdb: do minor code modernization in make_pointer_type and make_reference_type Date: Mon, 3 Aug 2026 16:35:31 +0200 Message-ID: <20260803143531.2958552-2-tankutbaris.aktemur@amd.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260803143531.2958552-1-tankutbaris.aktemur@amd.com> References: <20260803143531.2958552-1-tankutbaris.aktemur@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DB:EE_|CYYPR12MB8701:EE_ X-MS-Office365-Filtering-Correlation-Id: d8e15ed9-6951-46b7-5a5f-08def16c892c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|36860700016|376014|1800799024|82310400026|18002099003|22082099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: UfoiAc5EHvPHZEowv46VQK+9ebe4Zf+YGOPUDXwIhIBEdXhJ3Tcg1eEpz592M4GNm17REgKYXdygdEPxxmWkh202PxqjSPqlQpAIoMUN8P05OCuqWoqQIFlToG5vF4O1+lsCL38uZomn5WSG0qH8755nC/gDRA3mYwOgw/Js5uLJV2UEu+gcAmC2S8zZcgXzIsx3Sso9TlUkcQaE56Q21GymdU6tGe4X5BF0XygpW7fBxyK4qgsqiE91x1UuhGXn6EI5JXzBzGNHVGO81z78frVzAkH+0rY05Ss66RdYk2nHZ1qSHtBeUs5D8tHrI6ieEf7JzNU5VPaySAqS+4KgksuS96JdJw/mksqCJHPxZBwtQK5bnu9wmO+YRy8YMp7JFNnQYRKVw8t8Pj8w0x2wbytcYuTlu/ZJ+6GdN7H9xta/FOLj6yuAd46qTnK7jC0+wmQzdwjTQ0+n0SzL/MtkwXO16i2OKNVmXSLriOcS5qFr9JmZCmkjW9p7O8pY9Mxa8DNKVKcosQcTMHEhdfLEjYncRhFuMCkHWew87frxVJpPHPWsj+ArdNgTYf/eW7ObOD/Maw7pepRbYn1xkXOHVn6sQU8MGCVvUIey/fTJyN8kDxIQwiH6+quvNppPtoWduxHi8YOWbMqL8vfNwutC/KUCyt+3YaiqGlK7T5F2/DWGxBe6Tnf4Nuwes8RyIm2HHF598RBw0GtzWurdDjLYrA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(23010399003)(36860700016)(376014)(1800799024)(82310400026)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: klcfDIRcuwEcocqrKDotR2lvNw8pRqbMfv6YgzL1VhTkLm5e7ncjZBckB8vu3LKiZ+jQAP7Lu4n9a8NpJ7gk48OwEwKtJLQoe8+iq0rhMFaK1jGPP6hGNfShk2WT0oQNDQfDrzyp7rp1tEhX5zzLge9169Qx4JLCPdZ6oVd74FXsGmXZdF05CL3V03AZwUyt1iRJ6I9EWKsRG+OSimFKgx0givm5lVtwBKxK3QKgOeufVQfp0s3uwITd1mE5zW/3jTrQ924gHFY/w+nKjAeSFZ9qscx9VXtkwAXxUrCLB3HINCq2xwakuMAllnkqm49lrDeY2q1r9zkHg9J3Z7BJcL3w9hh+UV9a2q3ucifyZGKoVzqutlB2oWLrg7eQcXENu6dPbE/oZvQvotcFBZ1nGDkG0GZOHW/ojoBsRNfwe8Q6hKx+57z4tIjD+8Xkb4do X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2026 14:35:59.2907 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8e15ed9-6951-46b7-5a5f-08def16c892c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DB.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8701 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 This is a small code modernization. There should be no behavioral change. --- gdb/gdbtypes.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 2dda175237c..409601abe03 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -366,10 +366,8 @@ smash_type (struct type *type) type * make_pointer_type (type *type) { - struct type *ntype; /* New type */ - ntype = type->pointer_type; - - if (ntype) + struct type *ntype = type->pointer_type; + if (ntype != nullptr) return ntype; ntype = type_allocator (type).new_type (); @@ -403,23 +401,22 @@ lookup_pointer_type (struct type *type) type * make_reference_type (type *type, type_code refcode) { - struct type *ntype; /* New type */ - struct type **reftype; - gdb_assert (refcode == TYPE_CODE_REF || refcode == TYPE_CODE_RVALUE_REF); - ntype = (refcode == TYPE_CODE_REF ? type->reference_type - : type->rvalue_reference_type); + struct type *ntype = (refcode == TYPE_CODE_REF + ? type->reference_type + : type->rvalue_reference_type); - if (ntype) + if (ntype != nullptr) return ntype; ntype = type_allocator (type).new_type (); ntype->set_target_type (type); - reftype = (refcode == TYPE_CODE_REF ? &type->reference_type - : &type->rvalue_reference_type); - *reftype = ntype; + if (refcode == TYPE_CODE_REF) + type->reference_type = ntype; + else + type->rvalue_reference_type = ntype; /* FIXME! Assume the machine has only one representation for references, and that it matches the (only) representation for -- 2.53.0