diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-03-09 17:16:35 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-09 18:18:35 +0000 |
commit | 049d0cba8ed274fb8fc67b4c343505bf06e9c57c (patch) | |
tree | 82db28c43dde6c02f4095ebd1e5ba46c7e345d4e /gcc/rust/backend/rust-compile-implitem.h | |
parent | 01898e7cf2746e4dae0bee81ff5adfc1c00ae635 (diff) | |
download | gcc-049d0cba8ed274fb8fc67b4c343505bf06e9c57c.zip gcc-049d0cba8ed274fb8fc67b4c343505bf06e9c57c.tar.gz gcc-049d0cba8ed274fb8fc67b4c343505bf06e9c57c.tar.bz2 |
Cleanup HIR::Function to make fields private
This is a refactoring/cleanup effort to stop using raw fields of
HIR::Items. It also removes an old set of locals since before the TyTy
module and move to HIR from the AST::Function.
Diffstat (limited to 'gcc/rust/backend/rust-compile-implitem.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-implitem.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-implitem.h b/gcc/rust/backend/rust-compile-implitem.h index 1b6651a..9370e9c 100644 --- a/gcc/rust/backend/rust-compile-implitem.h +++ b/gcc/rust/backend/rust-compile-implitem.h @@ -95,7 +95,7 @@ public: unsigned int flags = 0; std::string fn_identifier - = self->get_name () + "_" + function.function_name; + = self->get_name () + "_" + function.get_function_name (); // if its the main fn or pub visibility mark its as DECL_PUBLIC // please see https://github.com/Rust-GCC/gccrs/pull/137 @@ -116,7 +116,8 @@ public: size_t i = 0; for (auto &it : fntype->get_params ()) { - HIR::FunctionParam &referenced_param = function.function_params.at (i); + HIR::FunctionParam &referenced_param + = function.get_function_params ().at (i); auto param_tyty = it.second; auto compiled_param_type = TyTyResolveCompile::compile (ctx, param_tyty); @@ -147,7 +148,7 @@ public: } // lookup locals - auto block_expr = function.function_body.get (); + auto block_expr = function.get_definition ().get (); auto body_mappings = block_expr->get_mappings (); Resolver::Rib *rib = nullptr; @@ -180,7 +181,7 @@ public: Bblock *enclosing_scope = toplevel_item ? NULL : ctx->peek_enclosing_scope (); - HIR::BlockExpr *function_body = function.function_body.get (); + HIR::BlockExpr *function_body = function.get_definition ().get (); Location start_location = function_body->get_locus (); Location end_location = function_body->get_closing_locus (); @@ -206,7 +207,7 @@ public: ctx->push_fn (fndecl, return_address); - compile_function_body (fndecl, function.function_body, + compile_function_body (fndecl, function.get_definition (), function.has_function_return_type ()); ctx->pop_block (); |