From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mdrXMr7vVGoyPAYAWB0awg (envelope-from ) for ; Mon, 13 Jul 2026 10:01:34 -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=qUeBbLYV; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C688D1E09E; Mon, 13 Jul 2026 10:01: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=-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 [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 073B51E033 for ; Mon, 13 Jul 2026 10:01:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BDC34BA23EA for ; Mon, 13 Jul 2026 14:01:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BDC34BA23EA 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=qUeBbLYV Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012007.outbound.protection.outlook.com [40.93.195.7]) by sourceware.org (Postfix) with ESMTPS id 49AD04BA23DB for ; Mon, 13 Jul 2026 14:01:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49AD04BA23DB 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 49AD04BA23DB Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.93.195.7 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783951261; cv=pass; b=mmE1IBWSalY0xtR3+55uwHyFJsePyaEQYYeuVIgOBvFjN3QUN/VzmdOH2KIEhtPTrDAFLhbWqZiMAkQDq2DPD+SLOfXLtEzS9joPakCSfqf92Y7IXZ/i/3byWif0YxCIhOZwDF078s4D3bQz5siRz8ST/mmAOid01wfx13pBqWQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1783951261; c=relaxed/simple; bh=U/qIAVj6BWi0pluvWdi4BOcrKrBq1ffUSO4N7S/aEkU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ewy3R5m9BJHa8NhRLL4gvbNDXRJLoHBE3UV/pEd0bbxDCcSX2X6872ev7Xugooh5gtY7j/5MDdj75ZEBj6qFb8SLDAgxiJDUt6yeFWtDi1xF37t/+lnsGX9ulO0166BP1z9oLFrMTP4/TmeAj1t6KqMy4rB+kJaX8zIetdRGKzY= 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=qUeBbLYV DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49AD04BA23DB ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FQXEIYUoUgLq3/nTZgVPu6lJsZs+zQrAYFn4reUz7MPBxKfEEO8H6tVDs+iubtfXIynzxuWRyuh3PqqVr5p0P/yeimdxU72T4NkwsB61dlfHud1T07gtNhf6nz8K+zDv99v481syd4MHR/eZh/e7df9b3j7XTnG7F6RQLijZsq0DnLzpD94N3UaUQSml9e7TR2dGVkCVpqHCs57LMoRMpjhR/qpetDT3gGU3x1qrwJgSla6NQi28RQrzoSVjOTbVlY7baOtYZdLOP98Z1TDYbWLhJGGA+BIn2g5SGH/YKQZ9TvX91bwJp+8X3mJTTcox/5ynFIoTTa9y8bKxpHaVcw== 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=5p5ulWWXjVEpY1Q/S391ZHARb4KsnfJG4+Jj8dhF3dA=; b=l/pSH2gYNGGy5goq063+nYI9r0Ne/WLtkWM9p6JXpWSDbruCmkSjc4bCVMko4GWliabWaPBEwQx0Jx5+YuQkO1nBfajOZlVPtpJIWt195ZdkYbflTSUrzZKKbY4Ul4bLZWYcO6PWwYKPX+kUAzRr0snwg4pxw6GVHXRcJB5r7Dyow67Br2feuBsmtEUvnUOMzRNDME9SCi9rejg0Os8uUS+P9GPPNn7BRFnS4OW4PSPloKVq8/GLbqAIDlQ4gUyOJAz74Z3312Dvd0jHWNURE33LBRJCVGzDfrFhUh5VkOL8u19DzcNYSLl+g+oE3iEGybsIs8rf9VTeY49LWBRCDQ== 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=5p5ulWWXjVEpY1Q/S391ZHARb4KsnfJG4+Jj8dhF3dA=; b=qUeBbLYVBP3wvgBiyLPIh5H+Hu5cX3RvdXVdWB2v8HxMm0ftX9PM5bajDH1+7TQN2A3IsUVgElH8LaH/3jh1AMkOIdOKpB8IbIgebD+LaLx+qWFZhOk9NM5/bLjiK/xUkxhZp00juPCFbTKL8rF8H/PHZGfPQnJbRlzTHgABjMw= Received: from CH0P221CA0014.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::12) by IA0PPFA19DE7612.namprd12.prod.outlook.com (2603:10b6:20f:fc04::bdd) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul 2026 14:00:54 +0000 Received: from CH1PEPF0000AD7C.namprd04.prod.outlook.com (2603:10b6:610:11c:cafe::8b) by CH0P221CA0014.outlook.office365.com (2603:10b6:610:11c::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Mon, 13 Jul 2026 14:00:54 +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 CH1PEPF0000AD7C.mail.protection.outlook.com (10.167.244.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Mon, 13 Jul 2026 14:00:53 +0000 Received: from ctr-rack32-mi300x-1.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, 13 Jul 2026 09:00:43 -0500 From: Tankut Baris Aktemur To: Subject: [PATCH 13/16] gdb: convert TYPE_RESTRICT macro to type::is_restrict Date: Mon, 13 Jul 2026 09:00:12 -0500 Message-ID: <20260713-users-aktemur-type-instance-flags-v1-13-779cad0c85ec@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260713-users-aktemur-type-instance-flags-v1-0-779cad0c85ec@amd.com> References: <20260713-users-aktemur-type-instance-flags-v1-0-779cad0c85ec@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.15.0 Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7C:EE_|IA0PPFA19DE7612:EE_ X-MS-Office365-Filtering-Correlation-Id: a64dfe7d-0ed8-400d-87ff-08dee0e727a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|23010399003|36860700016|1800799024|6133799003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: UXLdIIozOjkcrBFgtWYXxVZ1NhU+RJJaNHNK/RcsOVnHZJJUFYNUyCyi+thpHYxcFSclvIGsO/hIEZue8G0xiopjSRqiwdS5mbV7Qn7CU1H6b6XHhnZirTgfDgyWIIushColf3YRajAG0okgmhaJJQQDxVtOXZqJpU3hz/8XMTU3LkxEF1NukqrJ4gPK5NLIvW/9yu2mEPJKFwtP0deUTsmnQ7zieds8kr+iVrIKktk9nhTCnItMSBgnu+aWpbzoePXlGNt5V8sXHuvLk9H0OMK+ifadkXF5dKVJXLN3Tv2nX3r9SlBf1PGbVoWcADRc6j5CmgxjfmUPyWKjSKJNsjpYmHGqjCuNKGbPCmYaWgm4+/6ZA5rULBil2GJ2hqcZ6FOvKwpaHjJRsyi0vi5zrMC/zZ61FrJ263V52DNOOUMZVjjHsHAtbSr824g3z4GNcRYrhCM4tBj+YjjQfJdUeL9AFo5p96O6yLHjydaTjkLFz/boGfuXfLqwBgLKDjxTaMuM2Fz2UpsEaCPogeoZDtWgg6O/XXqM6FW1JcVXutBLHVvdErlO1xcSKcfR33cSb08dR22nmK7viGuaqX55fVSR3LqXyiioxPu3bPnyONRMC0+wsHXykJ3HtdAk2Jc7mhrPNatdmwJSpvowcjwteWh3vJAlcHPZxavyTzkUotRKvVKrrPnStbbaqKkQewBfYeM3s4V8HPTHk6gKxsKSAQ== 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)(376014)(82310400026)(23010399003)(36860700016)(1800799024)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vjnh7UlkId6pv+BzwWktyfvTFbXyPyIgwZWRsbWuLBNYuD1NSoNykas5nri+XTv02l//T4oA3hWoTJ3mrnk11KIA8hlHMjIE1Lew5vO/yloPlXG7WIbN7CcWrpEVAaGtZN3Jk4iy51eQd+UoIUdtlx7hxE+O96qHD8ayeejaZd+NtY3kMa5zcLlR8rQxDzbDlfkEpjcnZ6jx5V7gtm/tPPw7TSTEkgPhI6gxrVcLp1zFQdaIf6Gjf9mGZW7IUK//dUsTFsVYrDp5EKNnhEVaq2AD4Ekp6VK/Pm4JawAVmfoZNAHHs/VRf9QOlj1B/FqrZcTp31ebpfMp+7ShXVWbYVDYGgHWO4vsHI4ur3L3rHEalGuFldTP+2Se+GbyeTYW3Rd6V+UgCZV2sFn73+trgb+fD8yHU4IlFJLEhGVPnQQ69xziH/2gJZd1neoIFWo7 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 14:00:53.9617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a64dfe7d-0ed8-400d-87ff-08dee0e727a1 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: CH1PEPF0000AD7C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PPFA19DE7612 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 Convert the TYPE_RESTRICT macro to a method of the type class. This is a refactoring. --- gdb/c-typeprint.c | 4 ++-- gdb/compile/compile-c-types.c | 4 ++-- gdb/compile/compile-cplus-types.c | 6 +++--- gdb/gdbtypes.c | 6 ++---- gdb/gdbtypes.h | 7 ++++++- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index d45f5f6ab6d..d924e76a3db 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -317,7 +317,7 @@ cp_type_print_method_args (struct type *mtype, if (domain->is_volatile ()) gdb_printf (stream, " volatile"); - if (TYPE_RESTRICT (domain)) + if (domain->is_restrict ()) gdb_printf (stream, (language == language_cplus ? " __restrict__" : " restrict")); @@ -465,7 +465,7 @@ c_type_print_modifier (struct type *type, struct ui_file *stream, did_print_modifier = 1; } - if (TYPE_RESTRICT (type)) + if (type->is_restrict ()) { if (did_print_modifier || need_pre_space) gdb_printf (stream, " "); diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c index 2c115632a7c..818cdecd50d 100644 --- a/gdb/compile/compile-c-types.c +++ b/gdb/compile/compile-c-types.c @@ -251,7 +251,7 @@ convert_qualified (compile_c_instance *context, struct type *type) quals |= GCC_QUALIFIER_CONST; if (type->is_volatile ()) quals |= GCC_QUALIFIER_VOLATILE; - if (TYPE_RESTRICT (type)) + if (type->is_restrict ()) quals |= GCC_QUALIFIER_RESTRICT; return context->plugin ().build_qualified_type (unqual_converted, @@ -278,7 +278,7 @@ convert_type_basic (compile_c_instance *context, struct type *type) { /* If we are converting a qualified type, first convert the unqualified type and then apply the qualifiers. */ - if (type->is_const () || type->is_volatile () || TYPE_RESTRICT (type)) + if (type->is_const () || type->is_volatile () || type->is_restrict ()) return convert_qualified (context, type); switch (type->code ()) diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c index 787ca321a5f..8352c9324f4 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -673,7 +673,7 @@ compile_cplus_convert_method (compile_cplus_instance *instance, quals |= GCC_CP_QUALIFIER_CONST; if (method_type->is_volatile ()) quals |= GCC_CP_QUALIFIER_VOLATILE; - if (TYPE_RESTRICT (method_type)) + if (method_type->is_restrict ()) quals |= GCC_CP_QUALIFIER_RESTRICT; /* Not yet implemented. */ @@ -1070,7 +1070,7 @@ compile_cplus_convert_qualified (compile_cplus_instance *instance, quals |= GCC_CP_QUALIFIER_CONST; if (type->is_volatile ()) quals |= GCC_CP_QUALIFIER_VOLATILE; - if (TYPE_RESTRICT (type)) + if (type->is_restrict ()) quals |= GCC_CP_QUALIFIER_RESTRICT; return instance->convert_qualified_base (unqual_converted, quals); @@ -1126,7 +1126,7 @@ convert_type_cplus_basic (compile_cplus_instance *instance, { /* If we are converting a qualified type, first convert the unqualified type and then apply the qualifiers. */ - if (type->is_const () || type->is_volatile () || TYPE_RESTRICT (type)) + if (type->is_const () || type->is_volatile () || type->is_restrict ()) return compile_cplus_convert_qualified (instance, type); switch (type->code ()) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index bdac30204d0..33f0a57285b 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5033,10 +5033,8 @@ recursive_dump_type (struct type *type, int spaces) { gdb_printf (" TYPE_ADDRESS_CLASS(%u)", TYPE_ADDRESS_CLASS (type)); } - if (TYPE_RESTRICT (type)) - { - gdb_puts (" TYPE_RESTRICT"); - } + if (type->is_restrict ()) + gdb_puts (" TYPE_RESTRICT"); if (TYPE_ATOMIC (type)) { gdb_puts (" TYPE_ATOMIC"); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index a12acb72967..599a45d9969 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -165,7 +165,6 @@ struct type_instance_flags bool is_atomic : 1; }; -#define TYPE_RESTRICT(t) (((t)->instance_flags ()).is_restrict) #define TYPE_ATOMIC(t) (((t)->instance_flags ()).is_atomic) /* True if this type represents either an lvalue or lvalue reference type. */ @@ -1219,6 +1218,12 @@ struct type return this->m_instance_flags.harvard_aspace == HARVARD_ASPACE_DATA; } + /* Return if this type is restrict. */ + bool is_restrict () + { + return this->m_instance_flags.is_restrict; + } + /* Get the bounds bounds of this type. The type must be a range type. */ range_bounds *bounds () const { -- 2.34.1