aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-reassoc.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-08-02 11:34:54 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-08-02 11:34:54 +0000
commitb787e7a2c2c9be2f548d4c76ec324b71859851a4 (patch)
treeb20f9df1d7e2cb3a642d2fab604f827c7d23712a /gcc/tree-ssa-reassoc.c
parent6e2830c3dbe0d4972519ddd44bd1b15b2b274ba2 (diff)
downloadgcc-b787e7a2c2c9be2f548d4c76ec324b71859851a4.zip
gcc-b787e7a2c2c9be2f548d4c76ec324b71859851a4.tar.gz
gcc-b787e7a2c2c9be2f548d4c76ec324b71859851a4.tar.bz2
convert many uses of pointer_map to hash_map
gcc/c-family/ * cilk.c: Use hash_map instead of pointer_map. gcc/c/ * c-typeck.c: Use hash_map instead of pointer_map. gcc/cp/ * optimize.c, semantics.c: Use hash_map instead of pointer_map. gcc/ * hash-map.h (default_hashmap_traits::mark_key_deleted): Fix cast. (hash_map::remove): New method. (hash_map::traverse): New method. * cgraph.h, except.c, except.h, gimple-ssa-strength-reduction.c, ipa-utils.c, lto-cgraph.c, lto-streamer.h, omp-low.c, predict.c, tree-cfg.c, tree-cfgcleanup.c, tree-eh.c, tree-eh.h, tree-inline.c, tree-inline.h, tree-nested.c, tree-sra.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-reassoc.c, tree-ssa-structalias.c, tree-ssa.c, tree-ssa.h, var-tracking.c: Use hash_map instead of pointer_map. From-SVN: r213517
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r--gcc/tree-ssa-reassoc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index f9bd9a4..2e8337c 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-inline.h"
-#include "pointer-set.h"
+#include "hash-map.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
#include "gimple-fold.h"
@@ -216,7 +216,7 @@ static int next_operand_entry_id;
static long *bb_rank;
/* Operand->rank hashtable. */
-static struct pointer_map_t *operand_rank;
+static hash_map<tree, long> *operand_rank;
/* Forward decls. */
static long get_rank (tree);
@@ -362,8 +362,8 @@ propagate_rank (long rank, tree op)
static inline long
find_operand_rank (tree e)
{
- void **slot = pointer_map_contains (operand_rank, e);
- return slot ? (long) (intptr_t) *slot : -1;
+ long *slot = operand_rank->get (e);
+ return slot ? *slot : -1;
}
/* Insert {E,RANK} into the operand rank hashtable. */
@@ -371,11 +371,8 @@ find_operand_rank (tree e)
static inline void
insert_operand_rank (tree e, long rank)
{
- void **slot;
gcc_assert (rank > 0);
- slot = pointer_map_insert (operand_rank, e);
- gcc_assert (!*slot);
- *slot = (void *) (intptr_t) rank;
+ gcc_assert (!operand_rank->put (e, rank));
}
/* Given an expression E, return the rank of the expression. */
@@ -4635,7 +4632,7 @@ init_reassoc (void)
deeper loops come later. */
pre_and_rev_post_order_compute (NULL, bbs, false);
bb_rank = XCNEWVEC (long, last_basic_block_for_fn (cfun));
- operand_rank = pointer_map_create ();
+ operand_rank = new hash_map<tree, long>;
/* Give each default definition a distinct rank. This includes
parameters and the static chain. Walk backwards over all
@@ -4676,7 +4673,7 @@ fini_reassoc (void)
statistics_counter_event (cfun, "Built-in powi calls created",
reassociate_stats.pows_created);
- pointer_map_destroy (operand_rank);
+ delete operand_rank;
free_alloc_pool (operand_entry_pool);
free (bb_rank);
plus_negates.release ();