From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aSTrLd6eYGo3ziQAWB0awg (envelope-from ) for ; Wed, 22 Jul 2026 06:43:42 -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=UwaR0fYW; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B39C61E09E; Wed, 22 Jul 2026 06:43:42 -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 ED6DC1E166 for ; Wed, 22 Jul 2026 06:43:38 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F2914BA23CB for ; Wed, 22 Jul 2026 10:43:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F2914BA23CB 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=UwaR0fYW Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010020.outbound.protection.outlook.com [52.101.201.20]) by sourceware.org (Postfix) with ESMTPS id EBD034BA2E05 for ; Wed, 22 Jul 2026 10:42:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBD034BA2E05 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 EBD034BA2E05 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.201.20 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1784716968; cv=pass; b=ENLpV05liMP/6fyXG5gYwCLuDU4qQVqcl+yO3OYjRSEG6VyeQTj8WP+1DUhr4MJm4G8GXP9d5a5e3KC0wEsZbqRZ8smu4wfhvxOrpxzv1RIR0MC7YXQKHK/LXBl8I2TU4eLqsiTmogaK3e+HYVrqo+dd7TQwiSlAxg25KY/c2Yk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1784716968; c=relaxed/simple; bh=RIs94LcTsO2KKRAgocYR/a9+8cY5l1XW65g36oSvyJU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fEIxwgsD/fkbE3YhkjfOohIp1bjbq9Nc2HvGzXNHJWJY1FVtv0lC+H6DKcQHEtixf98jb6mALAonkixeNl5dKVXq0McNqM/hU7RfAnAp9FgrNyEaTxQlcqy4bMy03m0IaHbahXrNdOVA0SUxrOsNuqgoeWfzjKPIthCrPIXQU84= 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=UwaR0fYW DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBD034BA2E05 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O0IEVrg6msYBbG3194uWaQ1PQE0N06fS/bvTHNcevMNgG0txYzu2FfSJx85xqUXyAuIQCNDrWvPUHtBuUpxpDlpSc04uzhuwPtHKlUQ0pLqCkCqiL0F3dQOUzOgfcm5t/G10ZVDuW5IyakWZKeVo3IcM6jTA1W7VNEpvBT3SQddwmgNzw02ExjMRZvjjkJ4sm7+kBVAA9oOWegi3BtwTmsJc6A/KFO2tFEmWvzNlO8ILlsQnEiO1uv0sJlhDsb/xDFFhsfsdd9vj6uLhrQh+VlkOlMrjOpQdkzX4EPv8OI0YuoaPQefLD0d3E0zXzlHVpirHsXTbQH0ZNgRvULBwwg== 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=TSwFKh4e5KXVQ2RfKscHI6YI+CvqYF5Mc0v+Jk/QVF0=; b=qN5uuXyTnAF4RBghaHAbXwVtqRGoXnibEEa8vZX4FwIAbvGephc2WUwe/qy2v/LrCMJaews0wrwy+Q5s4p7ck+VUHat6baddXViXuC6sMu3mCnreYeCbx4bjSsHA0XQmRgnaRgkMroi7U/si45VUz6t80P3cTfTtoKLRHp9HunHkPtfQQCxw8+1x67YgNzooy6fEsrRWkxaUgqUsT1G7nKYbfTGr6y0qcz43nAlpDJWeD8jWVwtO0kf6vUa4shSVoMJapt0lHRPrUIs8cVHBjocVcreeXo3vJn4gbGHs5QytcTYagHLZIWq7GzG8Jo56mlrQMZm3VghBVvT3mzLimw== 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=TSwFKh4e5KXVQ2RfKscHI6YI+CvqYF5Mc0v+Jk/QVF0=; b=UwaR0fYWquQTPAxdE/DA8DH8LHsIfK86Ik9imvYJ6Ta1dPAEafHlFK4jxwgJgQXo8YGx8xEsq8A1r0vuM3ypkUd2MlD8fwzOPhw0Nuh4feQrY4MaZXCX1xr7thFA/ZmRWoDcuq7+sF7aIVasyr8JrUDmWKdgv4Aabeaihh/8Bmg= Received: from CH0PR03CA0106.namprd03.prod.outlook.com (2603:10b6:610:cd::21) by PH0PR12MB7886.namprd12.prod.outlook.com (2603:10b6:510:26e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Wed, 22 Jul 2026 10:42:42 +0000 Received: from CH3PEPF00000013.namprd21.prod.outlook.com (2603:10b6:610:cd:cafe::5b) by CH0PR03CA0106.outlook.office365.com (2603:10b6:610:cd::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed, 22 Jul 2026 10:42:42 +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 CH3PEPF00000013.mail.protection.outlook.com (10.167.244.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.0 via Frontend Transport; Wed, 22 Jul 2026 10:42:42 +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; Wed, 22 Jul 2026 05:42:41 -0500 From: Tankut Baris Aktemur To: CC: Subject: [PATCH v2 01/17] gdb: use type instance macros to query const, volatile, restrict Date: Wed, 22 Jul 2026 05:41:50 -0500 Message-ID: <20260722-users-aktemur-type-instance-flags-v2-1-d60dcbc2a76f@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260722-users-aktemur-type-instance-flags-v2-0-d60dcbc2a76f@amd.com> References: <20260722-users-aktemur-type-instance-flags-v2-0-d60dcbc2a76f@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: CH3PEPF00000013:EE_|PH0PR12MB7886:EE_ X-MS-Office365-Filtering-Correlation-Id: a8aba229-acf5-4602-717b-08dee7ddf557 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|23010399003|36860700016|22082099003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: dqH50RyL/9VzWtWkyT3HcEZhuUb3IkSontyVYZYzYPPoyd0I3acNKjfHSOIr5zrWWxHS3vdjA6yx5EvP7/CbnB0bu/YXh73LKwH3CN4ebilopknEGCZccdFKCggwJIsYoX1zkEsfB6h2xyNBXWgKpInpIxgw+57uxq2tFAwHuKUvdgDkWEHGEGEfSfs5BoJH4ZpzNhQVn9FcHE0yb6SeVzwLVKH+Kbs0iV8HndwriXjghwblgyPO1FnTdjaeEc+zM5rN3RVxXbhfgRL2f6Da/wPg2bcJioV7y6zz6i7exO/qjAPUBlEg9ATko+EQw1ua1KJnCxQHPf/H1QLcv/H4kpZxAG5fssDSLbBlDKAwm+AuazhmPl9byU+k0cjwEwQ3cefs1MDEEhhfLBD94Mc4W0mSgVUimwRd6aR5YgIOWav0dWkX6BFC0JqhP9ZnLrQcrx2ObS7FLvgPKBIM/qo55BfHOGYoWCLUqSMHGUyg6Kz74/cp+wZH/kdlwjPY5eEqqLcjOKmy47I1/1BgKWoKs+TsYHqc57uO1yD0LkuiJsnBeHGO/wUAQBpvuT+fDGw9KjH77s46yiHjLO32Og26Ew1/Dvmc6R5pEfDof58RSi74F0/0YQWQxJ9i2r4lEJNOnaU2VE/AaE4pdxA0PWQTAwYSvKlcfaHWBqXkhi7C4LL8b0ut7HPARiaaBqLqXYXnNuaHVsjy5XChfBakLXqASA== 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)(1800799024)(82310400026)(376014)(23010399003)(36860700016)(22082099003)(18002099003)(56012099006)(11063799006)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4NcRA3Hx4Ibdd3gBqHmsCN5hqgb88pQp/Scv95ikvGILnbdUG3fPs4aiP0AUr835p02LCul7YEWatjX41RfjyL5/l+626HBIaQZsVhaBX0YFuGRL9KWmZf3w/wqKHrDl1M5oSJ4eCSM1ueilRrK8zLEAqLyrBPW6+ehL2zzkyCj4sThDN4cVobAeCJpfv01Dw8qPTydLJfcYPm4J5L/BSQ92E5nyCCMfscliRYUCNIr7bZw3MtpBj/0UD6nalnJ3czER1umhOwywpDHgQf8cRN3c/EgASSGlgW/Niir1mg+QIvrAwIDDjICqPYN+tElQNqejOpWOFcxfVkLSFFFidhc9dHd77ilCvpnGdycVxeqIDiCiEWFwIQG+7kA3Zh6hdkeY2Ao31t2v2QfgkZYNGBkTx/TgavimJzLTT9zZ75iuxKG9GCa+i9R+GNyVvBXF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 10:42:42.2580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8aba229-acf5-4602-717b-08dee7ddf557 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: CH3PEPF00000013.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7886 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 In two cases in compile/compile-c-types.c and compile/compile-cplus-types.c, we query if a type is const, volatile, or restrict using bitmasks. For such read-only queries, there are macros. Use them for code uniformity. The new code may be slightly less optimal, but I don't think this would matter in practice. This is a code cleanup step in a series. Approved-By: Tom Tromey --- gdb/compile/compile-c-types.c | 4 +--- gdb/compile/compile-cplus-types.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c index be79b582081..af9dea730eb 100644 --- a/gdb/compile/compile-c-types.c +++ b/gdb/compile/compile-c-types.c @@ -278,9 +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->instance_flags () & (TYPE_INSTANCE_FLAG_CONST - | TYPE_INSTANCE_FLAG_VOLATILE - | TYPE_INSTANCE_FLAG_RESTRICT)) != 0) + if (TYPE_CONST (type) || TYPE_VOLATILE (type) || TYPE_RESTRICT (type)) 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 031775c3679..ff25fc62c8b 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -1126,9 +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->instance_flags () & (TYPE_INSTANCE_FLAG_CONST - | TYPE_INSTANCE_FLAG_VOLATILE - | TYPE_INSTANCE_FLAG_RESTRICT)) != 0) + if (TYPE_CONST (type) || TYPE_VOLATILE (type) || TYPE_RESTRICT (type)) return compile_cplus_convert_qualified (instance, type); switch (type->code ()) -- 2.34.1