aboutsummaryrefslogtreecommitdiff
path: root/gcc/postreload-gcse.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-06-24 13:21:35 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-06-24 13:21:35 +0000
commitc203e8a73b2f12a1da52a16a0c4a50e62b42445b (patch)
treeb8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/postreload-gcse.c
parentfbc2a724d481bb5c205baeaaa955533451226d01 (diff)
downloadgcc-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/postreload-gcse.c')
-rw-r--r--gcc/postreload-gcse.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index af2d731..f2391a1 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -148,7 +148,7 @@ expr_hasher::equal (const value_type *exp1, const compare_type *exp2)
}
/* The table itself. */
-static hash_table <expr_hasher> expr_table;
+static hash_table<expr_hasher> *expr_table;
static struct obstack expr_obstack;
@@ -279,7 +279,7 @@ alloc_mem (void)
make the hash table too small, but unnecessarily making it too large
also doesn't help. The i/4 is a gcse.c relic, and seems like a
reasonable choice. */
- expr_table.create (MAX (i / 4, 13));
+ expr_table = new hash_table<expr_hasher> (MAX (i / 4, 13));
/* We allocate everything on obstacks because we often can roll back
the whole obstack to some point. Freeing obstacks is very fast. */
@@ -306,7 +306,8 @@ free_mem (void)
{
free (uid_cuid);
- expr_table.dispose ();
+ delete expr_table;
+ expr_table = NULL;
obstack_free (&expr_obstack, NULL);
obstack_free (&occr_obstack, NULL);
@@ -348,7 +349,7 @@ insert_expr_in_table (rtx x, rtx insn)
cur_expr->hash = hash;
cur_expr->avail_occr = NULL;
- slot = expr_table.find_slot_with_hash (cur_expr, hash, INSERT);
+ slot = expr_table->find_slot_with_hash (cur_expr, hash, INSERT);
if (! (*slot))
/* The expression isn't found, so insert it. */
@@ -416,7 +417,7 @@ lookup_expr_in_table (rtx pat)
tmp_expr->hash = hash;
tmp_expr->avail_occr = NULL;
- slot = expr_table.find_slot_with_hash (tmp_expr, hash, INSERT);
+ slot = expr_table->find_slot_with_hash (tmp_expr, hash, INSERT);
obstack_free (&expr_obstack, tmp_expr);
if (!slot)
@@ -457,13 +458,13 @@ dump_hash_table (FILE *file)
{
fprintf (file, "\n\nexpression hash table\n");
fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n",
- (long) expr_table.size (),
- (long) expr_table.elements (),
- expr_table.collisions ());
- if (expr_table.elements () > 0)
+ (long) expr_table->size (),
+ (long) expr_table->elements (),
+ expr_table->collisions ());
+ if (expr_table->elements () > 0)
{
fprintf (file, "\n\ntable entries:\n");
- expr_table.traverse <FILE *, dump_expr_hash_table_entry> (file);
+ expr_table->traverse <FILE *, dump_expr_hash_table_entry> (file);
}
fprintf (file, "\n");
}
@@ -1253,7 +1254,7 @@ delete_redundant_insns_1 (expr **slot, void *data ATTRIBUTE_UNUSED)
static void
delete_redundant_insns (void)
{
- expr_table.traverse <void *, delete_redundant_insns_1> (NULL);
+ expr_table->traverse <void *, delete_redundant_insns_1> (NULL);
if (dump_file)
fprintf (dump_file, "\n");
}
@@ -1279,7 +1280,7 @@ gcse_after_reload_main (rtx f ATTRIBUTE_UNUSED)
if (dump_file)
dump_hash_table (dump_file);
- if (expr_table.elements () > 0)
+ if (expr_table->elements () > 0)
{
eliminate_partially_redundant_loads ();
delete_redundant_insns ();