aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-tree.cc
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-08-18 16:37:46 -0400
committerPhilip Herron <philip.herron@embecosm.com>2023-08-28 13:31:40 +0000
commit8e2e7fa0211f49fe8f4c8b156468320ccfa711a0 (patch)
treef13b53c99f1b34abce87a3f15a45780b7667d630 /gcc/rust/backend/rust-tree.cc
parentc727e23596ad62b441b9dea655b13f62caf74092 (diff)
downloadgcc-8e2e7fa0211f49fe8f4c8b156468320ccfa711a0.zip
gcc-8e2e7fa0211f49fe8f4c8b156468320ccfa711a0.tar.gz
gcc-8e2e7fa0211f49fe8f4c8b156468320ccfa711a0.tar.bz2
Rename some structs to avoid ODR issues
gcc/rust/ChangeLog: * backend/rust-tree.cc (struct conv_type_hasher): Rename to ... (struct rust_conv_type_hasher): ... here. (struct cplus_array_hasher): Rename to ... (struct rust_cplus_array_hasher): ... here. (struct source_location_table_entry_hash): Rename to ... (struct rust_source_location_table_entry_hash): ... here. * backend/rust-tree.h (struct named_decl_hash): Rename to ... (struct rust_named_decl_hash): ... here. (struct cxx_saved_binding): Rename to ... (struct rust_cxx_saved_binding): ... here. (struct named_label_hash): Rename to ... (struct rust_named_label_hash): ... here. (struct tree_pair_s): Rename to ... (struct rust_tree_pair_s): ... here. (struct tree_pair_p): Rename to ... (struct rust_tree_pair_p): ... here. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/backend/rust-tree.cc')
-rw-r--r--gcc/rust/backend/rust-tree.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index a276af8..c687f9d 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -1336,7 +1336,7 @@ struct find_parameter_pack_data
// forked from gcc/cp/lex.cc conv_type_hasher
/* Hasher for the conversion operator name hash table. */
-struct conv_type_hasher : ggc_ptr_hash<tree_node>
+struct rust_conv_type_hasher : ggc_ptr_hash<tree_node>
{
/* Hash NODE, an identifier node in the table. TYPE_UID is
suitable, as we're not concerned about matching canonicalness
@@ -1351,7 +1351,7 @@ struct conv_type_hasher : ggc_ptr_hash<tree_node>
static bool equal (tree node, tree type) { return TREE_TYPE (node) == type; }
};
-static GTY (()) hash_table<conv_type_hasher> *conv_type_names;
+static GTY (()) hash_table<rust_conv_type_hasher> *conv_type_names;
// forked from gcc/cp/lex.cc make_conv_op_name
@@ -1370,7 +1370,7 @@ make_conv_op_name (tree type)
return error_mark_node;
if (conv_type_names == NULL)
- conv_type_names = hash_table<conv_type_hasher>::create_ggc (31);
+ conv_type_names = hash_table<rust_conv_type_hasher>::create_ggc (31);
tree *slot
= conv_type_names->find_slot_with_hash (type, (hashval_t) TYPE_UID (type),
@@ -2253,7 +2253,7 @@ struct cplus_array_info
// forked from gcc/cp/tree.cc cplus_array_hasher
-struct cplus_array_hasher : ggc_ptr_hash<tree_node>
+struct rust_cplus_array_hasher : ggc_ptr_hash<tree_node>
{
typedef cplus_array_info *compare_type;
@@ -2264,7 +2264,7 @@ struct cplus_array_hasher : ggc_ptr_hash<tree_node>
/* Hash an ARRAY_TYPE. K is really of type `tree'. */
hashval_t
-cplus_array_hasher::hash (tree t)
+rust_cplus_array_hasher::hash (tree t)
{
hashval_t hash;
@@ -2278,7 +2278,7 @@ cplus_array_hasher::hash (tree t)
of type `cplus_array_info*'. */
bool
-cplus_array_hasher::equal (tree t1, cplus_array_info *t2)
+rust_cplus_array_hasher::equal (tree t1, cplus_array_info *t2)
{
return (TREE_TYPE (t1) == t2->type && TYPE_DOMAIN (t1) == t2->domain);
}
@@ -2287,7 +2287,7 @@ cplus_array_hasher::equal (tree t1, cplus_array_info *t2)
/* Hash table containing dependent array types, which are unsuitable for
the language-independent type hash table. */
-static GTY (()) hash_table<cplus_array_hasher> *cplus_array_htab;
+static GTY (()) hash_table<rust_cplus_array_hasher> *cplus_array_htab;
// forked from gcc/cp/tree.cc is_byte_access_type
@@ -2334,7 +2334,7 @@ build_cplus_array_type (tree elt_type, tree index_type, int dependent)
hashval_t hash;
if (cplus_array_htab == NULL)
- cplus_array_htab = hash_table<cplus_array_hasher>::create_ggc (61);
+ cplus_array_htab = hash_table<rust_cplus_array_hasher>::create_ggc (61);
hash = TYPE_UID (elt_type);
if (index_type)
@@ -4262,7 +4262,7 @@ namespace Rust {
/* Traits class for function start hash maps below. */
-struct source_location_table_entry_hash
+struct rust_source_location_table_entry_hash
: ggc_remove<source_location_table_entry>
{
typedef source_location_table_entry value_type;
@@ -4320,7 +4320,7 @@ struct source_location_table_entry_hash
};
static GTY (())
- hash_table<source_location_table_entry_hash> *source_location_table;
+ hash_table<rust_source_location_table_entry_hash> *source_location_table;
static GTY (()) unsigned int source_location_id;
// Above is forked from gcc/cp/cp-gimplify.cc
@@ -4763,7 +4763,7 @@ fold_builtin_source_location (location_t loc)
return build_zero_cst (const_ptr_type_node);
if (source_location_table == NULL)
source_location_table
- = hash_table<source_location_table_entry_hash>::create_ggc (64);
+ = hash_table<rust_source_location_table_entry_hash>::create_ggc (64);
const line_map_ordinary *map;
source_location_table_entry entry;
entry.loc = linemap_resolve_location (line_table, loc,