aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2006-08-21 03:53:11 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2006-08-21 01:53:11 +0000
commit1af4bba82ed51ba8108d40badd3d39204f810838 (patch)
treea77296eaee0dcde8be19fcb23b3aaf14b92825ff /gcc/bitmap.c
parent70d539ce3a777b83d929c6de70b14a6eb7f3a100 (diff)
downloadgcc-1af4bba82ed51ba8108d40badd3d39204f810838.zip
gcc-1af4bba82ed51ba8108d40badd3d39204f810838.tar.gz
gcc-1af4bba82ed51ba8108d40badd3d39204f810838.tar.bz2
tree-ssa-alias.c (eq_ptr_info, [...]): New function.
* tree-ssa-alias.c (eq_ptr_info, ptr_info_hash): New function. (create_name_tags): Instead of quadratic checking use hashtable. * bitmap.h: Include hashtab.h. (bitmap_hash): Declare. * bitmap.c (bitmap_hash): New function. From-SVN: r116285
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index efc789a..4ac38b0 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -1520,4 +1520,21 @@ bitmap_print (FILE *file, bitmap head, const char *prefix, const char *suffix)
fputs (suffix, file);
}
+/* Compute hash of bitmap (for purposes of hashing). */
+hashval_t
+bitmap_hash (bitmap head)
+{
+ bitmap_element *ptr;
+ BITMAP_WORD hash = 0;
+ int ix;
+
+ for (ptr = head->first; ptr; ptr = ptr->next)
+ {
+ hash ^= ptr->indx;
+ for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
+ hash ^= ptr->bits[ix];
+ }
+ return (hashval_t)hash;
+}
+
#include "gt-bitmap.h"