public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1505
@ 2022-08-31 14:10 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-08-31 14:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ceb43210f8a6dfec98f634c326964328d1247f57

commit ceb43210f8a6dfec98f634c326964328d1247f57
Merge: 9b210f1c544 5acb1375c9c
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Wed Aug 31 13:21:19 2022 +0000

    Merge #1505
    
    1505: Create canonical process of compiling constant items r=philberty a=philberty
    
    In order to compile a block expression constant, the simplest way for us
    was to reuse what code we have and to generate an artifical function which
    does not get added to the translation unit. The constant then becomes
    a CALL_EXPR to this artifical function which we can pass to the constexpr
    evaluator to resolve the result of this artifical 'CALL_EXPR'.
    
    Before this patch we seperated the difference between block expressions
    and non block expressions in constants. So for non block expressions we
    simply compiled them as if it was a simple constant but this is not
    guaranteed to be the case in rust, for example coercion sites can generate
    temporaries during autoderef which we let the constant evaluator resolve
    for us. This makes all constants handled in the same way to simplify the
    logic here.
    
    Co-authored-by: Philip Herron <philip.herron@embecosm.com>

Diff:

 gcc/rust/backend/rust-compile-base.cc | 103 ++++++++++++++++++----------------
 gcc/rust/backend/rust-tree.cc         |  22 +-------
 2 files changed, 56 insertions(+), 69 deletions(-)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-31 14:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 14:10 [gcc/devel/rust/master] Merge #1505 Thomas Schwinge

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