public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
To: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
Cc: jit@gcc.gnu.org
Subject: Re: Reflection for unions
Date: Wed, 15 Dec 2021 09:49:07 +0100	[thread overview]
Message-ID: <CAEYrNrTB1WADjp+FOiY6ResAu7CnFKjCSUsPjWbZ=c+08kFk5g@mail.gmail.com> (raw)
In-Reply-To: <CAEYrNrTvLT+HRiVWkVrx28gekaZxg6zhEs6e8Y-zLLt_S635mw@mail.gmail.com>

PS This is also related to the question of how to forward-declare a union
in libgccjit as in:

union foo;

struct bar
{
  union foo *ptr;
};

union foo
{
  struct bar *bar;
};

Currently, one can solve this problem by wrapping the union in a
one-field-struct but this is inconvenient and possibly makes optimization
more difficult.

Am So., 12. Dez. 2021 um 20:53 Uhr schrieb Marc Nieper-Wißkirchen <
marc.nieper+gnu@gmail.com>:

> We have structs and unions in libgccjit. While structs have their own
> internal type, gcc_jit_struct, this doesn't seem to be the case for unions.
> This makes me wonder whether reflection is possible for union types. For
> structs, we have, for example, gcc_jit_struct_get_field.
>
> What is the reason for the different treatment of structs and unions?
>
> Thanks,
>
> Marc
>

      reply	other threads:[~2021-12-15  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 19:53 Marc Nieper-Wißkirchen
2021-12-15  8:49 ` Marc Nieper-Wißkirchen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEYrNrTB1WADjp+FOiY6ResAu7CnFKjCSUsPjWbZ=c+08kFk5g@mail.gmail.com' \
    --to=marc.nieper+gnu@gmail.com \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).