public inbox for
 help / color / mirror / Atom feed
From: Philip Herron <>
To: Eric Botcazou <>
Cc: gcc Mailing List <>,
Subject: Re: qual_union_type help
Date: Wed, 23 Feb 2022 17:44:59 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <4169450.ejJDZkT8p0@fomalhaut>

Hi Eric,

That makes sense during construction we also know what the value of
the discriminant is. What does the Ada front-end replace the
placeholder_exprs with? Can it simply be the value of the discriminant
at constructor? I haven't tried that.



On Wed, 23 Feb 2022 at 17:33, Eric Botcazou <> wrote:
> > This makes sense this we can't gimplify a placeholder expression. So
> > this seems that when i make a constructor for the QUAL_UNION_TYPE i
> > must iterate the fields and replace the placeholder_expr to have a
> > reference to the discriminant via another COMPONENT_REF. Though does
> > this mean for the constructor i will need to create a temporary to
> > hold onto it to create another component_ref?
> The Ada compiler gets rid of all PLACEHOLDER_EXPRs in CONSTRUCTORs because the
> subtype of these CONSTRUCTORs is always constrained in Ada parlance, i.e. you
> know the value of the discriminant since it is assigned in the CONSTRUCTOR, so
> the gimplifier is indeed presumably not wired to eliminate them on its own.
> --
> Eric Botcazou

  reply	other threads:[~2022-02-23 17:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 15:50 Philip Herron
2022-02-23 17:33 ` Eric Botcazou
2022-02-23 17:44   ` Philip Herron [this message]
2022-02-23 18:19     ` Eric Botcazou

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \

* 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).