summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2013-12-27 14:08:02 -0500
committerTrevor Saunders <tsaunders@mozilla.com>2014-02-18 22:44:35 -0500
commitbcb2ec731b79bb748906551f3040f8c53cee0fe0 (patch)
tree3952b22cd546583f2cddd353dbe9cdc45771f79b
parent31951e12ff9e25e60ede18cf2ecf102eccadcfa9 (diff)
downloadgcc-bcb2ec731b79bb748906551f3040f8c53cee0fe0.tar.gz
bitmap_hash () -> bitmap_head::hash ()
-rw-r--r--gcc/bitmap.c4
-rw-r--r--gcc/bitmap.h5
-rw-r--r--gcc/tree-ssa-structalias.c6
-rw-r--r--gcc/tree-ssa-tail-merge.c2
4 files changed, 9 insertions, 8 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index caa99fc05e6..452ad28b5ca 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -2059,13 +2059,13 @@ bitmap_ior_and_into (bitmap a, const_bitmap b, const_bitmap c)
/* Compute hash of bitmap (for purposes of hashing). */
hashval_t
-bitmap_hash (const_bitmap head)
+bitmap_head::hash () const
{
const bitmap_element *ptr;
BITMAP_WORD hash = 0;
int ix;
- for (ptr = head->first; ptr; ptr = ptr->next)
+ for (ptr = first; ptr; ptr = ptr->next)
{
hash ^= ptr->indx;
for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index d6f2be57d55..257c8df2351 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -201,6 +201,9 @@ struct GTY(()) bitmap_head {
void swap (bitmap_head *);
+ /* Compute bitmap hash (for purposes of hashing etc.) */
+ hashval_t hash () const;
+
unsigned int indx; /* Index of last element looked at. */
unsigned int descriptor_id; /* Unique identifier for the allocation
site of this bitmap, for detailed
@@ -313,8 +316,6 @@ extern void debug (const bitmap_head *ptr);
extern unsigned bitmap_first_set_bit (const_bitmap);
extern unsigned bitmap_last_set_bit (const_bitmap);
-/* Compute bitmap hash (for purposes of hashing etc.) */
-extern hashval_t bitmap_hash (const_bitmap);
/* Allocate a bitmap from a bit obstack. */
#define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK)
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 402b3d1032d..e978dce92cc 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1935,7 +1935,7 @@ equiv_class_lookup_or_add (hash_table <equiv_class_hasher> table, bitmap labels)
equiv_class_label ecl;
ecl.labels = labels;
- ecl.hashcode = bitmap_hash (labels);
+ ecl.hashcode = labels->hash ();
slot = table.find_slot_with_hash (&ecl, ecl.hashcode, INSERT);
if (!*slot)
{
@@ -5964,7 +5964,7 @@ shared_bitmap_lookup (bitmap pt_vars)
struct shared_bitmap_info sbi;
sbi.pt_vars = pt_vars;
- sbi.hashcode = bitmap_hash (pt_vars);
+ sbi.hashcode = pt_vars->hash ();
slot = shared_bitmap_table.find_slot_with_hash (&sbi, sbi.hashcode,
NO_INSERT);
@@ -5984,7 +5984,7 @@ shared_bitmap_add (bitmap pt_vars)
shared_bitmap_info_t sbi = XNEW (struct shared_bitmap_info);
sbi->pt_vars = pt_vars;
- sbi->hashcode = bitmap_hash (pt_vars);
+ sbi->hashcode = pt_vars->hash ();
slot = shared_bitmap_table.find_slot_with_hash (sbi, sbi->hashcode, INSERT);
gcc_assert (!*slot);
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 7b5291b667f..24bffedcbf1 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -450,7 +450,7 @@ stmt_update_dep_bb (gimple stmt)
static hashval_t
same_succ_hash (const_same_succ e)
{
- hashval_t hashval = bitmap_hash (e->succs);
+ hashval_t hashval = e->succs->hash ();
int flags;
unsigned int i;
unsigned int first = bitmap_first_set_bit (e->bbs);