aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-10-08 09:40:16 +0200
committerMartin Liska <mliska@suse.cz>2021-10-11 09:56:37 +0200
commit9abf8c9534144fe9b4948a3104655983821ca7a1 (patch)
tree34f10f8122749d81b004fae694be0e56835ffad3
parent4e5bc4e4506a7ae7bb88fc925a425652a1da6b2d (diff)
downloadgcc-9abf8c9534144fe9b4948a3104655983821ca7a1.zip
gcc-9abf8c9534144fe9b4948a3104655983821ca7a1.tar.gz
gcc-9abf8c9534144fe9b4948a3104655983821ca7a1.tar.bz2
options: use cl_optimization_hash.
gcc/ChangeLog: * tree.c (cl_option_hasher::hash): Use cl_optimization_hash and remove legacy hashing code.
-rw-r--r--gcc/tree.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 561b9cd5..7bfd641 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -11473,30 +11473,13 @@ hashval_t
cl_option_hasher::hash (tree x)
{
const_tree const t = x;
- const char *p;
- size_t i;
- size_t len = 0;
- hashval_t hash = 0;
if (TREE_CODE (t) == OPTIMIZATION_NODE)
- {
- p = (const char *)TREE_OPTIMIZATION (t);
- len = sizeof (struct cl_optimization);
- }
-
+ return cl_optimization_hash (TREE_OPTIMIZATION (t));
else if (TREE_CODE (t) == TARGET_OPTION_NODE)
return cl_target_option_hash (TREE_TARGET_OPTION (t));
-
else
gcc_unreachable ();
-
- /* assume most opt flags are just 0/1, some are 2-3, and a few might be
- something else. */
- for (i = 0; i < len; i++)
- if (p[i])
- hash = (hash << 4) ^ ((i << 2) | p[i]);
-
- return hash;
}
/* Return nonzero if the value represented by *X (an OPTIMIZATION or