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/statistics.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/statistics.c')
-rw-r--r-- | gcc/statistics.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/statistics.c b/gcc/statistics.c index 6c84709..eb3210b 100644 --- a/gcc/statistics.c +++ b/gcc/statistics.c @@ -80,16 +80,16 @@ stats_counter_hasher::remove (value_type *v) free (v); } -typedef hash_table <stats_counter_hasher> stats_counter_table_type; +typedef hash_table<stats_counter_hasher> stats_counter_table_type; /* Array of statistic hashes, indexed by pass id. */ -static stats_counter_table_type *statistics_hashes; +static stats_counter_table_type **statistics_hashes; static unsigned nr_statistics_hashes; /* Return the current hashtable to be used for recording or printing statistics. */ -static stats_counter_table_type +static stats_counter_table_type * curr_statistics_hash (void) { unsigned idx; @@ -98,20 +98,20 @@ curr_statistics_hash (void) idx = current_pass->static_pass_number; if (idx < nr_statistics_hashes - && statistics_hashes[idx].is_created ()) + && statistics_hashes[idx]) return statistics_hashes[idx]; if (idx >= nr_statistics_hashes) { - statistics_hashes = XRESIZEVEC (stats_counter_table_type, + statistics_hashes = XRESIZEVEC (stats_counter_table_type *, statistics_hashes, idx+1); memset (statistics_hashes + nr_statistics_hashes, 0, (idx + 1 - nr_statistics_hashes) - * sizeof (stats_counter_table_type)); + * sizeof (stats_counter_table_type *)); nr_statistics_hashes = idx + 1; } - statistics_hashes[idx].create (15); + statistics_hashes[idx] = new stats_counter_table_type (15); return statistics_hashes[idx]; } @@ -195,16 +195,16 @@ statistics_fini_pass (void) fprintf (dump_file, "Pass statistics:\n"); fprintf (dump_file, "----------------\n"); curr_statistics_hash () - .traverse_noresize <void *, statistics_fini_pass_1> (NULL); + ->traverse_noresize <void *, statistics_fini_pass_1> (NULL); fprintf (dump_file, "\n"); } if (statistics_dump_file && !(statistics_dump_flags & TDF_STATS || statistics_dump_flags & TDF_DETAILS)) curr_statistics_hash () - .traverse_noresize <void *, statistics_fini_pass_2> (NULL); + ->traverse_noresize <void *, statistics_fini_pass_2> (NULL); curr_statistics_hash () - .traverse_noresize <void *, statistics_fini_pass_3> (NULL); + ->traverse_noresize <void *, statistics_fini_pass_3> (NULL); } /* Helper for printing summary information. */ @@ -245,10 +245,10 @@ statistics_fini (void) { unsigned i; for (i = 0; i < nr_statistics_hashes; ++i) - if (statistics_hashes[i].is_created () + if (statistics_hashes[i] && passes->get_pass_for_id (i) != NULL) statistics_hashes[i] - .traverse_noresize <opt_pass *, statistics_fini_1> + ->traverse_noresize <opt_pass *, statistics_fini_1> (passes->get_pass_for_id (i)); } @@ -280,14 +280,14 @@ statistics_init (void) and HISTOGRAM_P. */ static statistics_counter_t * -lookup_or_add_counter (stats_counter_table_type hash, const char *id, int val, +lookup_or_add_counter (stats_counter_table_type *hash, const char *id, int val, bool histogram_p) { statistics_counter_t **counter; statistics_counter_t c; c.id = id; c.val = val; - counter = hash.find_slot (&c, INSERT); + counter = hash->find_slot (&c, INSERT); if (!*counter) { *counter = XNEW (struct statistics_counter_s); |