summaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-24 13:21:35 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-24 13:21:35 +0000
commitc1f445d2fbea31314327e0ce37f86184a6ae3de7 (patch)
treeb8d7f5b21a14b16949ddbc5dcaeb5f2b2654d63a /gcc/cfg.c
parentd0285fb08b709575f6b35bf46efbae5e1cb3a40a (diff)
downloadgcc-c1f445d2fbea31314327e0ce37f86184a6ae3de7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211936 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index f5af1084d34..6070d9ed220 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -1038,11 +1038,11 @@ bb_copy_hasher::equal (const value_type *data, const compare_type *data2)
/* Data structures used to maintain mapping between basic blocks and
copies. */
-static hash_table <bb_copy_hasher> bb_original;
-static hash_table <bb_copy_hasher> bb_copy;
+static hash_table<bb_copy_hasher> *bb_original;
+static hash_table<bb_copy_hasher> *bb_copy;
/* And between loops and copies. */
-static hash_table <bb_copy_hasher> loop_copy;
+static hash_table<bb_copy_hasher> *loop_copy;
static alloc_pool original_copy_bb_pool;
@@ -1055,9 +1055,9 @@ initialize_original_copy_tables (void)
original_copy_bb_pool
= create_alloc_pool ("original_copy",
sizeof (struct htab_bb_copy_original_entry), 10);
- bb_original.create (10);
- bb_copy.create (10);
- loop_copy.create (10);
+ bb_original = new hash_table<bb_copy_hasher> (10);
+ bb_copy = new hash_table<bb_copy_hasher> (10);
+ loop_copy = new hash_table<bb_copy_hasher> (10);
}
/* Free the data structures to maintain mapping between blocks and
@@ -1066,9 +1066,12 @@ void
free_original_copy_tables (void)
{
gcc_assert (original_copy_bb_pool);
- bb_copy.dispose ();
- bb_original.dispose ();
- loop_copy.dispose ();
+ delete bb_copy;
+ bb_copy = NULL;
+ delete bb_original;
+ bb_copy = NULL;
+ delete loop_copy;
+ loop_copy = NULL;
free_alloc_pool (original_copy_bb_pool);
original_copy_bb_pool = NULL;
}
@@ -1076,7 +1079,7 @@ free_original_copy_tables (void)
/* Removes the value associated with OBJ from table TAB. */
static void
-copy_original_table_clear (hash_table <bb_copy_hasher> tab, unsigned obj)
+copy_original_table_clear (hash_table<bb_copy_hasher> *tab, unsigned obj)
{
htab_bb_copy_original_entry **slot;
struct htab_bb_copy_original_entry key, *elt;
@@ -1085,12 +1088,12 @@ copy_original_table_clear (hash_table <bb_copy_hasher> tab, unsigned obj)
return;
key.index1 = obj;
- slot = tab.find_slot (&key, NO_INSERT);
+ slot = tab->find_slot (&key, NO_INSERT);
if (!slot)
return;
elt = *slot;
- tab.clear_slot (slot);
+ tab->clear_slot (slot);
pool_free (original_copy_bb_pool, elt);
}
@@ -1098,7 +1101,7 @@ copy_original_table_clear (hash_table <bb_copy_hasher> tab, unsigned obj)
Do nothing when data structures are not initialized. */
static void
-copy_original_table_set (hash_table <bb_copy_hasher> tab,
+copy_original_table_set (hash_table<bb_copy_hasher> *tab,
unsigned obj, unsigned val)
{
struct htab_bb_copy_original_entry **slot;
@@ -1108,7 +1111,7 @@ copy_original_table_set (hash_table <bb_copy_hasher> tab,
return;
key.index1 = obj;
- slot = tab.find_slot (&key, INSERT);
+ slot = tab->find_slot (&key, INSERT);
if (!*slot)
{
*slot = (struct htab_bb_copy_original_entry *)
@@ -1136,7 +1139,7 @@ get_bb_original (basic_block bb)
gcc_assert (original_copy_bb_pool);
key.index1 = bb->index;
- entry = bb_original.find (&key);
+ entry = bb_original->find (&key);
if (entry)
return BASIC_BLOCK_FOR_FN (cfun, entry->index2);
else
@@ -1161,7 +1164,7 @@ get_bb_copy (basic_block bb)
gcc_assert (original_copy_bb_pool);
key.index1 = bb->index;
- entry = bb_copy.find (&key);
+ entry = bb_copy->find (&key);
if (entry)
return BASIC_BLOCK_FOR_FN (cfun, entry->index2);
else
@@ -1191,7 +1194,7 @@ get_loop_copy (struct loop *loop)
gcc_assert (original_copy_bb_pool);
key.index1 = loop->num;
- entry = loop_copy.find (&key);
+ entry = loop_copy->find (&key);
if (entry)
return get_loop (cfun, entry->index2);
else