From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sender4-pp-o91.zoho.com (sender4-pp-o91.zoho.com [136.143.188.91]) by sourceware.org (Postfix) with ESMTPS id 3D3DD3858D38; Mon, 22 Apr 2024 13:13:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D3DD3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=zoho.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zoho.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3D3DD3858D38 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=136.143.188.91 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713791614; cv=pass; b=qZJlWaRFha9x0XvRpE13ndpljZz/RPIU6EirA0kQEIgdxWTCu4qy5Zwv1YiZoc1FYoqI3yWkE+dQlKNW6gqR8tlkCd8WnzQZ8d+jpEbGj8jrXS3fw0lW9DFzstEZofA0299HBp3b84Py1Sg7gu0LhyUT8H7GsHAIsnMV9LgHIt4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713791614; c=relaxed/simple; bh=dIwd2iesxqb347ycwqtOE7vi+iuV/FY5kRUvHAM/99o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=YSgxYQwALSNwbXBLAhSkJAY0c/BmAx40rq6x+CLj5Ws62/8rjdLAzF/mLKPY+G5tQXRNF/4fXyFvkWWFT+9W8Em7VGojm7sOg+2M9ENBi6VVeAmetfwCY/OmdIrpss1TgVons2SKMZe9MSR2tTyVij6ub/A6eUAR0LsalVPN7Og= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1713791606; cv=none; d=zohomail.com; s=zohoarc; b=H7uI3wt5ELh/JxUwp7KQe7Zmzy0/0sD2P1+Chd2YHAh+1jcDxEj/dFfMFhPq6UXvFm5v+A6LfsW9zAp8pR5E/oT/9pwWh8H4XrHtWdnLKItgwtxmgqxeAyRRAVWDf/DQQdqcMlFEKgwv840YAmg30PsirUZNp9WDsOcjoEfw+xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713791606; 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=ExS/JLEJpcARamAFkkcFKB2+GPLLaZoZ0N8QhDHJlZU=; b=dBzTwG9ZV8RaDc0IAcFM96Ys5eQ8DD5dKTqrK77o6kANmfuRlVpVBBHbtMkQ/ZjJ4r5oi6m/Ff+2VvZoEmWuoOR56Zs8vC7J74hhJNqdbLdfhEB1Bt1uuiKH3fSjswmD4AKqnYpX1ES1P69bR2DOcjpfU9Q27Z84if2TZNN5sI4= 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=1713791606; 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=ExS/JLEJpcARamAFkkcFKB2+GPLLaZoZ0N8QhDHJlZU=; b=BQuxfQhA4CWr7OIiH7Te1Se7tyrx7vlXglbGGe3EaXmVIOKBF8PSCx+qzeC9trmb 3UNpDmEPEBbUrbtnUqhbx4F9BCuOqwn9WDIi8qZ3d4x3nmu83sL16bqfpRlTLNwHIDM JK7QY9twWTs7IgNM6iwZT6cSh0Q0n1HPe0O8JnYI= Received: by mx.zohomail.com with SMTPS id 1713791604383236.93727576173546; Mon, 22 Apr 2024 06:13:24 -0700 (PDT) Message-ID: Date: Mon, 22 Apr 2024 09:13:23 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add rvalue::get_name method (and its C equivalent) To: Guillaume Gomez , Arthur Cohen Cc: 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: rr0801122885f97a9098a70f5f33820bad00004e8b7de2b37ffd30169f9d068b8fb08875e7b295ea4bedf8b4f2:zu08011226d3eb840e6e45ebcf176c85e70000cc01f3ecadd70a61752e1c2f6fb448320343bb66773ff593:rf08011226b098fc4f7ff16161d2db1aa2000018c7187c75394717ef50255d578b31a0762c8e1eb92a7902:ZohoMail X-ZohoMailClient: External X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: 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