From d6a818c59e002f76f237ad305bf4b73a415dcb3c Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 25 Jun 2015 17:15:44 +0000 Subject: tree-hash-traits.h: New file. gcc/ * tree-hash-traits.h: New file. (tree_operand_hash): New class. * sanopt.c: Include tree-hash-traits.h. (sanopt_tree_map_traits): Use tree_operand_hash. * tree-if-conv.c: Include tree-hash-traits.h. (phi_args_hash_traits): Use tree_operand_hash. * tree-ssa-uncprop.c: Include tree-hash-traits.h. (val_ssa_equiv_hash_traits): Use tree_operand_hash. From-SVN: r224967 --- gcc/tree-if-conv.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'gcc/tree-if-conv.c') diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index e0ac936..59853c8 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -133,6 +133,7 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "insn-codes.h" #include "optabs.h" +#include "tree-hash-traits.h" /* List of basic blocks in if-conversion-suitable order. */ static basic_block *ifc_bbs; @@ -1588,27 +1589,9 @@ convert_scalar_cond_reduction (gimple reduc, gimple_stmt_iterator *gsi, return rhs; } -/* Helpers for PHI arguments hashtable map. */ +typedef simple_hashmap_traits phi_args_hash_traits; -struct phi_args_hash_traits : default_hashmap_traits -{ - static inline hashval_t hash (tree); - static inline bool equal_keys (tree, tree); -}; - -inline hashval_t -phi_args_hash_traits::hash (tree value) -{ - return iterative_hash_expr (value, 0); -} - -inline bool -phi_args_hash_traits::equal_keys (tree value1, tree value2) -{ - return operand_equal_p (value1, value2, 0); -} - - /* Produce condition for all occurrences of ARG in PHI node. */ +/* Produce condition for all occurrences of ARG in PHI node. */ static tree gen_phi_arg_condition (gphi *phi, vec *occur, -- cgit v1.1