aboutsummaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-08-17 08:03:54 +0000
committerRichard Guenther <rguenther@suse.de>2012-08-17 08:03:54 +0000
commited44469a1a3fc3e8669e2c4b75a56aa55d914435 (patch)
treef5e13f0401d96073f145438cc14798458718ef90 /gcc/coverage.c
parent8c37122f2edc7c7ccb5a62b33ed47082c1174699 (diff)
2012-08-17 Richard Guenther <rguenther@suse.de>
* hash-table.h (class hash_table): Use a descriptor template argument instead of decomposed element type and support functions. (struct pointer_hash): New generic typed pointer-hash. (struct typed_free_remove, struct typed_noop_remove): Generic hash_table support pieces. * coverage.c (struct counts_entry): Add hash_table support members. * tree-ssa-ccp.c (gimple_htab): Use pointer_hash. * tree-ssa-coalesce.c (struct ssa_name_var_hash): New generic SSA name by SSA_NAME_VAR hash. (coalesce_ssa_name): Use it. * tree-ssa-pre.c (struct pre_expr_d): Add hash_table support. (expression_to_id): Adjust. (struct expr_pred_trans_d): Add hash_table support. (phi_translate_table): Adjust. (phi_trans_lookup): Likewise. (phi_trans_add): Likewise. (do_regular_insertion): Likewise. * tree-ssa-tail-merge.c (struct same_succ_def): Add hash_table support. (same_succ_htab): Adjust. (find_same_succ_bb): Likewise. (find_same_succ): Likewise. (update_worklist): Likewise. * tree-ssa-threadupdate.c (struct redirection_data): Add hash_table support. (redirection_data): Adjust. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190471 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r--gcc/coverage.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 3fea525a08d..b4d22dfd9c6 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -77,6 +77,12 @@ typedef struct counts_entry
unsigned cfg_checksum;
gcov_type *counts;
struct gcov_ctr_summary summary;
+
+ /* hash_table support. */
+ typedef counts_entry T;
+ static inline hashval_t hash (const counts_entry *);
+ static int equal (const counts_entry *, const counts_entry *);
+ static void remove (counts_entry *);
} counts_entry_t;
static GTY(()) struct coverage_data *functions_head = 0;
@@ -144,29 +150,27 @@ get_gcov_unsigned_t (void)
}
inline hashval_t
-coverage_counts_entry_hash (const counts_entry_t *entry)
+counts_entry::hash (const counts_entry_t *entry)
{
return entry->ident * GCOV_COUNTERS + entry->ctr;
}
inline int
-coverage_counts_entry_eq (const counts_entry_t *entry1,
- const counts_entry_t *entry2)
+counts_entry::equal (const counts_entry_t *entry1,
+ const counts_entry_t *entry2)
{
return entry1->ident == entry2->ident && entry1->ctr == entry2->ctr;
}
inline void
-coverage_counts_entry_del (counts_entry_t *entry)
+counts_entry::remove (counts_entry_t *entry)
{
free (entry->counts);
free (entry);
}
/* Hash table of count data. */
-static hash_table <counts_entry_t, coverage_counts_entry_hash,
- coverage_counts_entry_eq, coverage_counts_entry_del>
- counts_hash;
+static hash_table <counts_entry> counts_hash;
/* Read in the counts file, if available. */