diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-08-31 11:39:51 -0400 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-09-03 18:05:16 +0000 |
commit | 87037d678c06558ae174b9739004aa7b35346b25 (patch) | |
tree | 8b239616f5b481773ed1de8b85859928b18aad67 /gcc/rust/rust-gcc.cc | |
parent | 45d892b542d1a4d5052842d9cc512d23a2770ac5 (diff) | |
download | gcc-87037d678c06558ae174b9739004aa7b35346b25.zip gcc-87037d678c06558ae174b9739004aa7b35346b25.tar.gz gcc-87037d678c06558ae174b9739004aa7b35346b25.tar.bz2 |
Move variable-related methods into base class Backend
gcc/rust/ChangeLog:
* rust-backend.h
(Backend::global_variable): Make non-virtual.
(Backend::global_variable_set_init): Likewise.
(Backend::local_variable): Likewise.
(Backend::parameter_variable): Likewise.
(Backend::static_chain_variable): Likewise.
(Backend::temporary_variable): Likewise.
(Gcc_backend::global_variable): Remove.
(Gcc_backend::global_variable_set_init): Remove.
(Gcc_backend::local_variable): Remove.
(Gcc_backend::parameter_variable): Remove.
(Gcc_backend::static_chain_variable): Remove.
(Gcc_backend::temporary_variable): Remove.
(Gcc_backend::non_zero_size_type): Move to ...
(Backend::non_zero_size_type): ... here.
(Gcc_backend::convert_tree): Move to ...
(Backend::convert_tree): ... here.
* rust-gcc.cc
(Gcc_backend::non_zero_size_type): Rename to ...
(Backend::non_zero_size_type): ... here.
(Gcc_backend::convert_tree): Rename to ...
(Backend::convert_tree): ... here.
(Gcc_backend::global_variable): Rename to ...
(Backend::global_variable): ... here.
(Gcc_backend::global_variable_set_init): Rename to ...
(Backend::global_variable_set_init): ... here.
(Gcc_backend::local_variable): Rename to ...
(Backend::local_variable): ... here.
(Gcc_backend::parameter_variable): Rename to ...
(Backend::parameter_variable): ... here.
(Gcc_backend::static_chain_variable): Rename to ...
(Backend::static_chain_variable): ... here.
(Gcc_backend::temporary_variable): Rename to ...
(Backend::temporary_variable): ... here.
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 | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 88560a1..64c3bdb 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -1951,7 +1951,7 @@ tree rust_non_zero_struct; // Return a type corresponding to TYPE with non-zero size. tree -Gcc_backend::non_zero_size_type (tree type) +Backend::non_zero_size_type (tree type) { if (int_size_in_bytes (type) != 0) return type; @@ -2010,7 +2010,7 @@ Gcc_backend::non_zero_size_type (tree type) // representations. Make sure this does not confuse the middle-end. tree -Gcc_backend::convert_tree (tree type_tree, tree expr_tree, location_t location) +Backend::convert_tree (tree type_tree, tree expr_tree, location_t location) { if (type_tree == TREE_TYPE (expr_tree)) return expr_tree; @@ -2041,10 +2041,10 @@ Gcc_backend::convert_tree (tree type_tree, tree expr_tree, location_t location) // Make a global variable. Bvariable * -Gcc_backend::global_variable (const std::string &var_name, - const std::string &asm_name, tree type_tree, - bool is_external, bool is_hidden, - bool in_unique_section, location_t location) +Backend::global_variable (const std::string &var_name, + const std::string &asm_name, tree type_tree, + bool is_external, bool is_hidden, + bool in_unique_section, location_t location) { if (type_tree == error_mark_node) return Bvariable::error_variable (); @@ -2083,7 +2083,7 @@ Gcc_backend::global_variable (const std::string &var_name, // Set the initial value of a global variable. void -Gcc_backend::global_variable_set_init (Bvariable *var, tree expr_tree) +Backend::global_variable_set_init (Bvariable *var, tree expr_tree) { if (expr_tree == error_mark_node) return; @@ -2107,9 +2107,8 @@ Gcc_backend::global_variable_set_init (Bvariable *var, tree expr_tree) // Make a local variable. Bvariable * -Gcc_backend::local_variable (tree function, const std::string &name, - tree type_tree, Bvariable *decl_var, - location_t location) +Backend::local_variable (tree function, const std::string &name, tree type_tree, + Bvariable *decl_var, location_t location) { if (type_tree == error_mark_node) return Bvariable::error_variable (); @@ -2129,8 +2128,8 @@ Gcc_backend::local_variable (tree function, const std::string &name, // Make a function parameter variable. Bvariable * -Gcc_backend::parameter_variable (tree function, const std::string &name, - tree type_tree, location_t location) +Backend::parameter_variable (tree function, const std::string &name, + tree type_tree, location_t location) { if (type_tree == error_mark_node) return Bvariable::error_variable (); @@ -2146,8 +2145,8 @@ Gcc_backend::parameter_variable (tree function, const std::string &name, // Make a static chain variable. Bvariable * -Gcc_backend::static_chain_variable (tree fndecl, const std::string &name, - tree type_tree, location_t location) +Backend::static_chain_variable (tree fndecl, const std::string &name, + tree type_tree, location_t location) { if (type_tree == error_mark_node) return Bvariable::error_variable (); @@ -2178,9 +2177,9 @@ Gcc_backend::static_chain_variable (tree fndecl, const std::string &name, // Make a temporary variable. Bvariable * -Gcc_backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree, - tree init_tree, bool is_address_taken, - location_t location, tree *pstatement) +Backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree, + tree init_tree, bool is_address_taken, + location_t location, tree *pstatement) { gcc_assert (fndecl != NULL_TREE); if (type_tree == error_mark_node || init_tree == error_mark_node |