public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <botcazou@adacore.com>
To: Philip Herron <philip.herron@embecosm.com>
Cc: gcc Mailing List <gcc@gcc.gnu.org>, gcc-rust@gcc.gnu.org
Subject: Re: qual_union_type help
Date: Wed, 23 Feb 2022 19:19:18 +0100	[thread overview]
Message-ID: <2292069.NG923GbCHz@fomalhaut> (raw)
In-Reply-To: <CAB2u+n3dx2HH=m2DGzZS9B1VSx06OSEL4sNN=h7gUf9mztJPuA@mail.gmail.com>

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

Ultimately all PLACEHOLDER_EXPRs need to be replaced by something in the code, 
i.e. they can only survive in (abstract) types.  There is an entire machinery 
in tree.c for that, called both from the front-end and middle-end in Ada.  You 
can replace it with an explicit value (SUBSTITUTE_IN_EXPR) or you can search 
for it in an object (SUBSTITUTE_PLACEHOLDER_IN_EXPR).  You can presumably do 
it through the gimplification hook.

-- 
Eric Botcazou



      reply	other threads:[~2022-02-23 18:19 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
2022-02-23 18:19     ` Eric Botcazou [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=2292069.NG923GbCHz@fomalhaut \
    --to=botcazou@adacore.com \
    --cc=gcc-rust@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=philip.herron@embecosm.com \
    /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).