diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-09-04 16:13:31 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:35 +0100 |
commit | f14cbab89d7a3678dd6c3b2f4a1102b4e6e95cf8 (patch) | |
tree | 871c5c33c8804374cdb9095e28bc9dca40ddd821 /gcc/rust/rust-session-manager.cc | |
parent | fc024ea79deb5a9ec3cfd68b59719bef52db49ff (diff) | |
download | gcc-f14cbab89d7a3678dd6c3b2f4a1102b4e6e95cf8.zip gcc-f14cbab89d7a3678dd6c3b2f4a1102b4e6e95cf8.tar.gz gcc-f14cbab89d7a3678dd6c3b2f4a1102b4e6e95cf8.tar.bz2 |
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 <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 9ce2d7f..7c4a76f 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -59,9 +59,6 @@ saw_errors (void); extern Linemap * rust_get_linemap (); -extern Backend * -rust_get_backend (); - namespace Rust { const char *kLexDumpFile = "gccrs.lex.dump"; @@ -167,7 +164,7 @@ Session::init () linemap = rust_get_linemap (); // setup backend to GCC GIMPLE - backend = rust_get_backend (); + Backend::init (); // setup mappings class mappings = Analysis::Mappings::get (); @@ -670,7 +667,7 @@ Session::compile_crate (const char *filename) return; // do compile to gcc generic - Compile::Context ctx (backend); + Compile::Context ctx; Compile::CompileCrate::Compile (hir, &ctx); // we can't do static analysis if there are errors to worry about |