diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-06-24 13:21:35 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2014-06-24 13:21:35 +0000 |
commit | c203e8a73b2f12a1da52a16a0c4a50e62b42445b (patch) | |
tree | b8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/tree-ssa-coalesce.c | |
parent | fbc2a724d481bb5c205baeaaa955533451226d01 (diff) | |
download | gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.zip gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.gz gcc-c203e8a73b2f12a1da52a16a0c4a50e62b42445b.tar.bz2 |
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r-- | gcc/tree-ssa-coalesce.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 9a1ac67..24ed4b4 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -92,7 +92,7 @@ coalesce_pair_hasher::equal (const value_type *p1, const compare_type *p2) && p1->second_element == p2->second_element); } -typedef hash_table <coalesce_pair_hasher> coalesce_table_type; +typedef hash_table<coalesce_pair_hasher> coalesce_table_type; typedef coalesce_table_type::iterator coalesce_iterator_type; @@ -107,7 +107,7 @@ typedef struct cost_one_pair_d typedef struct coalesce_list_d { - coalesce_table_type list; /* Hash table. */ + coalesce_table_type *list; /* Hash table. */ coalesce_pair_p *sorted; /* List when sorted. */ int num_sorted; /* Number in the sorted list. */ cost_one_pair_p cost_one_list;/* Single use coalesces with cost 1. */ @@ -244,7 +244,7 @@ create_coalesce_list (void) size = 40; list = (coalesce_list_p) xmalloc (sizeof (struct coalesce_list_d)); - list->list.create (size); + list->list = new coalesce_table_type (size); list->sorted = NULL; list->num_sorted = 0; list->cost_one_list = NULL; @@ -258,7 +258,8 @@ static inline void delete_coalesce_list (coalesce_list_p cl) { gcc_assert (cl->cost_one_list == NULL); - cl->list.dispose (); + delete cl->list; + cl->list = NULL; free (cl->sorted); gcc_assert (cl->num_sorted == 0); free (cl); @@ -289,7 +290,7 @@ find_coalesce_pair (coalesce_list_p cl, int p1, int p2, bool create) } hash = coalesce_pair_hasher::hash (&p); - slot = cl->list.find_slot_with_hash (&p, hash, create ? INSERT : NO_INSERT); + slot = cl->list->find_slot_with_hash (&p, hash, create ? INSERT : NO_INSERT); if (!slot) return NULL; @@ -372,14 +373,14 @@ compare_pairs (const void *p1, const void *p2) static inline int num_coalesce_pairs (coalesce_list_p cl) { - return cl->list.elements (); + return cl->list->elements (); } /* Iterate over CL using ITER, returning values in PAIR. */ #define FOR_EACH_PARTITION_PAIR(PAIR, ITER, CL) \ - FOR_EACH_HASH_TABLE_ELEMENT ((CL)->list, (PAIR), coalesce_pair_p, (ITER)) + FOR_EACH_HASH_TABLE_ELEMENT (*(CL)->list, (PAIR), coalesce_pair_p, (ITER)) /* Prepare CL for removal of preferred pairs. When finished they are sorted @@ -1267,9 +1268,8 @@ coalesce_ssa_name (void) from the same SSA_NAME_VAR so debug info remains undisturbed. */ if (!optimize) { - hash_table <ssa_name_var_hash> ssa_name_hash; + hash_table<ssa_name_var_hash> ssa_name_hash (10); - ssa_name_hash.create (10); for (i = 1; i < num_ssa_names; i++) { tree a = ssa_name (i); @@ -1303,7 +1303,6 @@ coalesce_ssa_name (void) } } } - ssa_name_hash.dispose (); } if (dump_file && (dump_flags & TDF_DETAILS)) dump_var_map (dump_file, map); |