From 0d678b209df6a6ad6456ced2bd8c9aa0fa547b5f Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Wed, 2 Aug 2023 15:51:38 -0400 Subject: Move Backend::error_variable to Bvariable::error_variable gcc/rust/ChangeLog: * rust-backend.h (Backend::error_variable): Remove. (Gcc_backend::error_variable): Move to ... * rust-gcc.cc (Bvariable::error_variable): ... here ... * rust-gcc.h (Bvariable::error_variable): ... and declare here. (Gcc_backend::global_variable): Update error_variable call. (Gcc_backend::local_variable): Likewise. (Gcc_backend::parameter_variable): Likewise. (Gcc_backend::static_chain_variable): Likewise. (Gcc_backend::temporary_variable): Likewise. * backend/rust-compile-extern.h (CompileExternItem::visit): Likewise. * backend/rust-compile-fnparam.cc (CompileFnParam::CompileFnParam): Likewise. Signed-off-by: Owen Avery --- gcc/rust/backend/rust-compile-extern.h | 2 +- gcc/rust/backend/rust-compile-fnparam.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/rust/backend') diff --git a/gcc/rust/backend/rust-compile-extern.h b/gcc/rust/backend/rust-compile-extern.h index 54bd410..582cceb 100644 --- a/gcc/rust/backend/rust-compile-extern.h +++ b/gcc/rust/backend/rust-compile-extern.h @@ -48,7 +48,7 @@ public: void visit (HIR::ExternalStaticItem &item) override { // check if its already been compiled - Bvariable *lookup = ctx->get_backend ()->error_variable (); + Bvariable *lookup = Bvariable::error_variable (); if (ctx->lookup_var_decl (item.get_mappings ().get_hirid (), &lookup)) { reference = ctx->get_backend ()->var_expression (lookup, ref_locus); diff --git a/gcc/rust/backend/rust-compile-fnparam.cc b/gcc/rust/backend/rust-compile-fnparam.cc index 48f317f..de0096c 100644 --- a/gcc/rust/backend/rust-compile-fnparam.cc +++ b/gcc/rust/backend/rust-compile-fnparam.cc @@ -27,7 +27,7 @@ namespace Compile { CompileFnParam::CompileFnParam (Context *ctx, tree fndecl, tree decl_type, location_t locus) : HIRCompileBase (ctx), fndecl (fndecl), decl_type (decl_type), locus (locus), - compiled_param (ctx->get_backend ()->error_variable ()) + compiled_param (Bvariable::error_variable ()) {} Bvariable * -- cgit v1.1