aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile.cc
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2021-11-15 10:12:20 -0800
committerDavid Faust <david.faust@oracle.com>2021-11-16 13:15:54 -0800
commita4e5aee5863c7d898ee640296bc837e0baa8e796 (patch)
treef40c90287ae41fa3689cdc38d4bb021fb6cc8394 /gcc/rust/backend/rust-compile.cc
parent95048daaffa5e16df4d663702fe80294eac7b85e (diff)
downloadgcc-a4e5aee5863c7d898ee640296bc837e0baa8e796.zip
gcc-a4e5aee5863c7d898ee640296bc837e0baa8e796.tar.gz
gcc-a4e5aee5863c7d898ee640296bc837e0baa8e796.tar.bz2
Replace Bblock with GCC tree
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r--gcc/rust/backend/rust-compile.cc28
1 files changed, 11 insertions, 17 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 71435f3..579b323 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -338,10 +338,9 @@ CompileBlock::visit (HIR::BlockExpr &expr)
bool ok = compile_locals_for_block (*rib, fndecl, locals);
rust_assert (ok);
- Bblock *enclosing_scope = ctx->peek_enclosing_scope ();
- Bblock *new_block
- = ctx->get_backend ()->block (fndecl, enclosing_scope, locals,
- start_location, end_location);
+ tree enclosing_scope = ctx->peek_enclosing_scope ();
+ tree new_block = ctx->get_backend ()->block (fndecl, enclosing_scope, locals,
+ start_location, end_location);
ctx->push_block (new_block);
for (auto &s : expr.get_statements ())
@@ -395,8 +394,7 @@ CompileConditionalBlocks::visit (HIR::IfExpr &expr)
fncontext fnctx = ctx->peek_fn ();
tree fndecl = fnctx.fndecl;
tree condition_expr = CompileExpr::Compile (expr.get_if_condition (), ctx);
- Bblock *then_block
- = CompileBlock::compile (expr.get_if_block (), ctx, result);
+ tree then_block = CompileBlock::compile (expr.get_if_block (), ctx, result);
translated
= ctx->get_backend ()->if_statement (fndecl, condition_expr, then_block,
@@ -409,10 +407,8 @@ CompileConditionalBlocks::visit (HIR::IfExprConseqElse &expr)
fncontext fnctx = ctx->peek_fn ();
tree fndecl = fnctx.fndecl;
tree condition_expr = CompileExpr::Compile (expr.get_if_condition (), ctx);
- Bblock *then_block
- = CompileBlock::compile (expr.get_if_block (), ctx, result);
- Bblock *else_block
- = CompileBlock::compile (expr.get_else_block (), ctx, result);
+ tree then_block = CompileBlock::compile (expr.get_if_block (), ctx, result);
+ tree else_block = CompileBlock::compile (expr.get_else_block (), ctx, result);
translated
= ctx->get_backend ()->if_statement (fndecl, condition_expr, then_block,
@@ -425,17 +421,15 @@ CompileConditionalBlocks::visit (HIR::IfExprConseqIf &expr)
fncontext fnctx = ctx->peek_fn ();
tree fndecl = fnctx.fndecl;
tree condition_expr = CompileExpr::Compile (expr.get_if_condition (), ctx);
- Bblock *then_block
- = CompileBlock::compile (expr.get_if_block (), ctx, result);
+ tree then_block = CompileBlock::compile (expr.get_if_block (), ctx, result);
// else block
std::vector<Bvariable *> locals;
Location start_location = expr.get_conseq_if_expr ()->get_locus ();
Location end_location = expr.get_conseq_if_expr ()->get_locus (); // FIXME
- Bblock *enclosing_scope = ctx->peek_enclosing_scope ();
- Bblock *else_block
- = ctx->get_backend ()->block (fndecl, enclosing_scope, locals,
- start_location, end_location);
+ tree enclosing_scope = ctx->peek_enclosing_scope ();
+ tree else_block = ctx->get_backend ()->block (fndecl, enclosing_scope, locals,
+ start_location, end_location);
ctx->push_block (else_block);
tree else_stmt_decl
@@ -610,7 +604,7 @@ HIRCompileBase::coerce_to_dyn_object (tree compiled_ref,
locus);
fncontext fnctx = ctx->peek_fn ();
- Bblock *enclosing_scope = ctx->peek_enclosing_scope ();
+ tree enclosing_scope = ctx->peek_enclosing_scope ();
bool is_address_taken = false;
tree ret_var_stmt = NULL_TREE;