From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id EE73F386181F for ; Wed, 5 Jun 2024 07:32:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE73F386181F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EE73F386181F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1717572729; cv=pass; b=UIlN6qGPsfghO13QqNM5p43677nBZiSvUWGiL5+zboMERsU/BkFMhGh8YBhGs9oQqvJsDCdhAOqfPtE5pMPUrp0qqS2UMqwM+iZdU04iJ5hzMNTxGTIEf0jt5OQy+XQrH03EYOIyRlbfuU4Ayz3fX0wvmqj8GSLfmk6DKcnsOxs= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1717572729; c=relaxed/simple; bh=u4sg7ZO/uP96EhODoe6RONZDjp76AJxO4sJ0h1igerM=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=q+60nO7ECPEoDlRDQMUR9mhF/FlmBG3jWoZ45P0mx3M+E1ZSdHAg45Ze93/kdbdkXJ2nZ6NL0RJKfTgEOIR+BF7TGnTqwnHbtNVBdLm1sDdAOs01kHgp+VAbcfsNxCCGxrnYbjWsHZZBDMv9dOjceVQ+vh/C5jc8qtPvoWg1SLc= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4551E8sD006954 for ; Wed, 5 Jun 2024 07:32:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=corp-2023-11-20; bh=lEENy+MpwddlzYDo/nzRWkYI/p4ol4f5/C7AyK7liZQ=; b=VUSW7a1Ivud8hsetgl07NBP+MpnVJYkG8cIuqRDVzqk9kD/TLHbUwdrVJoumfxAwUb1x Hq98+IaAx28gdyKfrv33w9BJ5uwsq3YwKb9XK+OzU/wF7Uk9yLcN/uVk0YOsGU35S/MC d9FGt+Ye6cMhMd9Joc1mXDnCRHu2Uay7cgLjjKFiLe8PKJyAQ/k7GhihEgFvcZgxCT59 aBgBcZ8HKpAqjIAWR3sEAC5bbXbGcLO+zHMutsX7wMY/lLApNK6146cyqH30BIYXvy46 ZtRuqEzKFGLqqLP+hqbBXNsYES2DbPXthS4gMWmrCAAzqsZIViq11zBgC8CWRJK3WKyf MQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrs8k1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 05 Jun 2024 07:32:02 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 4555f1An015806 for ; Wed, 5 Jun 2024 07:32:02 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjdbw80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 05 Jun 2024 07:32:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1AoWGziIkUKNSndxdQR/1cCumEgMtoNfc/BL0qol+b/BWwmmAu9NAc24mDrTHHq/RAkaX+17LT4Iv8pKRWDinTlv3whuIB85/wPXIgvWXYsJSahpfsaI8pAcG1RuMJfIM+jySbVYVbpH+qvARQrPPPojjSM08B9chjGC4PcXz8pbR9VY8fLr5RA2hhraHTBYrpg3yy0cYE6vgHWS1DAQoj0m1BE0cE2jtt/thAmuIvPALytofpaVba/CQZ6sN+zNBK5dfV0pxrz0i5Z/cDuH5geXIy2JwTS5tIGhaltDAgtK/CWnFVf1We0cVISi13J5sejt6sOSQfTTQ3B9NYcYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=lEENy+MpwddlzYDo/nzRWkYI/p4ol4f5/C7AyK7liZQ=; b=a3LbNzOaFsPks6QVNxs9FXDbtnc1AqmwL/BzyMB9aDn/IYjSmHlk2C8t2Ia7gDdGvxJXxF1h+nqGqb0lEKrXdzfX0foYK0/ZHlTTtvy15BZc532nz28T3+C22ndLKyu9sJ22+9K54R/BT0g2zp3szr+KC2V2gGRUPfUm0LNrq8JPceNx+MnZt9G9l5FNqmtsjReg/lV4l/DxtxKYD7D6qabjqpGiqTQl3FZoWHBA8X5RPVVSO7PznETB215JF203/Nd1EUXR40AarJe/hQY1glblZkz4MVT9kGxdpP+5W7nLzNOU0ocTwiMipDZzeKvlHVonwlwNkPmfyyhRtgMJJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lEENy+MpwddlzYDo/nzRWkYI/p4ol4f5/C7AyK7liZQ=; b=P7b2kbHYP4DwcFjPnquhXasnNk5dnsCrc+jPOPOgRI6/ubwXo8/Hl6q1tiWmp6stdWqXOaEtGmTZ+ep0E9ZGsxPJwFRC/Z8VvEIUVxqk8WZ8ab70Pn8TMN2URKnSN8CKASkKNCevnT5o1BQtFSi2/BSYiE0INE3Bxi/eeDOujp4= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by PH7PR10MB6968.namprd10.prod.outlook.com (2603:10b6:510:279::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Wed, 5 Jun 2024 07:31:58 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::3902:e766:f2d3:a40a]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::3902:e766:f2d3:a40a%4]) with mapi id 15.20.7633.021; Wed, 5 Jun 2024 07:31:58 +0000 Message-ID: <4e4f33cd-42b1-4259-857b-5e75e3c4045f@oracle.com> Date: Wed, 5 Jun 2024 00:31:56 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/6] ctf: use pointers instead of IDs internally To: David Faust , gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, cupertino.miranda@oracle.com References: <20240530213222.440435-1-david.faust@oracle.com> <20240530213222.440435-3-david.faust@oracle.com> Content-Language: en-US From: Indu Bhagat In-Reply-To: <20240530213222.440435-3-david.faust@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR03CA0141.namprd03.prod.outlook.com (2603:10b6:303:8c::26) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|PH7PR10MB6968:EE_ X-MS-Office365-Filtering-Correlation-Id: c37a318e-3cd7-431b-d5e0-08dc8531951f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?b2EzQ2J2UXp3blN4djV0Uk41bjBUNzRNcTltVHhTcmp5eWd6Z1RodHZTeHRi?= =?utf-8?B?bERRVm9YYnpydTM3bnpoR3g4c1A5SE1rOVdDNGtnb3ZGNmdaM0FHOFltWlk0?= =?utf-8?B?U21DQjFMZ0pxdEExSTFBN1gxYWRzLzA1Q1F4TjYyL21aSXdTNCtiZFlGSmxC?= =?utf-8?B?RzBuVHpBUy9RQmRCOUxPMW5iRVA3MFExbDRPaDRYRGNYemhlZTVYeXlWR1NE?= =?utf-8?B?R3I1eFhPZmovRE9JQ2lQanVjcGxaUXBTRFRxL0NUdmE3V2xPQnRxbEVKbzZj?= =?utf-8?B?eUk3SVo2RDVqenAzS3AzWHgrZnJuZUxlQnpvVUNldVo0eWVRcEwzTjRqK0Jo?= =?utf-8?B?MFVrYTNCUU1FQkdESy9ncXlxb2tvbzVDSGVGY3VnZXhYKzB3ZjUxZHBxS3ZQ?= =?utf-8?B?dnZSeklqbS9SN3kyTVNOd3NKTGZWNVZsNEQ4RE1YVk9hdUg2S2JHbUF2TVpk?= =?utf-8?B?OWJHUDFYVC9rNG5uMWxlM3IxMXd0dTF0YWpCQ3dyOU5NY1pyWDBMSUZxY1R0?= =?utf-8?B?L2N6SDh0WXRBSmR6MUhDa09kUTVKVDNCSWs5MU12N2xLelpKVUU0UCthTy80?= =?utf-8?B?cExKYWVyaUN1aVZaN2YvL0xWa01yQnZnQjY1MlRzNSs4aFNMdGd4eVRxWXNn?= =?utf-8?B?NHNHMXVLNGN3dWpudmVQV1VqUjF1MTc1VWVwTWUwMzBsdkNZbGt4SXlBRXc3?= =?utf-8?B?TFptbFJ4endTNWlvL2E1ZVZOb2xicElqN25wSktxNTdiYUc0dU96Qm50RFlB?= =?utf-8?B?RGtYSlhXZDl5alFoYlN6QndLbHU0bVhtNmVTbHpFVFBxOHA1N0JnVVFFVzJB?= =?utf-8?B?MjhDSVJMSE42NGcwY09hSWZDWm1yVHJLc0M3RDVEUmdqeWdIRlJQdHJJRkZp?= =?utf-8?B?clhLWmdwMm1rcExzdWFTUHNyWEZKdkJzTkZuSFFHWW5rQzFNdDhyNXE3STZM?= =?utf-8?B?UzhBN0pXUzErMHlKZWFjWWRhdE5oaEtGYndtYVFqVkpFV3FNM1Ird3RMMmd5?= =?utf-8?B?d1dTQnkwUGN0dHJIRWYrQUY5ME44SFEwaEdjL21pNkVPQ3E3bjJldjdhZGl3?= =?utf-8?B?UkxyQzFhcXNaZHRabmRoZE9qcjI3SXo2c3FXOUYvbGEvL1B1Z0VheXJIVWVF?= =?utf-8?B?TTB6V0EwVFlDaVo5eWdHazhWbkdTZEwwVFQ3S216NXFwVjhJekdaRWF5OGt5?= =?utf-8?B?THBBSENmZ0doYTkwWVFaejlaSWdOeUVIR2JQQTAxRnhHZ1AwdG5vT3VNS3gx?= =?utf-8?B?b280ZnFBVWt5UTdPV0ZwZi9zM2R5Qmc1Z254RlBBL0VwOVZZc3E4MW5MWXg1?= =?utf-8?B?L0Yzb1I0b0k5SmxjV2xOSkM3L3JsOVJvbjY2MXQwRVdSblorcExqRGlWd0lz?= =?utf-8?B?VTNFMzNEMTRKU0dVcVVvZFlPY3FvVmdzeC9vcG1iYUlpN0tQRG9RM1BaaDVX?= =?utf-8?B?QlUvWW5pbFlwRjJKeHIxcXo3TE1JUFBydDRsL2cxaUZSUk5uOFZocFBMcGtq?= =?utf-8?B?RnNLbEx5dXVDblBsOWNpR25qMlppY3FndlUwbFN5aEUrbkxxeHBORDQ0dXlk?= =?utf-8?B?aUJtZzN2eFFwOUpsZ2N2ZVlJSzRuTDhXRExPUTY4UmNsSE45WnIzamIySzN5?= =?utf-8?B?ek1wMWNhU1lXYStqZDdSS3AvRkJ5RStYQzN2cU1UYitRbEc4UzJLcmFqeThW?= =?utf-8?B?VUhLMUgwbDNTQ3Ftd2dDeHh5NzZHVWc4NGdRdlBIYzUxMUVPRjZha09vTEMv?= =?utf-8?Q?W4lYWWRGDHctW3AAtGBDR+cXBd8m8aSEt4Lclut?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2158.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGQxdFQ2T1JKM3F0ekJxVW1SUVJrYUtEb0lEbmNRMzRFUHlHS2llNnl3dTZl?= =?utf-8?B?cmNkamcrcEZPMExvZzFVOXVINFN2cEtCazBNYnY1aHBFWDBFMVhhWWpodWhw?= =?utf-8?B?cU1ialA1bDBNY0J3WmMzQ3BQbXN6N0FmTks0Q3Ewd0xOdHowQ0pRbUZUb2Ju?= =?utf-8?B?R1p4dkZ1Rm82Y2xsd0VFZER2djBNdjVpSFJReExld0ZkWVVEYWplcHd2U2Jt?= =?utf-8?B?ZFZjdUpQYndoS1phaDFlbjVFRDJ0T1lCWVBBcUhxcE54MHo4YVlYQTUzaDlV?= =?utf-8?B?U2dFYXA2RUVyVW9YM1NXUVdyb0dxc0dpeTRXYUg3dkxBZjN0YWtzeFJDR1Jk?= =?utf-8?B?TUF3V0dWTm5kczBlQ05CTU01bjM2bUZYK2V5Y1ZWU015eHJ5N2xITFZJak11?= =?utf-8?B?WjVHWWpxR1IvWUVxWjJmQitIZHFITE42UmNwd0lnVGx6Tlk4T0ZlZGorK2xL?= =?utf-8?B?ZERTdnpqNno1aysvWVA0azdmakV3QTVZT1R0TXNUSnN1SHBLTXF0bHdKK1BD?= =?utf-8?B?a1BTSi93ZWNMSG9aNXp3Rm1CUy9nRENsTHMxaHU3RGFwM2l1TXdjYzNkUjBv?= =?utf-8?B?eGhFVGJWV0JLajlDYU5vSFF5Q0NpNVNtbjgzWkN1dEh4eEptbWZ2eU9sWlVk?= =?utf-8?B?WCtKQ2VHaXVTdUxlSFN2YklCeC9qVkxUSkY2aWJoei9vNTEvbU5PbkNGUE15?= =?utf-8?B?OWFQYUl4SlhINWxOclp6ajc2bzFQUlFVaFh1VzYwZ1lHbzJlQzJlOVJqNHBh?= =?utf-8?B?T2dSOWYxb1NkNU93eXlmN0EvS1M0UVFSVWFaMUlVaFVFaVRQZXNRbDg3OVJi?= =?utf-8?B?M2twU3g2UTE3M3VkbjhJUFNQRGNtdzNhMXgyNE90NEtsaHpja2h0NTBnVE5O?= =?utf-8?B?ZDZUNTR6QnZEQWxNSGpMYVJxQ2o3SWxlVE9NcEJjRi9UUU8yczFZV2R4OE1Q?= =?utf-8?B?aTdwMUNudzl4WmVwNkZ6TnlqdWlFaWhVM1VEMHc1R3lIckdFWDRXSzdUWVFi?= =?utf-8?B?Wm9nQUN3Mk5kVEVCbnJLakpIMUFSeUR3WHo3Ykd1QVV2M2k2eFJVOFYvM3dW?= =?utf-8?B?NnovdlROK29pWGdnakhaYTh0QXR1QTZ0VWpxQ0hUSFJia0NJa3l1VmROeTFB?= =?utf-8?B?aU5iSkw2MDY1M2pnV0R3QjRDZXdpZ2k1ODM4cHJZVElLMEg2Ry9PQWJRaVN2?= =?utf-8?B?a0pmS0UzM0dHcXJSMmtMUUYremZWK0RqZWQzYVl5L1VlYmZEckVYRmozTk5m?= =?utf-8?B?aDZJNGJUZ21EM0RLMjJUUEVjQmdTM1hPUlhlaEJJbHkrUVRvWisrcE9UK2lu?= =?utf-8?B?NzQyaEYxMXpoRzZIM01jWlNtUGR3enhlQXpWaXA2WWozdEJ3WmRDSllTZk1x?= =?utf-8?B?VnNNUWV3ZlBSRkZWbkNjYmFVcXNhalo5Q25EOVlQRkRsU3JsSytGME8wZlAv?= =?utf-8?B?WGdXRFdqTXRGRTlCd0M1SHp4TFdMTDR0MmJLdTBOTFpJTGo4YXhTS1J2cDhX?= =?utf-8?B?WldQcG4ySVYvZmxuTHZ4eThYUHVsUGpoVzkrQXNnM0tKaFJQNGQ1eEFmZStw?= =?utf-8?B?Y0U5MkczMUxjaHJrYTdUT2lxcVBrQ2RVSnNQZGhGcFRqaCtwWkM3Rkd6dkVZ?= =?utf-8?B?dG5XVjhhOWM3SGhhQmNYZGZwVHBnWllTOEIwYVI4OUdJWGVTTzhzOGdNUXpu?= =?utf-8?B?bmg4ZEI4bWg1R0MxSVJUb2JvSlZaTllmUW1zT2g4R0x2dW02d0JsaFl2Z0F3?= =?utf-8?B?SjVtSTBKT3U4MmhEOWVhelgyRmVtU2VWdnJ4eUYraTNzUWN5ZnZvUVJIM3Fy?= =?utf-8?B?em5INWluV3FmMVhPVUNJR1JIQzFIWGswYUM5c3M1L1czS2xDQSs4UFRtd2c1?= =?utf-8?B?TmRQV0NUUzhmL1hqekt6bElZeG9NL1piaWFrWTdFQ2Z3REpQZmhYRFZaSExU?= =?utf-8?B?VE56YVVYVmdnWWg1T0NmdGxQTDIxYnRUVVdOU3lRMk9DZXNNOEdxakdVeDkw?= =?utf-8?B?S21wNm1CbXMvL2JjUzdxNEtjRlVFaWVPS0VQMUdpdUdJTmN2NDRZS0FTcFNO?= =?utf-8?B?cGxabXpnam5mSEtnTVorakZXYmxyMzcrdGdjelR4ZHpmUFNYWjYwTGFEb3Q5?= =?utf-8?B?TEY2MWllVG5vLzgrWEdCeVhWRW5HNnNaRUc4KzAxb3lDbW9iTXF5VTAxdFNW?= =?utf-8?Q?jfPwwrZbY2XnPfsGf9hsCb4=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 4ZOFlQM9suStUN/CrUOYl3fsZlynUksvrjpqmqsDDyEYqP4Ef4xNg95dX9CQbuSgQiKa32Pnfg70TTy4RWSFK1G0c6UAZf9WRCzaWMx49rH2EF7RT+zv52H5/2rMIautFB6kgniBkvd7S/2Jt3TLPbga0N+kHoeYO3hvcu8s+ccqsB6EFttAOPshYnM0MI+JfXJ5Z0S7YWuvur0Y8C7IHfJloDIPVAtVXi17XUwbLeWG0RPgAnRYyPhU1ZI+2b/mCkDfLStOf2mHZzoZvyPbBcfFDR1UvRlmUdrJBke3PX/5ZxsPfdjhlrnhQheI3IkmqFXH5ci7f2GktvbxoTQ7ZZlGby5EfnQnEZUvCIQT2nRebIeM1iC74pReKmZsXVD3ZFYjN6MJ3KwKnFch7Xkr1kXtytk6SdDIX3eU4hLog/N5DI7P9MN8SKbMVTTnOTZRrc0ceyDdYt6Sn808iXLWoFK42tUE2h6qE0Za5eSChI6X0Zw0El29OC6u56aFS5d+jTz6FDFY6VODgxg/NoHP7y6ShlFM7Zmx4jUsC64RZlYLhhzMa+8gAofG02PsxP/3nbg/+K6JcuPhztQlAlaPkWGZLYSiIQdbwp2yEpGXpRw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c37a318e-3cd7-431b-d5e0-08dc8531951f X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 07:31:58.3007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qsgxIcyNtM5OHgz7F3Ft0XzSuOiQH2J4IBF13k7iXCfd/BbvLiAGeU7XA55qfWDrWTr8U2xeKH3wfrhqZqlSSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6968 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_11,2024-06-05_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050054 X-Proofpoint-ORIG-GUID: a-dlhY1Rv4jpx0N-bv1lD7_Z00w35ofN X-Proofpoint-GUID: a-dlhY1Rv4jpx0N-bv1lD7_Z00w35ofN X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 5/30/24 14:32, David Faust wrote: > This patch replaces all inter-type references in the ctfc internal data > structures with pointers, rather than the references-by-ID which were > used previously. > > A couple of small updates in the BPF backend are included to make it > compatible with the change. > > This change is only to the in-memory representation of various CTF > structures to make them easier to work with in various cases. It is > outwardly transparent; there is no change in emitted CTF. > > gcc/ > * btfout.cc (BTF_VOID_TYPEID, BTF_INIT_TYPEID): Move defines to > include/btf.h. > (btf_dvd_emit_preprocess_cb, btf_emit_preprocess) > (btf_dmd_representable_bitfield_p, btf_asm_array, btf_asm_varent) > (btf_asm_sou_member, btf_asm_func_arg, btf_init_postprocess): > Adapt to structural changes in ctf_* structs. > * ctfc.h (struct ctf_dtdef): Add forward declaration. > (ctf_dtdef_t, ctf_dtdef_ref): Move typedefs earlier. > (struct ctf_arinfo, struct ctf_funcinfo, struct ctf_sliceinfo) > (struct ctf_itype, struct ctf_dmdef, struct ctf_func_arg) > (struct ctf_dvdef): Use pointers instead of type IDs for > references to other types and use typedefs where appropriate. > (struct ctf_dtdef): Add ref_type member. > (ctf_type_exists): Use pointer instead of type ID. > (ctf_add_reftype, ctf_add_enum, ctf_add_slice, ctf_add_float) > (ctf_add_integer, ctf_add_unknown, ctf_add_pointer) > (ctf_add_array, ctf_add_forward, ctf_add_typedef) > (ctf_add_function, ctf_add_sou, ctf_add_enumerator) > (ctf_add_variable): Likewise. Return pointer instead of ID. > (ctf_lookup_tree_type): Return pointer to type instead of ID. > * ctfc.cc: Analogous changes. > * ctfout.cc (ctf_asm_type, ctf_asm_slice, ctf_asm_varent) > (ctf_asm_sou_lmember, ctf_asm_sou_member, ctf_asm_func_arg) > (output_ctf_objt_info): Adapt to changes. > * dwarf2ctf.cc (gen_ctf_type, gen_ctf_void_type) > (gen_ctf_unknown_type, gen_ctf_base_type, gen_ctf_pointer_type) > (gen_ctf_subrange_type, gen_ctf_array_type, gen_ctf_typedef) > (gen_ctf_modifier_type, gen_ctf_sou_type, gen_ctf_function_type) > (gen_ctf_enumeration_type, gen_ctf_variable, gen_ctf_function) > (gen_ctf_type, ctf_do_die): Likewise. > * config/bpf/btfext-out.cc (struct btf_ext_core_reloc): Use > pointer instead of type ID. > (bpf_core_reloc_add, bpf_core_get_sou_member_index) > (output_btfext_core_sections): Adapt to above changes. > * config/bpf/core-builtins.cc (process_type): Likewise. > > include/ > * btf.h (BTF_VOID_TYPEID, BTF_INIT_TYPEID): Move defines here, > from gcc/btfout.cc. The patch looks OK overall. Few updates to code comments for function description or in the body of the function were missed. I have pointed them out below. OK with those addressed. Thanks > --- > gcc/btfout.cc | 40 +++--- > gcc/config/bpf/btfext-out.cc | 14 +- > gcc/config/bpf/core-builtins.cc | 3 +- > gcc/ctfc.cc | 139 +++++++++--------- > gcc/ctfc.h | 90 ++++++------ > gcc/ctfout.cc | 22 +-- > gcc/dwarf2ctf.cc | 244 +++++++++++++++----------------- > include/btf.h | 5 + > 8 files changed, 278 insertions(+), 279 deletions(-) > > diff --git a/gcc/btfout.cc b/gcc/btfout.cc > index 1b6a9ed811f0..40e8d8c5c01b 100644 > --- a/gcc/btfout.cc > +++ b/gcc/btfout.cc > @@ -61,11 +61,6 @@ static char btf_info_section_label[MAX_BTF_LABEL_BYTES]; > #define BTF_INFO_SECTION_LABEL "Lbtf" > #endif > > -/* BTF encodes void as type id 0. */ > - > -#define BTF_VOID_TYPEID 0 > -#define BTF_INIT_TYPEID 1 > - > #define BTF_INVALID_TYPEID 0xFFFFFFFF > > /* Mapping of CTF variables to the IDs they will be assigned when they are > @@ -626,7 +621,8 @@ btf_dvd_emit_preprocess_cb (ctf_dvdef_ref *slot, ctf_container_ref arg_ctfc) > return 1; > > /* Do not add variables which refer to unsupported types. */ > - if (!voids.contains (var->dvd_type) && btf_removed_type_p (var->dvd_type)) > + if (!voids.contains (var->dvd_type->dtd_type) > + && btf_removed_type_p (var->dvd_type->dtd_type)) > return 1; > > arg_ctfc->ctfc_vars_list[num_vars_added] = var; > @@ -716,7 +712,7 @@ btf_emit_preprocess (ctf_container_ref ctfc) > static bool > btf_dmd_representable_bitfield_p (ctf_container_ref ctfc, ctf_dmdef_t *dmd) > { > - ctf_dtdef_ref ref_type = ctfc->ctfc_types_list[dmd->dmd_type]; > + ctf_dtdef_ref ref_type = ctfc->ctfc_types_list[dmd->dmd_type->dtd_type]; > > if (CTF_V2_INFO_KIND (ref_type->dtd_data.ctti_info) == CTF_K_SLICE) > { > @@ -913,8 +909,8 @@ btf_asm_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd) > static void > btf_asm_array (ctf_container_ref ctfc, ctf_arinfo_t arr) > { > - btf_asm_type_ref ("bta_elem_type", ctfc, arr.ctr_contents); > - btf_asm_type_ref ("bta_index_type", ctfc, arr.ctr_index); > + btf_asm_type_ref ("bta_elem_type", ctfc, arr.ctr_contents->dtd_type); > + btf_asm_type_ref ("bta_index_type", ctfc, arr.ctr_index->dtd_type); > dw2_asm_output_data (4, arr.ctr_nelems, "bta_nelems"); > } > > @@ -927,7 +923,7 @@ btf_asm_varent (ctf_container_ref ctfc, ctf_dvdef_ref var) > (*(btf_var_ids->get (var)) + num_types_added + 1), > var->dvd_name); > dw2_asm_output_data (4, BTF_TYPE_INFO (BTF_KIND_VAR, 0, 0), "btv_info"); > - btf_asm_type_ref ("btv_type", ctfc, var->dvd_type); > + btf_asm_type_ref ("btv_type", ctfc, var->dvd_type->dtd_type); > dw2_asm_output_data (4, var->dvd_visibility, "btv_linkage"); > } > > @@ -937,8 +933,8 @@ btf_asm_varent (ctf_container_ref ctfc, ctf_dvdef_ref var) > static void > btf_asm_sou_member (ctf_container_ref ctfc, ctf_dmdef_t * dmd, unsigned int idx) > { > - ctf_dtdef_ref ref_type = ctfc->ctfc_types_list[dmd->dmd_type]; > - ctf_id_t base_type = dmd->dmd_type; > + ctf_dtdef_ref ref_type = ctfc->ctfc_types_list[dmd->dmd_type->dtd_type]; > + ctf_id_t base_type = dmd->dmd_type->dtd_type; > uint64_t sou_offset = dmd->dmd_offset; > > dw2_asm_output_data (4, dmd->dmd_name_offset, > @@ -959,7 +955,7 @@ btf_asm_sou_member (ctf_container_ref ctfc, ctf_dmdef_t * dmd, unsigned int idx) > sou_offset |= ((bits & 0xff) << 24); > > /* Refer to the base type of the slice. */ > - base_type = ref_type->dtd_u.dtu_slice.cts_type; > + base_type = ref_type->dtd_u.dtu_slice.cts_type->dtd_type; > } > else > { > @@ -1003,9 +999,11 @@ btf_asm_func_arg (ctf_container_ref ctfc, ctf_func_arg_t * farg, > else > dw2_asm_output_data (4, 0, "farg_name"); > > - btf_asm_type_ref ("farg_type", ctfc, (btf_removed_type_p (farg->farg_type) > - ? BTF_VOID_TYPEID > - : farg->farg_type)); > + ctf_id_t ref_id = BTF_VOID_TYPEID; > + if (farg->farg_type && !btf_removed_type_p (farg->farg_type->dtd_type)) > + ref_id = farg->farg_type->dtd_type; > + > + btf_asm_type_ref ("farg_type", ctfc, ref_id); > } > > /* Asm'out a BTF_KIND_FUNC type. */ > @@ -1381,7 +1379,7 @@ btf_init_postprocess (void) > to create the const modifier type (if needed) now, before making the types > list. So we can't avoid iterating with FOR_EACH_VARIABLE here, and then > again when creating the DATASEC entries. */ > - ctf_id_t constvoid_id = CTF_NULL_TYPEID; > + ctf_dtdef_ref constvoid_dtd = NULL; > varpool_node *var; > FOR_EACH_VARIABLE (var) > { > @@ -1400,10 +1398,10 @@ btf_init_postprocess (void) > continue; > > /* Create the 'const' modifier type for void. */ > - if (constvoid_id == CTF_NULL_TYPEID) > - constvoid_id = ctf_add_reftype (tu_ctfc, CTF_ADD_ROOT, > - dvd->dvd_type, CTF_K_CONST, NULL); > - dvd->dvd_type = constvoid_id; > + if (constvoid_dtd == NULL) > + constvoid_dtd = ctf_add_reftype (tu_ctfc, CTF_ADD_ROOT, > + dvd->dvd_type, CTF_K_CONST, NULL); > + dvd->dvd_type = constvoid_dtd; > } > } > > diff --git a/gcc/config/bpf/btfext-out.cc b/gcc/config/bpf/btfext-out.cc > index 7ec438fd1d10..b3df7b555d5f 100644 > --- a/gcc/config/bpf/btfext-out.cc > +++ b/gcc/config/bpf/btfext-out.cc > @@ -134,7 +134,7 @@ struct GTY ((chain_next ("%h.next"))) btf_ext_lineinfo > > /* Internal representation of a BPF CO-RE relocation record. */ > struct GTY ((chain_next ("%h.next"))) btf_ext_core_reloc { > - unsigned int bpfcr_type; /* BTF type ID of container. */ > + ctf_dtdef_ref bpfcr_type; /* BTF type involved in relocation. */ > unsigned int bpfcr_astr_off; /* Offset of access string in .BTF > string table. */ > rtx_code_label * bpfcr_insn_label; /* RTX label attached to instruction > @@ -296,13 +296,14 @@ bpf_core_reloc_add (const tree type, const char * section_name, > struct btf_ext_core_reloc *bpfcr = bpf_create_core_reloc (section_name, &sec); > > ctf_container_ref ctfc = ctf_get_tu_ctfc (); > + ctf_dtdef_ref dtd = ctf_lookup_tree_type (ctfc, type); > > /* Buffer the access string in the auxiliary strtab. */ > bpfcr->bpfcr_astr_off = 0; > gcc_assert (accessor != NULL); > bpfcr->bpfcr_astr_off = btf_ext_add_string (accessor); > > - bpfcr->bpfcr_type = get_btf_id (ctf_lookup_tree_type (ctfc, type)); > + bpfcr->bpfcr_type = dtd; > bpfcr->bpfcr_insn_label = label; > bpfcr->bpfcr_kind = kind; > > @@ -341,7 +342,8 @@ bpf_core_get_sou_member_index (ctf_container_ref ctfc, const tree node) > for (dmd = dtd->dtd_u.dtu_members; > dmd != NULL; dmd = (ctf_dmdef_t *) ctf_dmd_list_next (dmd)) > { > - bool field_has_btf = get_btf_id (dmd->dmd_type) <= BTF_MAX_TYPE; > + bool field_has_btf = (dmd->dmd_type > + && dmd->dmd_type->dtd_type <= BTF_MAX_TYPE); > > if (field == node) > return field_has_btf ? i : -1; > @@ -574,8 +576,10 @@ output_btfext_core_sections (void) > false); > char *str = xstrdup (pp_formatted_text (&pp)); > > - dw2_asm_output_data (4, bpfcr->bpfcr_type, "bpfcr_type (%s)", > - str); > + uint32_t type_id = bpfcr->bpfcr_type > + ? bpfcr->bpfcr_type->dtd_type > + : BTF_VOID_TYPEID; > + dw2_asm_output_data (4, type_id, "bpfcr_type (%s)", str); > dw2_asm_output_data (4, bpfcr->bpfcr_astr_off + str_aux_off, > "bpfcr_astr_off (\"%s\")", > bpfcr->info.accessor_str); > diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc > index 829acea98f79..232bebcadbd5 100644 > --- a/gcc/config/bpf/core-builtins.cc > +++ b/gcc/config/bpf/core-builtins.cc > @@ -1021,7 +1021,8 @@ process_type (struct cr_builtins *data) > && data->default_value != NULL) > { > ctf_container_ref ctfc = ctf_get_tu_ctfc (); > - unsigned int btf_id = get_btf_id (ctf_lookup_tree_type (ctfc, ret.type)); > + ctf_dtdef_ref dtd = ctf_lookup_tree_type (ctfc, ret.type); > + unsigned int btf_id = dtd ? dtd->dtd_type : BTF_VOID_TYPEID; > data->rtx_default_value = expand_normal (build_int_cst (integer_type_node, > btf_id)); > } > diff --git a/gcc/ctfc.cc b/gcc/ctfc.cc > index 67711606ab85..678ca2a072cf 100644 > --- a/gcc/ctfc.cc > +++ b/gcc/ctfc.cc > @@ -373,9 +373,9 @@ ctf_add_cuname (ctf_container_ref ctfc, const char * filename) > ctf_dvd_lookup, as applicable, to ascertain that the CTF type or the CTF > variable respectively does not already exist, and then add it. */ > > -static ctf_id_t > +static ctf_dtdef_ref > ctf_add_generic (ctf_container_ref ctfc, uint32_t flag, const char * name, > - ctf_dtdef_ref * rp, dw_die_ref die) > + dw_die_ref die) > { > ctf_dtdef_ref dtd; > ctf_id_t type; > @@ -397,18 +397,16 @@ ctf_add_generic (ctf_container_ref ctfc, uint32_t flag, const char * name, > > ctf_dtd_insert (ctfc, dtd); > > - *rp = dtd; > - return type; > + return dtd; > } > > -static ctf_id_t > +static ctf_dtdef_ref > ctf_add_encoded (ctf_container_ref ctfc, uint32_t flag, const char * name, > const ctf_encoding_t * ep, uint32_t kind, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (kind, flag, 0); > > @@ -424,83 +422,81 @@ ctf_add_encoded (ctf_container_ref ctfc, uint32_t flag, const char * name, > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > -ctf_add_reftype (ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, > +ctf_dtdef_ref > +ctf_add_reftype (ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, > uint32_t kind, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > > - gcc_assert (ref <= CTF_MAX_TYPE); > + gcc_assert (ref != NULL); > > - type = ctf_add_generic (ctfc, flag, NULL, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, NULL, die); > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (kind, flag, 0); > /* Caller of this API must guarantee that a CTF type with id = ref already > exists. This will also be validated for us at link-time. */ > - dtd->dtd_data.ctti_type = (uint32_t) ref; > + dtd->dtd_data.ctti_type = (uint32_t) ref->dtd_type; > + dtd->ref_type = ref; > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_forward (ctf_container_ref ctfc, uint32_t flag, const char * name, > uint32_t kind, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type = 0; > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0); > dtd->dtd_data.ctti_type = kind; > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_typedef (ctf_container_ref ctfc, uint32_t flag, const char * name, > - ctf_id_t ref, dw_die_ref die) > + ctf_dtdef_ref ref, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > > - gcc_assert (ref <= CTF_MAX_TYPE); > + gcc_assert (ref != NULL); > /* Nameless Typedefs are not expected. */ > gcc_assert ((name != NULL) && strcmp (name, "")); > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_TYPEDEF, flag, 0); > /* Caller of this API must guarantee that a CTF type with id = ref already > exists. This will also be validated for us at link-time. */ This comment may cause confusion now. Can you please reword or may be remove it altogether ? Other places where a similar function needs update: ctf_add_slice too. Please do the same action on that comment too. > - dtd->dtd_data.ctti_type = (uint32_t) ref; > + dtd->dtd_data.ctti_type = (uint32_t) ref->dtd_type; > + dtd->ref_type = ref; > > gcc_assert (dtd->dtd_type != dtd->dtd_data.ctti_type); > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > -ctf_add_slice (ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, > +ctf_dtdef_ref > +ctf_add_slice (ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, > uint32_t bit_offset, uint32_t bit_size, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > uint32_t roundup_nbytes; > > gcc_assert ((bit_size <= 255) && (bit_offset <= 255)); > > - gcc_assert (ref <= CTF_MAX_TYPE); > + gcc_assert (ref != NULL); > > - type = ctf_add_generic (ctfc, flag, NULL, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, NULL, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0); > > @@ -514,49 +510,48 @@ ctf_add_slice (ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, > > /* Caller of this API must guarantee that a CTF type with id = ref already > exists. This will also be validated for us at link-time. */ > - dtd->dtd_u.dtu_slice.cts_type = (uint32_t) ref; > + dtd->dtd_u.dtu_slice.cts_type = ref; > dtd->dtd_u.dtu_slice.cts_bits = bit_size; > dtd->dtd_u.dtu_slice.cts_offset = bit_offset; > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_float (ctf_container_ref ctfc, uint32_t flag, > const char * name, const ctf_encoding_t * ep, dw_die_ref die) > { > return (ctf_add_encoded (ctfc, flag, name, ep, CTF_K_FLOAT, die)); > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_integer (ctf_container_ref ctfc, uint32_t flag, > const char * name, const ctf_encoding_t * ep, dw_die_ref die) > { > return (ctf_add_encoded (ctfc, flag, name, ep, CTF_K_INTEGER, die)); > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_unknown (ctf_container_ref ctfc, uint32_t flag, > const char * name, const ctf_encoding_t * ep, dw_die_ref die) > { > return (ctf_add_encoded (ctfc, flag, name, ep, CTF_K_UNKNOWN, die)); > } > > -ctf_id_t > -ctf_add_pointer (ctf_container_ref ctfc, uint32_t flag, ctf_id_t ref, > +ctf_dtdef_ref > +ctf_add_pointer (ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, > dw_die_ref die) > { > return (ctf_add_reftype (ctfc, flag, ref, CTF_K_POINTER, die)); > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_array (ctf_container_ref ctfc, uint32_t flag, const ctf_arinfo_t * arp, > dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > > gcc_assert (arp); > > @@ -564,7 +559,7 @@ ctf_add_array (ctf_container_ref ctfc, uint32_t flag, const ctf_arinfo_t * arp, > arp->ctr_index are already added. This will also be validated for us at > link-time. */ > > - type = ctf_add_generic (ctfc, flag, NULL, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, NULL, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_ARRAY, flag, 0); > dtd->dtd_data.ctti_size = 0; > @@ -572,15 +567,14 @@ ctf_add_array (ctf_container_ref ctfc, uint32_t flag, const ctf_arinfo_t * arp, > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_enum (ctf_container_ref ctfc, uint32_t flag, const char * name, > HOST_WIDE_INT size, bool eunsigned, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > > /* In the compiler, no need to handle the case of promoting forwards to > enums. This comment is simply to note a divergence from libctf. */ > @@ -595,7 +589,7 @@ ctf_add_enum (ctf_container_ref ctfc, uint32_t flag, const char * name, > = CTF_TYPE_INFO (CTF_K_FORWARD, CTF_ADD_NONROOT, 0); > } > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_ENUM, flag, 0); > > @@ -608,12 +602,12 @@ ctf_add_enum (ctf_container_ref ctfc, uint32_t flag, const char * name, > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > int > -ctf_add_enumerator (ctf_container_ref ctfc, ctf_id_t enid, const char * name, > - HOST_WIDE_INT value, dw_die_ref die) > +ctf_add_enumerator (ctf_container_ref ctfc, ctf_dtdef_ref enum_dtd, > + const char * name, HOST_WIDE_INT value, dw_die_ref die) This function body has a comment which mentions "enid" argument. It needs to be updated too. How about: "Callers of this API must make sure that CTF_K_ENUM with enid has been ..." --> "The associated CTF type of kind CTF_K_ENUM must already exist." > { > ctf_dmdef_t * dmd; > uint32_t kind, vlen, root; > @@ -622,7 +616,7 @@ ctf_add_enumerator (ctf_container_ref ctfc, ctf_id_t enid, const char * name, > addded. This will also be validated for us at link-time. */ > ctf_dtdef_ref dtd = ctf_dtd_lookup (ctfc, die); > gcc_assert (dtd); > - gcc_assert (dtd->dtd_type == enid); > + gcc_assert (dtd == enum_dtd); > gcc_assert (name); > > kind = CTF_V2_INFO_KIND (dtd->dtd_data.ctti_info); > @@ -646,7 +640,7 @@ ctf_add_enumerator (ctf_container_ref ctfc, ctf_id_t enid, const char * name, > > /* Buffer the strings in the CTF string table. */ > dmd->dmd_name = ctf_add_string (ctfc, name, &(dmd->dmd_name_offset)); > - dmd->dmd_type = CTF_NULL_TYPEID; > + dmd->dmd_type = NULL; > dmd->dmd_offset = 0; > > dmd->dmd_value = value; > @@ -662,7 +656,7 @@ ctf_add_enumerator (ctf_container_ref ctfc, ctf_id_t enid, const char * name, > > int > ctf_add_member_offset (ctf_container_ref ctfc, dw_die_ref sou, > - const char * name, ctf_id_t type, > + const char * name, ctf_dtdef_ref type, > uint64_t bit_offset) > { > ctf_dtdef_ref dtd = ctf_dtd_lookup (ctfc, sou); > @@ -702,7 +696,7 @@ ctf_add_member_offset (ctf_container_ref ctfc, dw_die_ref sou, > } > > int > -ctf_add_variable (ctf_container_ref ctfc, const char * name, ctf_id_t ref, > +ctf_add_variable (ctf_container_ref ctfc, const char * name, ctf_dtdef_ref ref, > dw_die_ref die, unsigned int external_vis, > dw_die_ref die_var_decl) > { > @@ -747,16 +741,16 @@ ctf_add_variable (ctf_container_ref ctfc, const char * name, ctf_id_t ref, > > int > ctf_add_function_arg (ctf_container_ref ctfc, dw_die_ref func, > - const char * name, ctf_id_t type) > + const char * name, ctf_dtdef_ref arg_dtd) > { > - ctf_dtdef_ref dtd = ctf_dtd_lookup (ctfc, func); > + ctf_dtdef_ref func_dtd = ctf_dtd_lookup (ctfc, func); > ctf_func_arg_t * farg; > uint32_t vlen; > > /* The function to which argument is being added must already exist. */ > - gcc_assert (dtd); > + gcc_assert (func_dtd); > /* The number of args must have been non-zero. */ > - vlen = CTF_V2_INFO_VLEN (dtd->dtd_data.ctti_info); > + vlen = CTF_V2_INFO_VLEN (func_dtd->dtd_data.ctti_info); > gcc_assert (vlen); > > farg = ggc_cleared_alloc (); > @@ -766,9 +760,9 @@ ctf_add_function_arg (ctf_container_ref ctfc, dw_die_ref func, > these strings to avoid unnecessary bloat in CTF section in CTF V3. */ > farg->farg_name = ctf_add_string (ctfc, name, &(farg->farg_name_offset), > CTF_AUX_STRTAB); > - farg->farg_type = type; > + farg->farg_type = arg_dtd; > > - ctf_farg_list_append (&dtd->dtd_u.dtu_argv, farg); > + ctf_farg_list_append (&func_dtd->dtd_u.dtu_argv, farg); > > /* For aux_str, keep ctfc_aux_strlen updated for debugging. */ > if ((name != NULL) && strcmp (name, "")) > @@ -777,13 +771,12 @@ ctf_add_function_arg (ctf_container_ref ctfc, dw_die_ref func, > return 0; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_function (ctf_container_ref ctfc, uint32_t flag, const char * name, > const ctf_funcinfo_t * ctc, dw_die_ref die, > bool from_global_func, int linkage) > { > ctf_dtdef_ref dtd; > - ctf_id_t type; > uint32_t vlen; > > gcc_assert (ctc); > @@ -791,27 +784,27 @@ ctf_add_function (ctf_container_ref ctfc, uint32_t flag, const char * name, > vlen = ctc->ctc_argc; > gcc_assert (vlen <= CTF_MAX_VLEN); > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > > dtd->from_global_func = from_global_func; > dtd->linkage = linkage; > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (CTF_K_FUNCTION, flag, vlen); > + dtd->ref_type = ctc->ctc_return; > /* Caller must make sure CTF types for ctc->ctc_return are already added. */ > - dtd->dtd_data.ctti_type = (uint32_t) ctc->ctc_return; > + dtd->dtd_data.ctti_type = (uint32_t) ctc->ctc_return->dtd_type; > /* Caller must make sure CTF types for function arguments are already added > via ctf_add_function_arg () API. */ > > ctfc->ctfc_num_stypes++; > > - return type; > + return dtd; > } > > -ctf_id_t > +ctf_dtdef_ref > ctf_add_sou (ctf_container_ref ctfc, uint32_t flag, const char * name, > uint32_t kind, size_t size, dw_die_ref die) > { > ctf_dtdef_ref dtd; > - ctf_id_t type = 0; > > gcc_assert ((kind == CTF_K_STRUCT) || (kind == CTF_K_UNION)); > > @@ -828,7 +821,7 @@ ctf_add_sou (ctf_container_ref ctfc, uint32_t flag, const char * name, > = CTF_TYPE_INFO (CTF_K_FORWARD, CTF_ADD_NONROOT, 0); > } > > - type = ctf_add_generic (ctfc, flag, name, &dtd, die); > + dtd = ctf_add_generic (ctfc, flag, name, die); > > dtd->dtd_data.ctti_info = CTF_TYPE_INFO (kind, flag, 0); > > @@ -845,23 +838,23 @@ ctf_add_sou (ctf_container_ref ctfc, uint32_t flag, const char * name, > ctfc->ctfc_num_stypes++; > } > > - return type; > + return dtd; > } > > /* Given a TREE_TYPE node, return the CTF type ID for that type. */ > This comment needs an update: "return the CTF type object" ? > -ctf_id_t > +ctf_dtdef_ref > ctf_lookup_tree_type (ctf_container_ref ctfc, const tree type) > { > dw_die_ref die = lookup_type_die (type); > if (die == NULL) > - return CTF_NULL_TYPEID; > + return NULL; > > ctf_dtdef_ref dtd = ctf_dtd_lookup (ctfc, die); > if (dtd == NULL) > - return CTF_NULL_TYPEID; > + return NULL; > > - return dtd->dtd_type; > + return dtd; > } > > /* Check if CTF for TYPE has already been generated. Mainstay for > @@ -870,7 +863,7 @@ ctf_lookup_tree_type (ctf_container_ref ctfc, const tree type) > > bool > ctf_type_exists (ctf_container_ref ctfc, dw_die_ref type, > - ctf_id_t * type_id) > + ctf_dtdef_ref * dtd) The function-level comment for this one also needs an update. "updates the TYPE_ID for the caller." --> "updates the CTF type object DTD for the caller" ? > { > bool exists = false; > ctf_dtdef_ref ctf_type_seen = ctf_dtd_lookup (ctfc, type); > @@ -879,7 +872,7 @@ ctf_type_exists (ctf_container_ref ctfc, dw_die_ref type, > { > exists = true; > /* CTF type for this type exists. */ > - *type_id = ctf_type_seen->dtd_type; > + *dtd = ctf_type_seen; > } > > return exists; > diff --git a/gcc/ctfc.h b/gcc/ctfc.h > index e7bd93901cfa..b2060eaf7e9b 100644 > --- a/gcc/ctfc.h > +++ b/gcc/ctfc.h > @@ -48,6 +48,10 @@ along with GCC; see the file COPYING3. If not see > > typedef uint64_t ctf_id_t; > > +struct ctf_dtdef; > +typedef struct ctf_dtdef ctf_dtdef_t; > +typedef ctf_dtdef_t * ctf_dtdef_ref; > + > /* CTF string table element (list node). */ > > typedef struct GTY ((chain_next ("%h.cts_next"))) ctf_string > @@ -81,8 +85,8 @@ typedef struct GTY (()) ctf_encoding > > typedef struct GTY (()) ctf_arinfo > { > - ctf_id_t ctr_contents; /* Type of array contents. */ > - ctf_id_t ctr_index; /* Type of array index. */ > + ctf_dtdef_ref ctr_contents; /* Type of array contents. */ > + ctf_dtdef_ref ctr_index; /* Type of array index. */ > unsigned int ctr_nelems; /* Number of elements. */ > } ctf_arinfo_t; > > @@ -90,14 +94,14 @@ typedef struct GTY (()) ctf_arinfo > > typedef struct GTY (()) ctf_funcinfo > { > - ctf_id_t ctc_return; /* Function return type. */ > - unsigned int ctc_argc; /* Number of typed arguments to function. */ > - unsigned int ctc_flags; /* Function attributes (see below). */ > + ctf_dtdef_ref ctc_return; /* Function return type. */ > + unsigned int ctc_argc; /* Number of typed arguments to function. */ > + unsigned int ctc_flags; /* Function attributes (see below). */ > } ctf_funcinfo_t; > > typedef struct GTY (()) ctf_sliceinfo > { > - unsigned int cts_type; /* Reference CTF type. */ > + ctf_dtdef_ref cts_type; /* Reference CTF type. */ > unsigned short cts_offset; /* Offset in bits of the first bit. */ > unsigned short cts_bits; /* Size in bits. */ > } ctf_sliceinfo_t; > @@ -130,7 +134,7 @@ typedef struct GTY (()) ctf_itype > typedef struct GTY ((chain_next ("%h.dmd_next"))) ctf_dmdef > { > const char * dmd_name; /* Name of this member. */ > - ctf_id_t dmd_type; /* Type of this member (for sou). */ > + ctf_dtdef_ref dmd_type; /* Type of this member (for sou). */ > uint32_t dmd_name_offset; /* Offset of the name in str table. */ > uint64_t dmd_offset; /* Offset of this member in bits (for sou). */ > HOST_WIDE_INT dmd_value; /* Value of this member (for enum). */ > @@ -143,7 +147,7 @@ typedef struct GTY ((chain_next ("%h.dmd_next"))) ctf_dmdef > > typedef struct GTY (()) ctf_func_arg > { > - ctf_id_t farg_type; /* Type identifier of the argument. */ > + ctf_dtdef_ref farg_type; /* Type of the argument. */ > const char * farg_name; /* Name of the argument. */ > uint32_t farg_name_offset; /* Offset of the name in str table. */ > struct ctf_func_arg * farg_next;/* A list node. */ > @@ -158,6 +162,7 @@ struct GTY ((for_user)) ctf_dtdef > dw_die_ref dtd_key; /* Type key for hashing. */ > const char * dtd_name; /* Name associated with definition (if any). */ > ctf_id_t dtd_type; /* Type identifier for this definition. */ > + ctf_dtdef_ref ref_type; /* Type referred to by this type (if any). */ > ctf_itype_t dtd_data; /* Type node. */ > bool from_global_func; /* Whether this type was added from a global > function. */ > @@ -178,7 +183,7 @@ struct GTY ((for_user)) ctf_dtdef > } dtd_u; > }; > > -typedef struct ctf_dtdef ctf_dtdef_t; > +#define ctf_type_id(dtd) ((uint32_t) dtd->dtd_type) > > /* Variable definition for CTF generation. */ > > @@ -188,13 +193,11 @@ struct GTY ((for_user)) ctf_dvdef > const char * dvd_name; /* Name associated with variable. */ > uint32_t dvd_name_offset; /* Offset of the name in str table. */ > unsigned int dvd_visibility; /* External visibility. 0=static,1=global. */ > - ctf_id_t dvd_type; /* Type of variable. */ > + ctf_dtdef_ref dvd_type; /* Type of variable. */ > }; > > typedef struct ctf_dvdef ctf_dvdef_t; > - > typedef ctf_dvdef_t * ctf_dvdef_ref; > -typedef ctf_dtdef_t * ctf_dtdef_ref; > > /* Location information for CTF Types and CTF Variables. */ > > @@ -390,7 +393,7 @@ extern void btf_finalize (void); > > extern ctf_container_ref ctf_get_tu_ctfc (void); > > -extern bool ctf_type_exists (ctf_container_ref, dw_die_ref, ctf_id_t *); > +extern bool ctf_type_exists (ctf_container_ref, dw_die_ref, ctf_dtdef_ref *); > > extern void ctf_add_cuname (ctf_container_ref, const char *); > > @@ -404,41 +407,42 @@ extern bool ctf_dvd_ignore_lookup (const ctf_container_ref ctfc, > extern const char * ctf_add_string (ctf_container_ref, const char *, > uint32_t *, int); > > -extern ctf_id_t ctf_add_reftype (ctf_container_ref, uint32_t, ctf_id_t, > - uint32_t, dw_die_ref); > -extern ctf_id_t ctf_add_enum (ctf_container_ref, uint32_t, const char *, > - HOST_WIDE_INT, bool, dw_die_ref); > -extern ctf_id_t ctf_add_slice (ctf_container_ref, uint32_t, ctf_id_t, > - uint32_t, uint32_t, dw_die_ref); > -extern ctf_id_t ctf_add_float (ctf_container_ref, uint32_t, const char *, > - const ctf_encoding_t *, dw_die_ref); > -extern ctf_id_t ctf_add_integer (ctf_container_ref, uint32_t, const char *, > - const ctf_encoding_t *, dw_die_ref); > -extern ctf_id_t ctf_add_unknown (ctf_container_ref, uint32_t, const char *, > - const ctf_encoding_t *, dw_die_ref); > -extern ctf_id_t ctf_add_pointer (ctf_container_ref, uint32_t, ctf_id_t, > - dw_die_ref); > -extern ctf_id_t ctf_add_array (ctf_container_ref, uint32_t, > - const ctf_arinfo_t *, dw_die_ref); > -extern ctf_id_t ctf_add_forward (ctf_container_ref, uint32_t, const char *, > - uint32_t, dw_die_ref); > -extern ctf_id_t ctf_add_typedef (ctf_container_ref, uint32_t, const char *, > - ctf_id_t, dw_die_ref); > -extern ctf_id_t ctf_add_function (ctf_container_ref, uint32_t, const char *, > - const ctf_funcinfo_t *, dw_die_ref, bool, int); > -extern ctf_id_t ctf_add_sou (ctf_container_ref, uint32_t, const char *, > - uint32_t, size_t, dw_die_ref); > - > -extern int ctf_add_enumerator (ctf_container_ref, ctf_id_t, const char *, > +extern ctf_dtdef_ref ctf_add_reftype (ctf_container_ref, uint32_t, > + ctf_dtdef_ref, uint32_t, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_enum (ctf_container_ref, uint32_t, const char *, > + HOST_WIDE_INT, bool, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_slice (ctf_container_ref, uint32_t, ctf_dtdef_ref, > + uint32_t, uint32_t, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_float (ctf_container_ref, uint32_t, const char *, > + const ctf_encoding_t *, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_integer (ctf_container_ref, uint32_t, const char *, > + const ctf_encoding_t *, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_unknown (ctf_container_ref, uint32_t, const char *, > + const ctf_encoding_t *, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_pointer (ctf_container_ref, uint32_t, > + ctf_dtdef_ref, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_array (ctf_container_ref, uint32_t, > + const ctf_arinfo_t *, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_forward (ctf_container_ref, uint32_t, const char *, > + uint32_t, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_typedef (ctf_container_ref, uint32_t, const char *, > + ctf_dtdef_ref, dw_die_ref); > +extern ctf_dtdef_ref ctf_add_function (ctf_container_ref, uint32_t, > + const char *, const ctf_funcinfo_t *, > + dw_die_ref, bool, int); > +extern ctf_dtdef_ref ctf_add_sou (ctf_container_ref, uint32_t, const char *, > + uint32_t, size_t, dw_die_ref); > + > +extern int ctf_add_enumerator (ctf_container_ref, ctf_dtdef_ref, const char *, > HOST_WIDE_INT, dw_die_ref); > extern int ctf_add_member_offset (ctf_container_ref, dw_die_ref, const char *, > - ctf_id_t, uint64_t); > + ctf_dtdef_ref, uint64_t); > extern int ctf_add_function_arg (ctf_container_ref, dw_die_ref, > - const char *, ctf_id_t); > -extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t, > + const char *, ctf_dtdef_ref); > +extern int ctf_add_variable (ctf_container_ref, const char *, ctf_dtdef_ref, > dw_die_ref, unsigned int, dw_die_ref); > > -extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree); > +extern ctf_dtdef_ref ctf_lookup_tree_type (ctf_container_ref, const tree); > extern ctf_id_t get_btf_id (ctf_id_t); > > typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *); > diff --git a/gcc/ctfout.cc b/gcc/ctfout.cc > index ee082b5fd016..157afbac4f48 100644 > --- a/gcc/ctfout.cc > +++ b/gcc/ctfout.cc > @@ -380,7 +380,8 @@ ctf_asm_type (ctf_dtdef_ref type) > static void > ctf_asm_slice (ctf_dtdef_ref type) > { > - dw2_asm_output_data (4, type->dtd_u.dtu_slice.cts_type, "cts_type"); > + dw2_asm_output_data (4, ctf_type_id (type->dtd_u.dtu_slice.cts_type), > + "cts_type"); > dw2_asm_output_data (2, type->dtd_u.dtu_slice.cts_offset, "cts_offset"); > dw2_asm_output_data (2, type->dtd_u.dtu_slice.cts_bits, "cts_bits"); > } > @@ -390,8 +391,10 @@ ctf_asm_slice (ctf_dtdef_ref type) > static void > ctf_asm_array (ctf_dtdef_ref dtd) > { > - dw2_asm_output_data (4, dtd->dtd_u.dtu_arr.ctr_contents, "cta_contents"); > - dw2_asm_output_data (4, dtd->dtd_u.dtu_arr.ctr_index, "cta_index"); > + dw2_asm_output_data (4, ctf_type_id (dtd->dtd_u.dtu_arr.ctr_contents), > + "cta_contents"); > + dw2_asm_output_data (4, ctf_type_id (dtd->dtd_u.dtu_arr.ctr_index), > + "cta_index"); > dw2_asm_output_data (4, dtd->dtd_u.dtu_arr.ctr_nelems, "cta_nelems"); > } > > @@ -403,7 +406,7 @@ ctf_asm_varent (ctf_dvdef_ref var) > /* Output the reference to the name in the string table. */ > dw2_asm_output_data (4, var->dvd_name_offset, "ctv_name"); > /* Output the type index. */ > - dw2_asm_output_data (4, var->dvd_type, "ctv_typeidx"); > + dw2_asm_output_data (4, ctf_type_id (var->dvd_type), "ctv_typeidx"); > } > > /* Asm'out a member of CTF struct or union, represented by ctf_lmember_t. */ > @@ -414,7 +417,7 @@ ctf_asm_sou_lmember (ctf_dmdef_t * dmd) > dw2_asm_output_data (4, dmd->dmd_name_offset, "ctlm_name"); > dw2_asm_output_data (4, CTF_OFFSET_TO_LMEMHI (dmd->dmd_offset), > "ctlm_offsethi"); > - dw2_asm_output_data (4, dmd->dmd_type, "ctlm_type"); > + dw2_asm_output_data (4, ctf_type_id (dmd->dmd_type), "ctlm_type"); > dw2_asm_output_data (4, CTF_OFFSET_TO_LMEMLO (dmd->dmd_offset), > "ctlm_offsetlo"); > } > @@ -426,7 +429,7 @@ ctf_asm_sou_member (ctf_dmdef_t * dmd) > { > dw2_asm_output_data (4, dmd->dmd_name_offset, "ctm_name"); > dw2_asm_output_data (4, dmd->dmd_offset, "ctm_offset"); > - dw2_asm_output_data (4, dmd->dmd_type, "ctm_type"); > + dw2_asm_output_data (4, ctf_type_id (dmd->dmd_type), "ctm_type"); > } > > /* Asm'out an enumerator constant. */ > @@ -443,7 +446,10 @@ ctf_asm_enum_const (ctf_dmdef_t * dmd) > static void > ctf_asm_func_arg (ctf_func_arg_t * farg) > { > - dw2_asm_output_data (4, farg->farg_type, "dtu_argv"); > + /* farg_type may be NULL, indicating varargs. */ > + dw2_asm_output_data (4, farg->farg_type > + ? ctf_type_id (farg->farg_type) > + : 0, "dtu_argv"); > } > > /* CTF writeout to asm file. */ > @@ -537,7 +543,7 @@ output_ctf_obj_info (ctf_container_ref ctfc) > var = ctfc->ctfc_gobjts_list[i]; > > /* CTF type ID corresponding to the type of the variable. */ > - dw2_asm_output_data (4, var->dvd_type, "objtinfo_var_type"); > + dw2_asm_output_data (4, ctf_type_id (var->dvd_type), "objtinfo_var_type"); > } > > } > diff --git a/gcc/dwarf2ctf.cc b/gcc/dwarf2ctf.cc > index 8f9e2fada9e3..a6c8541ef2b4 100644 > --- a/gcc/dwarf2ctf.cc > +++ b/gcc/dwarf2ctf.cc > @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see > > /* Forward declarations for some routines defined in this file. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_type (ctf_container_ref, dw_die_ref); > > /* All the DIE structures we handle come from the DWARF information > @@ -156,7 +156,7 @@ ctf_get_die_loc_col (dw_die_ref die) > > /* Generate CTF for the void type. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_void_type (ctf_container_ref ctfc) > { > ctf_encoding_t ctf_encoding = {0, 0, 0}; > @@ -174,10 +174,10 @@ gen_ctf_void_type (ctf_container_ref ctfc) > > /* Generate CTF type of unknown kind. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_unknown_type (ctf_container_ref ctfc) > { > - ctf_id_t unknown_type_id; > + ctf_dtdef_ref dtd; > > /* In CTF, the unknown type is encoded as a 0 byte sized type with kind > CTF_K_UNKNOWN. Create an encoding object merely to reuse the underlying > @@ -187,11 +187,11 @@ gen_ctf_unknown_type (ctf_container_ref ctfc) > > gcc_assert (ctf_unknown_die != NULL); > /* Type de-duplication. */ > - if (!ctf_type_exists (ctfc, ctf_unknown_die, &unknown_type_id)) > - unknown_type_id = ctf_add_unknown (ctfc, CTF_ADD_ROOT, "unknown", > - &ctf_encoding, ctf_unknown_die); > + if (!ctf_type_exists (ctfc, ctf_unknown_die, &dtd)) > + dtd = ctf_add_unknown (ctfc, CTF_ADD_ROOT, "unknown", > + &ctf_encoding, ctf_unknown_die); > > - return unknown_type_id; > + return dtd; > } > > /* Sizes of entities can be given in bytes or bits. This function > @@ -217,10 +217,10 @@ ctf_die_bitsize (dw_die_ref die) > Important: the caller of this API must make sure that duplicate types are > not added. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > { > - ctf_id_t type_id = CTF_NULL_TYPEID; > + ctf_dtdef_ref dtd = NULL; > > ctf_encoding_t ctf_encoding = {0, 0, 0}; > > @@ -236,8 +236,8 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > ctf_encoding.cte_bits = 0; > > gcc_assert (name_string); > - type_id = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > - &ctf_encoding, type); > + dtd = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > + &ctf_encoding, type); > > break; > case DW_ATE_boolean: > @@ -246,8 +246,8 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > ctf_encoding.cte_bits = bit_size; > > gcc_assert (name_string); > - type_id = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > - &ctf_encoding, type); > + dtd = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > + &ctf_encoding, type); > break; > case DW_ATE_float: > { > @@ -269,7 +269,7 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > break; > > ctf_encoding.cte_bits = bit_size; > - type_id = ctf_add_float (ctfc, CTF_ADD_ROOT, name_string, > + dtd = ctf_add_float (ctfc, CTF_ADD_ROOT, name_string, > &ctf_encoding, type); > > break; > @@ -291,7 +291,7 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > ctf_encoding.cte_format |= CTF_INT_SIGNED; > > ctf_encoding.cte_bits = bit_size; > - type_id = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > + dtd = ctf_add_integer (ctfc, CTF_ADD_ROOT, name_string, > &ctf_encoding, type); > break; > > @@ -315,7 +315,7 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > break; > > ctf_encoding.cte_bits = bit_size; > - type_id = ctf_add_float (ctfc, CTF_ADD_ROOT, name_string, > + dtd = ctf_add_float (ctfc, CTF_ADD_ROOT, name_string, > &ctf_encoding, type); > break; > } > @@ -324,41 +324,39 @@ gen_ctf_base_type (ctf_container_ref ctfc, dw_die_ref type) > break; > } > > - return type_id; > + return dtd; > } > > /* Generate CTF for a pointer type. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_pointer_type (ctf_container_ref ctfc, dw_die_ref ptr_type) > { > - ctf_id_t type_id = CTF_NULL_TYPEID; > - ctf_id_t ptr_type_id = CTF_NULL_TYPEID; > + ctf_dtdef_ref pointed_dtd, pointer_dtd; > dw_die_ref pointed_type_die = ctf_get_AT_type (ptr_type); > > - type_id = gen_ctf_type (ctfc, pointed_type_die); > + pointed_dtd = gen_ctf_type (ctfc, pointed_type_die); > > /* Type de-duplication. > Consult the ctfc_types hash again before adding the CTF pointer type > because there can be cases where a pointer type may have been added by > the gen_ctf_type call above. */ > - if (ctf_type_exists (ctfc, ptr_type, &ptr_type_id)) > - return ptr_type_id; > + if (!ctf_type_exists (ctfc, ptr_type, &pointer_dtd)) > + pointer_dtd = ctf_add_pointer (ctfc, CTF_ADD_ROOT, pointed_dtd, ptr_type); > > - ptr_type_id = ctf_add_pointer (ctfc, CTF_ADD_ROOT, type_id, ptr_type); > - return ptr_type_id; > + return pointer_dtd; > } > > /* Recursively generate CTF for array dimensions starting at DIE C (of type > DW_TAG_subrange_type) until DIE LAST (of type DW_TAG_subrange_type) is > reached. ARRAY_ELEMS_TYPE_ID is base type for the array. */ > This function-level comment needs updating. "ARRAY_ELEMS_TYPE_ID is ..." --> say, "ARRAY_ELEMS_TYPE is the CTF type for the type of the array elements.". > -static ctf_id_t > -gen_ctf_subrange_type (ctf_container_ref ctfc, ctf_id_t array_elems_type_id, > +static ctf_dtdef_ref > +gen_ctf_subrange_type (ctf_container_ref ctfc, ctf_dtdef_ref array_elems_type, > dw_die_ref c, dw_die_ref last) > { > ctf_arinfo_t arinfo; > - ctf_id_t array_node_type_id = CTF_NULL_TYPEID; > + ctf_dtdef_ref array_dtd; > > dw_attr_node *upper_bound_at; > dw_die_ref array_index_type; > @@ -398,30 +396,29 @@ gen_ctf_subrange_type (ctf_container_ref ctfc, ctf_id_t array_elems_type_id, > arinfo.ctr_index = gen_ctf_type (ctfc, array_index_type); > > if (c == last) > - arinfo.ctr_contents = array_elems_type_id; > + arinfo.ctr_contents = array_elems_type; > else > - arinfo.ctr_contents = gen_ctf_subrange_type (ctfc, array_elems_type_id, > + arinfo.ctr_contents = gen_ctf_subrange_type (ctfc, array_elems_type, > dw_get_die_sib (c), last); > > - if (!ctf_type_exists (ctfc, c, &array_node_type_id)) > - array_node_type_id = ctf_add_array (ctfc, CTF_ADD_ROOT, &arinfo, c); > + if (!ctf_type_exists (ctfc, c, &array_dtd)) > + array_dtd = ctf_add_array (ctfc, CTF_ADD_ROOT, &arinfo, c); > > - return array_node_type_id; > + return array_dtd; > } > > /* Generate CTF for an ARRAY_TYPE. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_array_type (ctf_container_ref ctfc, > dw_die_ref array_type) > { > dw_die_ref first, last, array_elems_type; > - ctf_id_t array_elems_type_id = CTF_NULL_TYPEID; > - ctf_id_t array_type_id = CTF_NULL_TYPEID; > + ctf_dtdef_ref array_dtd, elem_dtd; > > int vector_type_p = get_AT_flag (array_type, DW_AT_GNU_vector); > if (vector_type_p) > - return array_elems_type_id; > + return NULL; > > /* Find the first and last array dimension DIEs. */ > last = dw_get_die_child (array_type); > @@ -429,41 +426,36 @@ gen_ctf_array_type (ctf_container_ref ctfc, > > /* Type de-duplication. > Consult the ctfc_types before adding CTF type for the first dimension. */ > - if (!ctf_type_exists (ctfc, first, &array_type_id)) > + if (!ctf_type_exists (ctfc, first, &array_dtd)) > { > array_elems_type = ctf_get_AT_type (array_type); > /* First, register the type of the array elements if needed. */ > - array_elems_type_id = gen_ctf_type (ctfc, array_elems_type); > + elem_dtd = gen_ctf_type (ctfc, array_elems_type); > > - array_type_id = gen_ctf_subrange_type (ctfc, array_elems_type_id, first, > - last); > + array_dtd = gen_ctf_subrange_type (ctfc, elem_dtd, first, last); > } > > - return array_type_id; > + return array_dtd; > } > > /* Generate CTF for a typedef. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_typedef (ctf_container_ref ctfc, dw_die_ref tdef) > { > - ctf_id_t tdef_type_id, tid; > + ctf_dtdef_ref tdef_dtd, dtd; > const char *tdef_name = get_AT_string (tdef, DW_AT_name); > dw_die_ref tdef_type = ctf_get_AT_type (tdef); > > - tid = gen_ctf_type (ctfc, tdef_type); > + dtd = gen_ctf_type (ctfc, tdef_type); > > /* Type de-duplication. > This is necessary because the ctf for the typedef may have been already > added due to the gen_ctf_type call above. */ > - if (!ctf_type_exists (ctfc, tdef, &tdef_type_id)) > - { > - tdef_type_id = ctf_add_typedef (ctfc, CTF_ADD_ROOT, > - tdef_name, > - tid, > - tdef); > - } > - return tdef_type_id; > + if (!ctf_type_exists (ctfc, tdef, &tdef_dtd)) > + tdef_dtd = ctf_add_typedef (ctfc, CTF_ADD_ROOT, tdef_name, dtd, tdef); > + > + return tdef_dtd; > } > > /* Generate CTF for a type modifier. > @@ -475,11 +467,11 @@ gen_ctf_typedef (ctf_container_ref ctfc, dw_die_ref tdef) > For all other cases, this function returns a CTF_NULL_TYPEID; > */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_modifier_type (ctf_container_ref ctfc, dw_die_ref modifier) The function-level comment of this one needs updating. Also a stub in this function (not present in the diff below) has a "return CTF_NULL_TYPEID;". Changing it to return NULL; is better. > { > uint32_t kind = CTF_K_MAX; > - ctf_id_t modifier_type_id, qual_type_id; > + ctf_dtdef_ref dtd, modifier_dtd; > dw_die_ref qual_type = ctf_get_AT_type (modifier); > > switch (dw_get_die_tag (modifier)) > @@ -493,33 +485,31 @@ gen_ctf_modifier_type (ctf_container_ref ctfc, dw_die_ref modifier) > } > > /* Register the type for which this modifier applies. */ > - qual_type_id = gen_ctf_type (ctfc, qual_type); > + dtd = gen_ctf_type (ctfc, qual_type); > > /* Skip generating a CTF modifier record for _Atomic as there is no > representation for it. */ > if (dw_get_die_tag (modifier) == DW_TAG_atomic_type) > - return qual_type_id; > + return dtd; > > gcc_assert (kind != CTF_K_MAX); > /* Now register the modifier itself. */ > - if (!ctf_type_exists (ctfc, modifier, &modifier_type_id)) > - modifier_type_id = ctf_add_reftype (ctfc, CTF_ADD_ROOT, > - qual_type_id, kind, > - modifier); > + if (!ctf_type_exists (ctfc, modifier, &modifier_dtd)) > + modifier_dtd = ctf_add_reftype (ctfc, CTF_ADD_ROOT, dtd, kind, modifier); > > - return modifier_type_id; > + return modifier_dtd; > } > > /* Generate CTF for a struct type. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_sou_type (ctf_container_ref ctfc, dw_die_ref sou, uint32_t kind) > { > uint32_t bit_size = ctf_die_bitsize (sou); > int declaration_p = get_AT_flag (sou, DW_AT_declaration); > const char *sou_name = get_AT_string (sou, DW_AT_name); > > - ctf_id_t sou_type_id; > + ctf_dtdef_ref sou_dtd; > > /* An incomplete structure or union type is represented in DWARF by > a structure or union DIE that does not have a size attribute and > @@ -531,10 +521,10 @@ gen_ctf_sou_type (ctf_container_ref ctfc, dw_die_ref sou, uint32_t kind) > > /* This is a complete struct or union type. Generate a CTF type for > it if it doesn't exist already. */ > - if (!ctf_type_exists (ctfc, sou, &sou_type_id)) > - sou_type_id = ctf_add_sou (ctfc, CTF_ADD_ROOT, > - sou_name, kind, bit_size / 8, > - sou); > + if (!ctf_type_exists (ctfc, sou, &sou_dtd)) > + sou_dtd = ctf_add_sou (ctfc, CTF_ADD_ROOT, > + sou_name, kind, bit_size / 8, > + sou); > > /* Now process the struct members. */ > { > @@ -547,7 +537,7 @@ gen_ctf_sou_type (ctf_container_ref ctfc, dw_die_ref sou, uint32_t kind) > const char *field_name; > dw_die_ref field_type; > HOST_WIDE_INT field_location; > - ctf_id_t field_type_id; > + ctf_dtdef_ref field_dtd; > > c = dw_get_die_sib (c); > > @@ -556,7 +546,7 @@ gen_ctf_sou_type (ctf_container_ref ctfc, dw_die_ref sou, uint32_t kind) > field_location = ctf_get_AT_data_member_location (c); > > /* Generate the field type. */ > - field_type_id = gen_ctf_type (ctfc, field_type); > + field_dtd = gen_ctf_type (ctfc, field_type); > > /* If this is a bit-field, then wrap the field type > generated above with a CTF slice. */ > @@ -610,29 +600,29 @@ gen_ctf_sou_type (ctf_container_ref ctfc, dw_die_ref sou, uint32_t kind) > surely something to look at for the next format version bump > for CTF. */ > if (bitsize <= 255 && (bitpos - field_location) <= 255) > - field_type_id = ctf_add_slice (ctfc, CTF_ADD_NONROOT, > - field_type_id, > + field_dtd = ctf_add_slice (ctfc, CTF_ADD_NONROOT, > + field_dtd, > bitpos - field_location, > bitsize, c); > else > - field_type_id = gen_ctf_unknown_type (ctfc); > + field_dtd = gen_ctf_unknown_type (ctfc); > } > > /* Add the field type to the struct or union type. */ > ctf_add_member_offset (ctfc, sou, > field_name, > - field_type_id, > + field_dtd, > field_location); > } > while (c != dw_get_die_child (sou)); > } > > - return sou_type_id; > + return sou_dtd; > } > > /* Generate CTF for a function type. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > bool from_global_func) > { > @@ -643,17 +633,16 @@ gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > uint32_t num_args = 0; > int linkage = get_AT_flag (function, DW_AT_external); > > - ctf_id_t return_type_id; > - ctf_id_t function_type_id; > + ctf_dtdef_ref return_dtd, function_dtd; > > /* First, add the return type. */ > - return_type_id = gen_ctf_type (ctfc, return_type); > - func_info.ctc_return = return_type_id; > + return_dtd = gen_ctf_type (ctfc, return_type); > + func_info.ctc_return = return_dtd; > > /* Type de-duplication. > Consult the ctfc_types hash before adding the CTF function type. */ > - if (ctf_type_exists (ctfc, function, &function_type_id)) > - return function_type_id; > + if (ctf_type_exists (ctfc, function, &function_dtd)) > + return function_dtd; > > /* Do a first pass on the formals to determine the number of > arguments, and whether the function type gets a varargs. */ > @@ -681,12 +670,12 @@ gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > func_info.ctc_argc = num_args; > > /* Type de-duplication has already been performed by now. */ > - function_type_id = ctf_add_function (ctfc, CTF_ADD_ROOT, > - function_name, > - (const ctf_funcinfo_t *)&func_info, > - function, > - from_global_func, > - linkage); > + function_dtd = ctf_add_function (ctfc, CTF_ADD_ROOT, > + function_name, > + (const ctf_funcinfo_t *)&func_info, > + function, > + from_global_func, > + linkage); > > /* Second pass on formals: generate the CTF types corresponding to > them and add them as CTF function args. */ > @@ -694,7 +683,7 @@ gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > dw_die_ref c; > unsigned int i = 0; > const char *arg_name; > - ctf_id_t arg_type; > + ctf_dtdef_ref arg_type; > > c = dw_get_die_child (function); > if (c) > @@ -706,7 +695,7 @@ gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > { > gcc_assert (i == num_args - 1); > /* Add an argument with type 0 and no name. */ > - ctf_add_function_arg (ctfc, function, "", 0); > + ctf_add_function_arg (ctfc, function, "", NULL); > } > else if (dw_get_die_tag (c) == DW_TAG_formal_parameter) > { > @@ -723,12 +712,12 @@ gen_ctf_function_type (ctf_container_ref ctfc, dw_die_ref function, > while (c != dw_get_die_child (function)); > } > > - return function_type_id; > + return function_dtd; > } > > /* Generate CTF for an enumeration type. */ > > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_enumeration_type (ctf_container_ref ctfc, dw_die_ref enumeration) > { > const char *enum_name = get_AT_string (enumeration, DW_AT_name); > @@ -736,7 +725,7 @@ gen_ctf_enumeration_type (ctf_container_ref ctfc, dw_die_ref enumeration) > unsigned int signedness = get_AT_unsigned (enumeration, DW_AT_encoding); > int declaration_p = get_AT_flag (enumeration, DW_AT_declaration); > > - ctf_id_t enumeration_type_id; > + ctf_dtdef_ref enum_dtd; > > /* If this is an incomplete enum, generate a CTF forward for it and > be done. */ > @@ -756,10 +745,10 @@ gen_ctf_enumeration_type (ctf_container_ref ctfc, dw_die_ref enumeration) > } > > /* Generate a CTF type for the enumeration. */ > - enumeration_type_id = ctf_add_enum (ctfc, CTF_ADD_ROOT, > - enum_name, bit_size / 8, > - (signedness == DW_ATE_unsigned), > - enumeration); > + enum_dtd = ctf_add_enum (ctfc, CTF_ADD_ROOT, > + enum_name, bit_size / 8, > + (signedness == DW_ATE_unsigned), > + enumeration); > > /* Process the enumerators. */ > { > @@ -787,13 +776,13 @@ gen_ctf_enumeration_type (ctf_container_ref ctfc, dw_die_ref enumeration) > else > value_wide_int = AT_int (enumerator_value); > > - ctf_add_enumerator (ctfc, enumeration_type_id, > + ctf_add_enumerator (ctfc, enum_dtd, > enumerator_name, value_wide_int, enumeration); > } > while (c != dw_get_die_child (enumeration)); > } > > - return enumeration_type_id; > + return enum_dtd; > } > > /* Add a CTF variable record for the given input DWARF DIE. */ > @@ -804,7 +793,7 @@ gen_ctf_variable (ctf_container_ref ctfc, dw_die_ref die) > const char *var_name = get_AT_string (die, DW_AT_name); > dw_die_ref var_type = ctf_get_AT_type (die); > unsigned int external_vis = get_AT_flag (die, DW_AT_external); > - ctf_id_t var_type_id; > + ctf_dtdef_ref var_dtd; > > /* Avoid duplicates. */ > if (ctf_dvd_lookup (ctfc, die)) > @@ -822,11 +811,10 @@ gen_ctf_variable (ctf_container_ref ctfc, dw_die_ref die) > dw_die_ref decl = get_AT_ref (die, DW_AT_specification); > > /* Add the type of the variable. */ > - var_type_id = gen_ctf_type (ctfc, var_type); > + var_dtd = gen_ctf_type (ctfc, var_type); > > /* Generate the new CTF variable and update global counter. */ > - (void) ctf_add_variable (ctfc, var_name, var_type_id, die, external_vis, > - decl); > + (void) ctf_add_variable (ctfc, var_name, var_dtd, die, external_vis, decl); > /* Skip updating the number of global objects at this time. This is updated > later after pre-processing as some CTF variable records although > generated now, will not be emitted later. [PR105089]. */ > @@ -837,10 +825,10 @@ gen_ctf_variable (ctf_container_ref ctfc, dw_die_ref die) > static void > gen_ctf_function (ctf_container_ref ctfc, dw_die_ref die) > { > - ctf_id_t function_type_id; > + ctf_dtdef_ref function_dtd; > /* Type de-duplication. > Consult the ctfc_types hash before adding the CTF function type. */ > - if (ctf_type_exists (ctfc, die, &function_type_id)) > + if (ctf_type_exists (ctfc, die, &function_dtd)) > return; > > /* Add the type of the function and update the global functions > @@ -859,41 +847,41 @@ gen_ctf_function (ctf_container_ref ctfc, dw_die_ref die) > If the given DIE is not recognized as a type, then this function > returns CTF_NULL_TYPEID. */ > Update function-level comment: returns NULL. > -static ctf_id_t > +static ctf_dtdef_ref > gen_ctf_type (ctf_container_ref ctfc, dw_die_ref die) > { > - ctf_id_t type_id; > + ctf_dtdef_ref dtd = NULL; > int unrecog_die = false; > > - if (ctf_type_exists (ctfc, die, &type_id)) > - return type_id; > + if (ctf_type_exists (ctfc, die, &dtd)) > + return dtd; > > switch (dw_get_die_tag (die)) > { > case DW_TAG_base_type: > - type_id = gen_ctf_base_type (ctfc, die); > + dtd = gen_ctf_base_type (ctfc, die); > break; > case DW_TAG_pointer_type: > - type_id = gen_ctf_pointer_type (ctfc, die); > + dtd = gen_ctf_pointer_type (ctfc, die); > break; > case DW_TAG_typedef: > - type_id = gen_ctf_typedef (ctfc, die); > + dtd = gen_ctf_typedef (ctfc, die); > break; > case DW_TAG_array_type: > - type_id = gen_ctf_array_type (ctfc, die); > + dtd = gen_ctf_array_type (ctfc, die); > break; > case DW_TAG_structure_type: > - type_id = gen_ctf_sou_type (ctfc, die, CTF_K_STRUCT); > + dtd = gen_ctf_sou_type (ctfc, die, CTF_K_STRUCT); > break; > case DW_TAG_union_type: > - type_id = gen_ctf_sou_type (ctfc, die, CTF_K_UNION); > + dtd = gen_ctf_sou_type (ctfc, die, CTF_K_UNION); > break; > case DW_TAG_subroutine_type: > - type_id = gen_ctf_function_type (ctfc, die, > - false /* from_global_func */); > + dtd = gen_ctf_function_type (ctfc, die, > + false /* from_global_func */); > break; > case DW_TAG_enumeration_type: > - type_id = gen_ctf_enumeration_type (ctfc, die); > + dtd = gen_ctf_enumeration_type (ctfc, die); > break; > case DW_TAG_atomic_type: > /* FALLTHROUGH */ > @@ -902,35 +890,35 @@ gen_ctf_type (ctf_container_ref ctfc, dw_die_ref die) > case DW_TAG_restrict_type: > /* FALLTHROUGH */ > case DW_TAG_volatile_type: > - type_id = gen_ctf_modifier_type (ctfc, die); > + dtd = gen_ctf_modifier_type (ctfc, die); > break; > case DW_TAG_unspecified_type: > { > const char *name = get_AT_string (die, DW_AT_name); > > if (name && strcmp (name, "void") == 0) > - type_id = gen_ctf_void_type (ctfc); > + dtd = gen_ctf_void_type (ctfc); > else > - type_id = CTF_NULL_TYPEID; > + dtd = NULL; > > break; > } > case DW_TAG_reference_type: > - type_id = CTF_NULL_TYPEID; > + dtd = NULL; > break; > default: > /* Unrecognized DIE. */ > unrecog_die = true; > - type_id = CTF_NULL_TYPEID; > + dtd = NULL; > break; > } > > /* For all types unrepresented in CTF, use an explicit CTF type of kind > CTF_K_UNKNOWN. */ > - if ((type_id == CTF_NULL_TYPEID) && (!unrecog_die)) > - type_id = gen_ctf_unknown_type (ctfc); > + if ((dtd == NULL) && (!unrecog_die)) > + dtd = gen_ctf_unknown_type (ctfc); > > - return type_id; > + return dtd; > } > > bool > @@ -951,7 +939,7 @@ ctf_do_die (dw_die_ref die) > return false; > } > else > - return gen_ctf_type (tu_ctfc, die) == CTF_NULL_TYPEID; > + return (gen_ctf_type (tu_ctfc, die) == NULL); > } > > /* Initialize CTF subsystem for CTF debug info generation. */ > diff --git a/include/btf.h b/include/btf.h > index 24b38bace178..3f45ffb0b6bb 100644 > --- a/include/btf.h > +++ b/include/btf.h > @@ -56,6 +56,11 @@ struct btf_header > /* Maximum number of struct, union, enum members or func args. */ > #define BTF_MAX_VLEN 0xffff > > +/* Type ID 0 represents the void type. */ > +#define BTF_VOID_TYPEID 0 > +/* Initial type ID for regular types. */ > +#define BTF_INIT_TYPEID 1 > + > struct btf_type > { > uint32_t name_off; /* Offset in string section of type name. */