diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-08-02 15:51:38 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:00:28 +0100 |
commit | 77fbe55f8e68a2fbdff00500faec32f85e8c6d74 (patch) | |
tree | 66c3e79cf180e2e4a08a4ffaa504516d3072bfbb /gcc/rust/rust-gcc.cc | |
parent | 79b52e69569552551abbcb8ee1436c819bce3979 (diff) | |
download | gcc-77fbe55f8e68a2fbdff00500faec32f85e8c6d74.zip gcc-77fbe55f8e68a2fbdff00500faec32f85e8c6d74.tar.gz gcc-77fbe55f8e68a2fbdff00500faec32f85e8c6d74.tar.bz2 |
gccrs: 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 <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
-rw-r--r-- | gcc/rust/rust-gcc.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 673ddaa..5f9dbfe 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -77,6 +77,12 @@ Bvariable::get_tree (location_t location) const return build_fold_indirect_ref_loc (location, t); } +Bvariable * +Bvariable::error_variable () +{ + return new Bvariable (error_mark_node); +} + // This file implements the interface between the Rust frontend proper // and the gcc IR. This implements specific instantiations of // abstract classes defined by the Rust frontend proper. The Rust @@ -2048,7 +2054,7 @@ Gcc_backend::global_variable (const std::string &var_name, bool in_unique_section, location_t location) { if (type_tree == error_mark_node) - return this->error_variable (); + return Bvariable::error_variable (); // The GNU linker does not like dynamic variables with zero size. tree orig_type_tree = type_tree; @@ -2113,7 +2119,7 @@ Gcc_backend::local_variable (tree function, const std::string &name, location_t location) { if (type_tree == error_mark_node) - return this->error_variable (); + return Bvariable::error_variable (); tree decl = build_decl (location, VAR_DECL, get_identifier_from_string (name), type_tree); DECL_CONTEXT (decl) = function; @@ -2134,7 +2140,7 @@ Gcc_backend::parameter_variable (tree function, const std::string &name, tree type_tree, location_t location) { if (type_tree == error_mark_node) - return this->error_variable (); + return Bvariable::error_variable (); tree decl = build_decl (location, PARM_DECL, get_identifier_from_string (name), type_tree); DECL_CONTEXT (decl) = function; @@ -2151,7 +2157,7 @@ Gcc_backend::static_chain_variable (tree fndecl, const std::string &name, tree type_tree, location_t location) { if (type_tree == error_mark_node) - return this->error_variable (); + return Bvariable::error_variable (); tree decl = build_decl (location, PARM_DECL, get_identifier_from_string (name), type_tree); DECL_CONTEXT (decl) = fndecl; @@ -2188,7 +2194,7 @@ Gcc_backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree, || fndecl == error_mark_node) { *pstatement = error_mark_node; - return this->error_variable (); + return Bvariable::error_variable (); } tree var; |