aboutsummaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
AgeCommit message (Collapse)AuthorFilesLines
2003-05-07s/burtle/iterativeJason Merrill1-1/+1
From-SVN: r66577
2003-05-07hashtab.c (burtle_hash): New fn.Jason Merrill1-0/+138
libiberty/ * hashtab.c (burtle_hash): New fn. * configure.in: Add AC_C_BIGENDIAN_CROSS. * aclocal.m4: Include accross.m4. * configure, config.in: Regenerate. include/ * hashtab.h (burtle_hash): Prototype. (burtle_hash_object): New macro. From-SVN: r66565
2003-04-15argv.c: Fix comments.Kaveh R. Ghazi1-3/+0
* argv.c: Fix comments. * calloc.c: Don't unnecessarily include "libiberty.h". (bzero): Add prototype. * floatformat.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. * getcwd.c (getcwd): Use standard definition to avoid conflicts with system headers. * hashtab.c (htab_traverse): Delete unused variables. * rename.c: Include "ansidecl.h". (rename): Use standard definition to avoid conflicts with system headers. * strsignal.c: Rely on ANSI_PROTOTYPES. * strstr.c: Check GNUC >= 2, not GNUC == 2. * vfprintf.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES. * vprintf.c: Include "ansidecl.h" earlier, rely on ANSI_PROTOTYPES. * vsprintf.c: Include "ansidecl.h" earlier, rely on ANSI_PROTOTYPES and possibly include <stdarg.h>. * Makefile.in: Regenerate dependencies. From-SVN: r65659
2003-03-17ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize.Jan Hubicka1-4/+19
* ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize. * hashtab.h (htab_traverse_noresize): Declare. * hashtab.c (htab_traverse_noresize): Break out from ... * hashtab.c (htab_traverse): ... here. From-SVN: r64496
2003-03-12* hashtab.c (htab_expand): Fix warning.Jan Hubicka1-2/+2
From-SVN: r64249
2003-03-12hashtab.c (htab_expand): Compute the size of hashtable based on the number ↵Jan Hubicka1-3/+16
of elements actually used. * hashtab.c (htab_expand): Compute the size of hashtable based on the number of elements actually used. (htab_traverse): Call htab_expand when table is too empty. From-SVN: r64246
2003-01-26hashtab.h (htab_alloc_with_arg, [...]): Add new types.Daniel Jacobowitz1-2/+70
include/ * hashtab.h (htab_alloc_with_arg, htab_free_with_arg): Add new types. (struct htab): Add alloc_arg, alloc_with_arg_f, free_with_arg_f. (htab_create_alloc_ex): New prototype. (htab_set_functions_ex): New prototype. libiberty/ * hashtab.c (htab_create_alloc_ex): New function. (hatab_set_functions_ex): New function. (htab_delete, htab_expand): Support alternate allocation functions. From-SVN: r61820
2003-01-20* hashtab.c (htab_expand): Fix allocation of new entries.Josef Zlomek1-2/+4
From-SVN: r61507
2002-06-06Index: include/ChangeLogGeoffrey Keating1-0/+23
Index: include/ChangeLog * hashtab.h (htab_create): Restore prototype for backward compatibility. (htab_try_create): Likewise. Index: libiberty/ChangeLog * hashtab.c (htab_create): New stub function for backward compatibility. (htab_try_create): Likewise. From-SVN: r54300
2002-06-04Merge from pch-branch up to tag pch-commit-20020603.Geoffrey Keating1-45/+22
From-SVN: r54232
2002-04-09hashtab.c (higher_prime_number): Use 7 as minimum.Richard Henderson1-32/+46
* hashtab.c (higher_prime_number): Use 7 as minimum. (find_empty_slot_for_expand): Don't compute hash2 unless needed. (htab_find_slot_with_hash): Likewise. From-SVN: r52099
2001-10-07demangle.h (demangler_engine): Const-ify.Kaveh R. Ghazi1-4/+4
include: * demangle.h (demangler_engine): Const-ify. * libiberty.h (buildargv): Likewise. libiberty: * argv.c (buildargv, tests, main): Const-ify. * cp-demangle.c (operator_code): Likewise. * cplus-dem.c (optable, libiberty_demanglers, cplus_demangle_set_style, cplus_demangle_name_to_style, print_demangler_list): Likewise. * hashtab.c (higher_prime_number): Likewise. * strcasecmp.c (charmap): Likewise. * strerror.c (error_info, strerror, main): Likewise. * strncasecmp.c (charmap): Likewise. * strsignal.c (signal_info): Likewise. From-SVN: r46060
2001-08-17Add commentary.Richard Henderson1-1/+24
From-SVN: r44978
2001-08-16* hashtab.c (htab_hash_string): New.Richard Henderson1-0/+16
From-SVN: r44950
2001-03-15fix typoMichael Meissner1-1/+1
From-SVN: r40517
2001-03-15Silence warningMichael Meissner1-39/+32
From-SVN: r40512
2001-03-15Silence warningMichael Meissner1-32/+40
From-SVN: r40511
2000-11-27hashtab.c (higher_prime_number): Use a table, rather than a seive, to find ↵Mark Mitchell1-22/+56
the next prime. * hashtab.c (higher_prime_number): Use a table, rather than a seive, to find the next prime. From-SVN: r37775
2000-11-04hashtab.c (htab_expand): Change to return int.Hans-Peter Nilsson1-8/+58
* hashtab.c (htab_expand): Change to return int. Use calloc or xcalloc depending on htab->return_allocation_failure. Return zero if calloc fails. (htab_create): Update comment to cover memory allocation. (htab_try_create): New. (htab_find_slot_with_hash): Return NULL if htab_expand fails. Update comment to cover this. From-SVN: r37247
2000-11-03(htab_create, htab_expand): Correct formatting of comment beforeHans-Peter Nilsson1-36/+36
function. From-SVN: r37231
2000-05-29hashtab.c, [...]: Include string.h if HAVE_STRING_H.Zack Weinberg1-0/+4
* hashtab.c, partition.c, sort.c, xmemdup.c: Include string.h if HAVE_STRING_H. * pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H. * objalloc.c: Include config.h. Include stdlib.h and don't declare malloc or free if HAVE_STDLIB_H. * strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H, else declare malloc without prototype. Include string.h if HAVE_STRING_H, else declare memset without prototype. Don't include stddef.h. From-SVN: r34254
2000-05-16hashtab.c (hash_pointer): Delete low-order bits which are probably zero, ↵Horst von Brand1-1/+1
also eliminate a warning on alpha. * hashtab.c (hash_pointer): Delete low-order bits which are probably zero, also eliminate a warning on alpha. From-SVN: r33934
2000-04-27hashtab.c (htab_expand): Add prototype.Jan Hubicka1-0/+2
* hashtab.c (htab_expand): Add prototype. (find_empty_slot_for_expand): Likewise. From-SVN: r33487
2000-04-24hashtab.c (hash_pointer, eq_pointer): Make definition static to match prototype.Kaveh R. Ghazi1-3/+3
* hashtab.c (hash_pointer, eq_pointer): Make definition static to match prototype. (htab_expand): Cast the return value of xcalloc. From-SVN: r33391
2000-04-24hashtab.h (hash_pointer): Declare.Mark Mitchell1-0/+27
* hashtab.h (hash_pointer): Declare. (eq_pointer): Likewise. * hashtab.c (hash_pointer): New function. (eq_pointer): Likewise. (htab_hash_pointer): New variable. (htab_eq_pointer): Likewise. From-SVN: r33372
2000-04-18conflict.c (conflict_graph_add): Pass enum type to htab_find_slot.Richard Kenner1-47/+53
* gcc/conflict.c (conflict_graph_add): Pass enum type to htab_find_slot. * gcc/cpperror.c (hashtab.h): Now include. * gcc/cppexp.c (hashtab.h): Likewise. * gcc/cpplex.c (hashtab.h): Likewise. * gcc/cppfiles.c (hashtab.h): Likewise. (find_include_file, _cpp_calc_hash, cpp_read_file): Pass enum type to htab_find_slot_with_hash. * gcc/cpphash.c (hashtab.h): Now include. (_cpp_lookup_slot): INSERT is now enum insert_option. * gcc/cpphash.h (_cpp_lookup_slot): Likewise. * gcc/cppinit.c (hashtab.h): Include earlier. (initialize_builtins): Pass enum to htab_find_slot. * gcc/cpplib.c (hashtab.h): Now include. (do_define, do_undef): Pass enum type to _cpp_lookup_slot. (do_pragma_poison, do_assert): Likewise. * gcc/emit-rtl.c (gen_rtx_CONST_INT): Pass enum to htab_find_slot_with_hash. * gcc/simplify-rtx.c (cselib_lookup_mem, cselib_lookup): Likewise. * gcc/tree.c (type_hash_add): Likewise. (build1): Minor cleanup. * include/hashtab.h (enum insert_option): New type. (htab_find_slot, htab_find_slot_with_hash): Use it. * libiberty/hashtab.c: Various minor cleanups. (htab_find_slot_with_hash): INSERT is now enum insert_option. (htab_find_slot): Likewise. From-SVN: r33236
2000-03-31hashtab.h (hashval_t): New type.Mark Mitchell1-7/+9
* hashtab.h (hashval_t): New type. (htab_find_with_hash): Use it as an argument. (htab_find_slot_with_hash): Likewise. * hashtab.c (find_empty_slot_for_expand): Use hashval_t for hash codes. (htab_find_with_hash): Likewise. (htab_find_slot_with_hash): Likewise. From-SVN: r32842
2000-03-29hashtab.c (htab_find_with_hash): Avoid calculating hash2 unless it will be used.Zack Weinberg1-8/+16
* hashtab.c (htab_find_with_hash): Avoid calculating hash2 unless it will be used. Rearrange loop for better optimization. (higher_prime_number): Add static prototype. From-SVN: r32809
2000-03-14Some cleanups/additions for hashtablesBernd Schmidt1-8/+60
From-SVN: r32536
2000-03-10hashtab.h (struct htab): Add del_f.Zack Weinberg1-1/+26
* hashtab.h (struct htab): Add del_f. (htab_del): New type. (htab_create): Add fourth argument. * hashtab.c (htab_create): Set del_f. (htab_delete, htab_empty, htab_remove_elt, htab_clear_slot): Use it. From-SVN: r32459
2000-03-08hashtab.c: Remove debugging variables (all_searches, all_collisions, ↵Zack Weinberg1-166/+188
all_expansions). * hashtab.c: Remove debugging variables (all_searches, all_collisions, all_expansions). Delete all_hash_table_collisions. (create_hash_table, delete_hash_table, empty_hash_table, find_hash_table_entry, remove_element_from_hash_table_entry, clear_hash_table_slot, traverse_hash_table, hash_table_size, hash_table_elements_number, hash_table_collisions): Rename to: htab_create, htab_delete, htab_empty, htab_find_slot, htab_remove_elt, htab_clear_slot, htab_traverse, htab_size, htab_elements, htab_collisions. (htab_find): New function, handles common case where you don't plan to add or delete an entry. (htab_expand): Don't create a whole new table, just a new entry vector. (htab_find_slot): Simplify logic. * hashtab.h (hash_table_t): Rename to htab_t. (struct hash_table): Rename to struct htab. Shorten element names. Reorder elements by size. (htab_hash, htab_eq, htab_trav): New typedefs for the callback function pointers. (hash_table_entry_t): Discard; just use void * for element type. From-SVN: r32437
1999-11-28* hashtab.c (sys/types.h): File included.Philippe De Muyter1-0/+2
From-SVN: r30683
1999-11-10* hashtab.c: Include stdio.h.Jeffrey A Law1-0/+2
From-SVN: r30475
1999-11-08* hashtab.c (traverse_hash_table): Protect prototype with PARAMS.Jeffrey A Law1-1/+1
From-SVN: r30453
1999-10-23hashtab.c (find_hash_table_entry): When returning a DELETED_ENTRY slot, ↵Zack Weinberg1-1/+36
change it to EMPTY_ENTRY first. 1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com> * hashtab.c (find_hash_table_entry): When returning a DELETED_ENTRY slot, change it to EMPTY_ENTRY first. (clear_hash_table_slot): New function which deletes an entry by its position in the table, not its value. (traverse_hash_table): New function which calls a hook function for every live entry in the table. * hashtab.h: Give hash_table_t a struct tag. Add prototypes for clear_hash_table_slot and traverse_hash_table. Correct prototype of all_hash_table_collisions. From-SVN: r30138
1999-10-15Makefile.in (CFILES): Add hashtab.cVladimir Makarov1-0/+291
* Makefile.in (CFILES): Add hashtab.c (REQUIRED_OFILES): Add hashtab.o (hashtab.o): Add dependencies. * hashtab.c: New file From-SVN: r30012