From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id 63B1B3858D3C; Mon, 22 Apr 2024 15:38:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63B1B3858D3C Authentication-Results: sourceware.org; dmarc=fail (p=reject dis=none) header.from=zoho.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=zoho.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 63B1B3858D3C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=209.51.188.92 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713800283; cv=pass; b=flg211pypq7tFwegXS/zOBEDdGF+cjgkFHf3nOnYccystB2Na+0pJz6bzj3tvMPgCWGKjf3es6trDYWaxOvNNoRChJGCXWuWuhXcPKZ8N1Ohn3OkpLK8lXlldcg4jVDVKqGHpXC8fX051BLSyTwBYGhbqhJNiP3y0NhcVeXr6tk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713800283; c=relaxed/simple; bh=v53QHFLbDhTIHXZLz5n7zs3ft66ChlNrsVoLmLLTpWE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=oW+v1MpL5j0+yD0yIWcPdZy0IVnFNASWh7QmwNLAuItgRVk2bYeKbFZVqT/r0DwGW7Ft3t6p1TDI60Unz461Mg4lXDxrB0HBXDutci8kyAJmb8S7wAXyJTgQvLnWUhbmQ5uvRYP/QCXH9lQjtqjb+Lru5vNXalEtjWQ/Vg7vHuY= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from sender4-pp-o91.zoho.com ([136.143.188.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryvTl-0000yU-2O; Mon, 22 Apr 2024 11:21:15 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1713799183; cv=none; d=zohomail.com; s=zohoarc; b=RlafEU/zYIb813VH3OY0dlV0zSqqdVWCQ6QJs7EarqFqsdqdiXAMGqe3FkYnp6X4CN3oz4oPePhio7icANXwH2DuzWLRcr790BPSsl/6yxVn3GmfKHH1fNeSZ/wwLsVIxdIxXNYytI1HI+i7Ny7WcNaCOYnMFdLD/NGUFnI5lro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713799183; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=5HiyauHE1vUtVlb+/qRdcRt0YkH+Rn/yaeZkq2mySJU=; b=NdqfyS+3GJgmaAojA0HBO/PIerxZPCCZTI0y2O/bKLcsu+9a1nECJfq5GCIc3XFPAUQKGA4Of6OT2tAeswrMcNne+QTUVOX8V/a3RvgRE7Sl7DB/n/gBbQttV7N6sJhOjZynkIw+t10QtGUAhDeEoEy0FEmHp+6/woq3cbxPjOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=bouanto@zoho.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1713799183; s=zm2022; d=zoho.com; i=bouanto@zoho.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID:Message-Id:Reply-To; bh=5HiyauHE1vUtVlb+/qRdcRt0YkH+Rn/yaeZkq2mySJU=; b=gvj3W2Co7cvoNlIcYwiAkiuY/9HWsQsxaSUny5TLWzfiZ/jd0BKeFQKaTxOIYm7F xvgGIVNIl01+NWq71F6A0dN6P9lwVrUtoCjdP0ZgCwYrcYtb2g73vQTqMWbwXbPZYZz 62eEe9Hw6qWGZc8/EJb0B8zqvsNUVRYNLogy+eLU= Received: by mx.zohomail.com with SMTPS id 1713799181953239.21971591828924; Mon, 22 Apr 2024 08:19:41 -0700 (PDT) Message-ID: <1c705ee1-ada7-4a93-9e8a-c17b68e66331@zoho.com> Date: Mon, 22 Apr 2024 11:19:40 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add rvalue::get_name method (and its C equivalent) To: Guillaume Gomez Cc: Arthur Cohen , gcc-patches@gcc.gnu.org, jit@gcc.gnu.org, David Malcolm References: <7346764f-bf4d-4075-8191-671201f6f8da@embecosm.com> Content-Language: en-US, fr From: Antoni Boucher In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Feedback-ID: rr08011228aca2aed0eb6862431304d2ca00006d9476f5b2df634cda162f0723fa6c6a747e1aa14c15ef08f4b4:zu080112260395c931c1f00e259d59ce020000afb09cbbb3ce3c186ddaa8d6e4ef548da3b2e987b241cba1:rf08011226d438e802ce8dd463bb66a70e00003a7b7703b7729ba775e948934cfa36229efa108bb6ed895e:ZohoMail X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.91; envelope-from=bouanto@zoho.com; helo=sender4-pp-o91.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,FREEMAIL_FROM=0.001,RCVD_IN_DNSWL_NONE=-0.0001,RCVD_IN_MSPIKE_H2=-0.001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_FAIL,SPF_HELO_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: For your new API endpoint, please add a check like: RETURN_IF_FAIL (lvalue->is_global () || lvalue->is_local (), NULL, NULL, "lvalue should be a variable"); Le 2024-04-22 à 09 h 16, Guillaume Gomez a écrit : > Good point! > > New patch attached. > > Le lun. 22 avr. 2024 à 15:13, Antoni Boucher a écrit : >> >> Please move the function to be on lvalue since there are no rvalue types >> that are not lvalues that have a name. >> >> Le 2024-04-22 à 09 h 04, Guillaume Gomez a écrit : >>> Hey Arthur :) >>> >>>> Is there any reason for that getter to return a mutable pointer to the >>>> name? Would something like this work instead if you're just looking at >>>> getting the name? >>>> >>>> + virtual string * get_name () const { return NULL; } >>>> >>>> With of course adequate modifications to the inheriting classes. >>> >>> Good catch, thanks! >>> >>> Updated the patch and attached the new version to this email. >>> >>> Cordially. >>> >>> Le lun. 22 avr. 2024 à 11:51, Arthur Cohen a écrit : >>>> >>>> Hey Guillaume :) >>>> >>>> On 4/20/24 01:05, Guillaume Gomez wrote: >>>>> Hi, >>>>> >>>>> I just encountered the need to retrieve the name of an `rvalue` (if >>>>> there is one) while working on the Rust GCC backend. >>>>> >>>>> This patch adds a getter to retrieve the information. >>>>> >>>>> Cordially. >>>> >>>>> virtual bool get_wide_int (wide_int *) const { return false; } >>>>> >>>>> + virtual string * get_name () { return NULL; } >>>>> + >>>>> private: >>>>> virtual enum precedence get_precedence () const = 0; >>>> >>>> Is there any reason for that getter to return a mutable pointer to the >>>> name? Would something like this work instead if you're just looking at >>>> getting the name? >>>> >>>> + virtual string * get_name () const { return NULL; } >>>> >>>> With of course adequate modifications to the inheriting classes. >>>> >>>> Best, >>>> >>>> Arthur