aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-08-31 13:21:19 +0000
committerGitHub <noreply@github.com>2022-08-31 13:21:19 +0000
commitceb43210f8a6dfec98f634c326964328d1247f57 (patch)
tree5efa5f7aa3960f67a1ecde67febf9a99760f7a18 /gcc/rust/backend/rust-compile-expr.h
parent9b210f1c544ce4b0a4ff330c1e93d3ee83785484 (diff)
parent5acb1375c9c57b4cc0af13f4ccea0d609942bc0a (diff)
downloadgcc-ceb43210f8a6dfec98f634c326964328d1247f57.zip
gcc-ceb43210f8a6dfec98f634c326964328d1247f57.tar.gz
gcc-ceb43210f8a6dfec98f634c326964328d1247f57.tar.bz2
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>
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
0 files changed, 0 insertions, 0 deletions