aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-08-25 14:46:32 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-08-31 14:08:59 +0100
commit5acb1375c9c57b4cc0af13f4ccea0d609942bc0a (patch)
tree8c5b9897d722ceeda70495ec3a0badd9dec2ee85 /gcc/rust/backend/rust-compile-expr.h
parentb1cf3a384d41fa34c1eb819696e66fa65625d8db (diff)
downloadgcc-5acb1375c9c57b4cc0af13f4ccea0d609942bc0a.zip
gcc-5acb1375c9c57b4cc0af13f4ccea0d609942bc0a.tar.gz
gcc-5acb1375c9c57b4cc0af13f4ccea0d609942bc0a.tar.bz2
Create canonical process of compiling constant items
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.
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
0 files changed, 0 insertions, 0 deletions