[PATCH] Add rvalue::get_name method (and its C equivalent)

Guillaume Gomez guillaume1.gomez@gmail.com
Mon Apr 22 13:04:48 GMT 2024


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 <arthur.cohen@embecosm.com> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PATCH-Add-rvalue-get_name-method.patch
Type: text/x-patch
Size: 4360 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/jit/attachments/20240422/7dcdc924/attachment.bin>


More information about the Jit mailing list