aboutsummaryrefslogtreecommitdiff
path: root/gcc/trans-mem.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/trans-mem.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/trans-mem.c')
-rw-r--r--gcc/trans-mem.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index b728d74..c4baa43 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -982,7 +982,7 @@ log_entry_hasher::remove (value_type *lp)
/* The actual log. */
-static hash_table <log_entry_hasher> tm_log;
+static hash_table<log_entry_hasher> *tm_log;
/* Addresses to log with a save/restore sequence. These should be in
dominator order. */
@@ -1027,14 +1027,14 @@ tm_mem_map_hasher::equal (const value_type *v, const compare_type *c)
/* Map for an SSA_NAME originally pointing to a non aliased new piece
of memory (malloc, alloc, etc). */
-static hash_table <tm_mem_map_hasher> tm_new_mem_hash;
+static hash_table<tm_mem_map_hasher> *tm_new_mem_hash;
/* Initialize logging data structures. */
static void
tm_log_init (void)
{
- tm_log.create (10);
- tm_new_mem_hash.create (5);
+ tm_log = new hash_table<log_entry_hasher> (10);
+ tm_new_mem_hash = new hash_table<tm_mem_map_hasher> (5);
tm_log_save_addresses.create (5);
}
@@ -1042,8 +1042,10 @@ tm_log_init (void)
static void
tm_log_delete (void)
{
- tm_log.dispose ();
- tm_new_mem_hash.dispose ();
+ delete tm_log;
+ tm_log = NULL;
+ delete tm_new_mem_hash;
+ tm_new_mem_hash = NULL;
tm_log_save_addresses.release ();
}
@@ -1088,7 +1090,7 @@ tm_log_add (basic_block entry_block, tree addr, gimple stmt)
struct tm_log_entry l, *lp;
l.addr = addr;
- slot = tm_log.find_slot (&l, INSERT);
+ slot = tm_log->find_slot (&l, INSERT);
if (!*slot)
{
tree type = TREE_TYPE (addr);
@@ -1231,10 +1233,10 @@ tm_log_emit_stmt (tree addr, gimple stmt)
static void
tm_log_emit (void)
{
- hash_table <log_entry_hasher>::iterator hi;
+ hash_table<log_entry_hasher>::iterator hi;
struct tm_log_entry *lp;
- FOR_EACH_HASH_TABLE_ELEMENT (tm_log, lp, tm_log_entry_t, hi)
+ FOR_EACH_HASH_TABLE_ELEMENT (*tm_log, lp, tm_log_entry_t, hi)
{
size_t i;
gimple stmt;
@@ -1276,7 +1278,7 @@ tm_log_emit_saves (basic_block entry_block, basic_block bb)
for (i = 0; i < tm_log_save_addresses.length (); ++i)
{
l.addr = tm_log_save_addresses[i];
- lp = *(tm_log.find_slot (&l, NO_INSERT));
+ lp = *(tm_log->find_slot (&l, NO_INSERT));
gcc_assert (lp->save_var != NULL);
/* We only care about variables in the current transaction. */
@@ -1312,7 +1314,7 @@ tm_log_emit_restores (basic_block entry_block, basic_block bb)
for (i = tm_log_save_addresses.length () - 1; i >= 0; i--)
{
l.addr = tm_log_save_addresses[i];
- lp = *(tm_log.find_slot (&l, NO_INSERT));
+ lp = *(tm_log->find_slot (&l, NO_INSERT));
gcc_assert (lp->save_var != NULL);
/* We only care about variables in the current transaction. */
@@ -1363,7 +1365,7 @@ thread_private_new_memory (basic_block entry_block, tree x)
/* Look in cache first. */
elt.val = x;
- slot = tm_new_mem_hash.find_slot (&elt, INSERT);
+ slot = tm_new_mem_hash->find_slot (&elt, INSERT);
elt_p = *slot;
if (elt_p)
return elt_p->local_new_memory;
@@ -3340,7 +3342,7 @@ static bitmap_obstack tm_memopt_obstack;
/* Unique counter for TM loads and stores. Loads and stores of the
same address get the same ID. */
static unsigned int tm_memopt_value_id;
-static hash_table <tm_memop_hasher> tm_memopt_value_numbers;
+static hash_table<tm_memop_hasher> *tm_memopt_value_numbers;
#define STORE_AVAIL_IN(BB) \
((struct tm_memopt_bitmaps *) ((BB)->aux))->store_avail_in
@@ -3374,7 +3376,7 @@ tm_memopt_value_number (gimple stmt, enum insert_option op)
gcc_assert (is_tm_load (stmt) || is_tm_store (stmt));
tmpmem.addr = gimple_call_arg (stmt, 0);
- slot = tm_memopt_value_numbers.find_slot (&tmpmem, op);
+ slot = tm_memopt_value_numbers->find_slot (&tmpmem, op);
if (*slot)
mem = *slot;
else if (op == INSERT)
@@ -3434,11 +3436,11 @@ dump_tm_memopt_set (const char *set_name, bitmap bits)
fprintf (dump_file, "TM memopt: %s: [", set_name);
EXECUTE_IF_SET_IN_BITMAP (bits, 0, i, bi)
{
- hash_table <tm_memop_hasher>::iterator hi;
+ hash_table<tm_memop_hasher>::iterator hi;
struct tm_memop *mem = NULL;
/* Yeah, yeah, yeah. Whatever. This is just for debugging. */
- FOR_EACH_HASH_TABLE_ELEMENT (tm_memopt_value_numbers, mem, tm_memop_t, hi)
+ FOR_EACH_HASH_TABLE_ELEMENT (*tm_memopt_value_numbers, mem, tm_memop_t, hi)
if (mem->value_id == i)
break;
gcc_assert (mem->value_id == i);
@@ -3874,7 +3876,7 @@ execute_tm_memopt (void)
vec<basic_block> bbs;
tm_memopt_value_id = 0;
- tm_memopt_value_numbers.create (10);
+ tm_memopt_value_numbers = new hash_table<tm_memop_hasher> (10);
for (region = all_tm_regions; region; region = region->next)
{
@@ -3908,10 +3910,11 @@ execute_tm_memopt (void)
tm_memopt_free_sets (bbs);
bbs.release ();
bitmap_obstack_release (&tm_memopt_obstack);
- tm_memopt_value_numbers.empty ();
+ tm_memopt_value_numbers->empty ();
}
- tm_memopt_value_numbers.dispose ();
+ delete tm_memopt_value_numbers;
+ tm_memopt_value_numbers = NULL;
return 0;
}