diff options
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index fcbfc05..9e2c5b3 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -82,10 +82,8 @@ CompileBlock::visit (HIR::BlockExpr &expr) auto compiled_expr = CompileStmt::Compile (s.get (), ctx); if (compiled_expr != nullptr) { - tree compiled_stmt - = ctx->get_backend ()->expression_statement (fnctx.fndecl, - compiled_expr); - ctx->add_statement (compiled_stmt); + tree s = convert_to_void (compiled_expr, ICV_STATEMENT); + ctx->add_statement (s); } } @@ -98,10 +96,7 @@ CompileBlock::visit (HIR::BlockExpr &expr) { if (result == nullptr) { - tree final_stmt - = ctx->get_backend ()->expression_statement (fnctx.fndecl, - compiled_expr); - ctx->add_statement (final_stmt); + ctx->add_statement (compiled_expr); } else { @@ -109,8 +104,7 @@ CompileBlock::visit (HIR::BlockExpr &expr) result, expr.get_final_expr ()->get_locus ()); tree assignment - = ctx->get_backend ()->assignment_statement (fnctx.fndecl, - result_reference, + = ctx->get_backend ()->assignment_statement (result_reference, compiled_expr, expr.get_locus ()); ctx->add_statement (assignment); |