From f14cbab89d7a3678dd6c3b2f4a1102b4e6e95cf8 Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Mon, 4 Sep 2023 16:13:31 -0400 Subject: gccrs: Convert class Backend into namespace gcc/rust/ChangeLog: * rust-backend.h (class Backend): Convert to ... (namespace Backend): ... namespace. * rust-gcc.cc (Backend::Backend): Rename to ... (Backend::init): ... here. (rust_get_backend): Remove. * rust-session-manager.cc (rust_get_backend): Remove. (Session::init): Use Backend::init instead of rust_get_backend. (Session::compile_crate): Initialize Context without pointer to Backend. * rust-session-manager.h (Session::backend): Remove. * backend/rust-compile-context.cc (Context::Context): Remove pointer to Backend. * backend/rust-compile-context.h (class Context): Remove pointer to Backend, update function calls. * backend/rust-compile-base.cc: Update function calls. * backend/rust-compile-block.cc: Likewise. * backend/rust-compile-expr.cc: Likewise. * backend/rust-compile-extern.h: Likewise. * backend/rust-compile-fnparam.cc: Likewise. * backend/rust-compile-intrinsic.cc: Likewise. * backend/rust-compile-item.cc: Likewise. * backend/rust-compile-pattern.cc: Likewise. * backend/rust-compile-resolve-path.cc: Likewise. * backend/rust-compile-type.cc: Likewise. * backend/rust-compile-var-decl.h: Likewise. * backend/rust-compile.cc: Likewise. Signed-off-by: Owen Avery --- gcc/rust/rust-gcc.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'gcc/rust/rust-gcc.cc') diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 083add4..1aca71f 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -99,7 +99,8 @@ get_identifier_from_string (const std::string &str) // Define the built-in functions that are exposed to GCCRust. -Backend::Backend () +void +Backend::init () { /* We need to define the fetch_and_add functions, since we use them for ++ and --. */ @@ -2468,11 +2469,3 @@ Backend::write_global_definitions ( delete[] defs; } - -// Return the backend generator. - -Backend * -rust_get_backend () -{ - return new Backend (); -} -- cgit v1.1