summaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
Commit message (Collapse)AuthorAgeFilesLines
* * hashtab.c (htab_traverse): Don't call htab_expand forjakub2009-06-211-2/+3
| | | | | | | nearly empty hashtabs with sizes 7, 13 or 31. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148759 138bc75d-0d04-0410-961f-82ee72b054a4
* PR rtl-optimization/28071hubicka2006-07-271-1/+22
| | | | | | | | * hashtab.c (htab_empty): Clear out n_deleted/n_elements; downsize the hashtable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115779 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-06-29 Daniel Berlin <dberlin@dberlin.org>dberlin2005-06-301-32/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tree-complex.c (complex_variable_components): Now a hashtable. (cvc_lookup): Ditto. (cvc_insert): Ditto. (create_components): Use referenced var iterator. Initialize hashtable. Use cvc_insert/lookup. (extract_components): Use cvc_insert/lookup. (update_complex_components): Ditto. (update_complex_components_on_edge): Ditto. * tree-dfa.c (referenced_vars): Now a hashtable. (dump_referenced_vars): Use iterator. (referenced_var_lookup): New function. (referenced_var_insert): Ditto. (add_referenced_var): Use referenced_var_insert. (mark_new_vars_to_rename): Use DECL_UID. * tree-flow-inline.h (first_htab_element): New function. (end_htab_p): Ditto. (next_htab_element): Ditto. (first_referenced_var): Ditto. (end_referenced_vars_p): Ditto. (next_referenced_var): Ditto. (is_call_clobbered): Use DECL_UID. (mark_call_clobbered): Ditto. (clear_call_clobbered): Ditto. (mark_non_addressable): Ditto. * tree-flow.h (htab_iterator): New struct. (FOR_EACH_HTAB_ELEMENT): New macro. (struct int_tree_map): New struct. (int_tree_map_hash): Prototype. (int_tree_map_eq): Ditto. (referenced_var_iterator): Ditto. (FOR_EACH_REFERENCED_VAR): New macro. (referenced_vars): Now a hashtable. * tree-into-ssa.c (symbol_marked_for_renaming): Use DECL_UID. (add_new_name_mapping): Ditto. (mark_def_sites): Ditto. (insert_phi_nodes): Use referenced_var iterator. (mark_def_site_blocks): Ditto. (mark_sym_for_renaming): Use DECL_UID. * tree-sra.c (is_sra_candidate_decl): Use DECL_UID. (lookup_element): Ditto. (find_candidates_for_sra): Use referenced_vars iterator. Use DECL_UID. * tree-ssa-alias.c (NUM_REFERENCES): New macro. (NUM_REFERENCES_CLEAR): Ditto. (NUM_REFERENCES_INC): Ditto. (NUM_REFERENCES_SET): Ditto. (alias_obstack): New bitmap obstack. (struct alias_map_d): Use bitmap, not sbitmap. (struct alias_info): Remove num_references. (init_alias_info): Use referenced_var iterator. Initialize bitmap obstack. (delete_alias_info): Use referenced_var iterator. Free bitmap obstack. (compute_points_to_and_addr_escape): Use DECL_UID. Use new NUM_REFERENCES macros. (compute_flow_sensitive_aliasing): may_aliases is now a bitmap. Use new NUM_REFERENCES macros. (group_aliases_into): Update prototype to use bitmap. (setup_pointers_and_addressables): Use referenced_vars iterator. Use DECL_UID. Use new NUM_REFERENCES macros. (add_pointed_to_var): Use DECL_UID. (dump_alias_info): Use referenced_var iterator. (add_type_alias): Ditto. (used_portions): Now a hashtable. (used_part_map_eq): New function. (used_part_map_hash): Ditto. (free_used_part_map): Ditto. (up_lookup): Ditto. (up_insert): Ditto. (get_or_create_used_part_for): Use up_lookup. (create_overlap_variables_for): Ditto. (find_used_portions): Use up_insert. Use DECL_UID. (create_structure_vars): Init used_portions hashtable, use referenced_vars iterator. * tree-ssa-live.c (create_ssa_var_map): sbitmaps became bitmaps. Use DECL_UID. * tree-ssa-loop-im.c (gather_mem_refs_stmt): Use DECL_UID. * tree-ssa-operands.c (get_asm_expr_operands): Ditto. (note_addressable): Ditto. * tree-ssa-structalias.c (set_uids_in_ptset): Ditto. * tree-ssa.c (verify_flow_insensitive_alias_info): Use referenced_var iterator. Use DECL_UID. (delete_tree_ssa): Ditto. (int_tree_map_eq): New function. (int_tree_map_hash): Ditto. * tree-stdarg.c (find_va_list_reference): Use DECL_UID. (va_list_ptr_read): Ditto. (va_list_counter_struct_op): Ditto. (va_list_ptr_write): Ditto. (check_va_list_escapes): Ditto. (check_all_va_list_escapes): Ditto. (execute_optimize_stdarg): Ditto. * tree-tailcall.c (suitable_for_tail_opt_p): Used referenced_var iterator. 2005-06-30 Daniel Berlin <dberlin@dberlin.org> * hashtab.h (HTAB_DELETED_ENTRY): New macro. (HTAB_EMPTY_ENTRY): New macro. 2005-06-30 Daniel Berlin <dberlin@dberlin.org> * hashtab.c (EMPTY_ENTRY): Moved and renamed. (DELETED_ENTRY): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101480 138bc75d-0d04-0410-961f-82ee72b054a4
* include/gdr2005-05-241-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-05-24 Gabriel Dos Reis <gdr@integrable-solutions.net> * libiberty.h (ACONCAT): Properly cast value of alloca(). * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if __cplusplus. libiberty/ 2005-05-24 Gabriel Dos Reis <gdr@integrable-solutions.net> * configure.ac: Check declarations for calloc(), getenv(), malloc(), realloc() and sbrk(). * config.in: Regenerate. * configure: Likewise. * alloca.c (C_alloca): Change "new" to "new_storage". Use XNEWVEC instead of xmalloc. * choose-temp.c (choose_temp_base): Use XNEWVEC instea od xmalloc. * concat.c (liiberty_concat_ptr): Surround definition with an extern "C" block, if __cplusplus. (concat): Use XNEWVEC instead of xmalloc. (reconcat): Likewise. * cp-demangle.c (struct d_print_template): Rename member "template" to "template_decl". Adjust use throughout the file. (d_print_resize): Properly cast return value of realloc(). (cplus_demangle_print): Same for malloc(). (d_demangle): Likewise. * cp-demint.c (cplus_demangle_fill_builtin_type): Rename parameter "typename" to "type_name". * cplus-dem.c (grow_vect): Use XRESIZEVEC instead of xrealloc(). (work_stuff_copy_to_from): Use XNEWVEC insteand of xmalloc(). (demangle_template_value_parm): Likewise. (demangle_template): Likewise. (recursively_demangle): Likewise. (do_hpacc_template_literal): Likewise. (do_arg): Likewise. (remember_type): Likewise. (remember_Ktype): Likewise. (register_Btype): Likewise. (string_need): Use XRESIZEVEC instead of xrealloc(). * dyn-string.c (dyn_string_init): Use XNEWVEC. (dyn_string_new): Use XNEW. (dyn_string_resize): Use XRESIZEVEC. * fnmatch.c (fnmatch): Rename local variable "not" to "negate". * getopt.c (getenv): Declare only if !__cplusplus and !getenv. Otherwise include <stdlib.h>. (exchange): Cast return value of malloc(). * hashtab.c (htab_size): Define as both macro and non-inline function. (htab_elements): Likewise. * getpwd.c (getpwd): Use XNEWVEC. (htab_create_alloc_ex): Use C90 prototype-style. * lrealpath.c (lrealpath): Appropriately cast return value of malloc(). * make-relative-prefix.c (save_string): Likewise. * make-temp-file.c (try_dir): Rename from "try". Adjust use in the file. (choose_tmpdir): Use XNEWVEC. * mkstemps.c (mkstemps): Rename parameter "template" to "pattern". * pex-common.c (pex_init_common): Use XNEW. (pex_add_remove): Use XRESIZEVEC. (pex_run): Likewise. (pex_get_status_and_time): Likewise. * pex-djgpp.c (pex_djgpp_exec_child): Likewise. * pex-msdos.c (pex_init): Use XNEW. (pex_msdos_exec_child): Likewise. (pex_msdos_exec_child): Use XRESIZEVEC. * pex-unix.c (pex_wait): Use XNEW. * pex-win32.c (fix_argv): Use XNEWVEC. * pexecute.c (pwait): Likewise. * setenv.c (setenv): Properly cast return value of malloc(). * sigsetmask.c (sigsetmask): Rename local variables "old" and "new" to "old_sig" and "new_sig". * sort.c (main): Use XNEWVEC. * spaces.c (spaces): Cast return value of malloc(). * strndup.c (strndup): Likewise. * ternary.c (ternary_insert): Use XNEW. * xmalloc.c (malloc, realloc, calloc, sbrk): Surround declaration with an extern "C" block if __cplusplus. * xstrdup.c (xstrdup): Cast return value of memcpy(). * xstrerror.c (strerror): Enclose declaration in an extern "C" block if __cplusplus. * xstrndup.c (xstrndup): Use XNEW. Cast return value of memcpy(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100115 138bc75d-0d04-0410-961f-82ee72b054a4
* Update the address and phone number of the FSF organization.nickc2005-05-101-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99519 138bc75d-0d04-0410-961f-82ee72b054a4
* include/gdr2005-03-271-104/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net> * md5.h: Remove definition and uses of __P. * dyn-string.h: Remove uses of PARAMS. * fibheap.h: Likewise. * floatformat.h: Likewise. * hashtab.h: Likewise. libiberty/ 2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net> Convert libiberty to use ISO C prototype style 4/n. * hashtab.c (higher_prime_index, hash_pointer, eq_pointer, htab_size, htab_elements, htab_mod_1, htab_mod, htab_mod_m2, htab_create_alloc, htab_set_functions_ex, htab_create, htab_try_create, htab_delete, htab_empty, find_empty_slot_for_expand, htab_expand, htab_find_with_hash, htab_find, htab_find_slot_with_hash, htab_find_slot, htab_remove_elt, htab_remove_elt_with_hash, htab_clear_slot, htab_traverse_noresize, htab_traverse, htab_collisions, htab_hash_string, iterative_hash): Use ISO C prototype. * hex.c (hex_init): Likewise. * index.c (index): Likewise. * insque.c (insque, remque): Likewise. * lbasename.c (lbasename): Likewise. * lrealpath.c (lrealpath): Likewise. * make-relative-prefix.c (save_string, split_directories, free_split_directories, make_relative_prefix): Likewise. * make-temp-file.c (try, choose_tmpdir, make_temp_file): Likewise. * md5.c (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream, md5_buffer, md5_process_bytes, md5_process_block): Likewise. * memchr.c (memchr): Likewise. * memcpy.c (memcpy): Likewise. * memmove.c (memmove): Likewise. * gettimeofday.c (gettimeofday): Likewise. * getruntime.c (get_run_time): Likewise. * getpwd.c (getpwd, getpwd): Likewise. * getpagesize.c (getpagesize): Likewise. * getopt1.c (getopt_long, getopt_long_only, main): Likewise. * getopt.c (my_index, exchange, _getopt_initialize, _getopt_internal, getopt, main): Likewise. * getcwd.c (getcwd): Likewise. * fnmatch.c (fnmatch): Likewise. * floatformat.c (floatformat_always_valid, floatformat_i387_ext_is_valid, get_field, floatformat_to_double, put_field, floatformat_from_double, floatformat_is_valid, ieee_test, main): Likewise. * fibheap.c (fibheap_new, fibnode_new, fibheap_compare, fibheap_comp_data, fibheap_insert, fibheap_min, fibheap_min_key, fibheap_union, fibheap_extract_min, fibheap_replace_key_data, fibheap_replace_key, fibheap_replace_data, fibheap_delete_node, fibheap_delete, fibheap_empty, fibheap_extr_min_node, fibheap_ins_root, fibheap_rem_root, fibheap_consolidate, fibheap_link, fibheap_cut, fibheap_cascading_cut, fibnode_insert_after, fibnode_remove): Likewise. * ffs.c (ffs): Likewise. * fdmatch.c (fdmatch): Likewise. * dyn-string.c (dyn_string_init, dyn_string_new, dyn_string_delete, dyn_string_release, dyn_string_resize, dyn_string_clear, dyn_string_copy, dyn_string_copy_cstr, dyn_string_prepend, dyn_string_prepend_cstr, dyn_string_insert, dyn_string_insert_cstr, dyn_string_insert_char, dyn_string_append, dyn_string_append_cstr, dyn_string_append_char, dyn_string_substring, dyn_string_eq): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97113 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_find_slot_with_hash): Make functionbje2005-03-011-5/+5
| | | | | | | documentation clearer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95717 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c: Include limits.h, stdint.h, ansidecl.h.rth2004-04-221-62/+171
| | | | | | | | | | | | | | | | (CHAR_BIT): Provide default. (struct prime_ent, prime_tab): New. (higher_prime_index): Rename from higher_prime_number, return index. (htab_mod_1): New. (htab_mod, htab_mod_m2): Use it. (htab_create_alloc, htab_create_alloc_ex): Store prime index. (htab_expand): Likewise. * configure.ac: Check for stdint.h. (UNSIGNED_64BIT_TYPE): New define and checks to fill it in. * config.in, configure: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81029 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_remove_elt_with_hash): New function.law2004-04-131-2/+16
| | | | | | | | | (htab_remove_elt): Implement in terms of htab_remove_elt_with_hash. * hashtab.h (htab_remove_elt_with_hash): Prototype new function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80641 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_size): Move to top of file; mark inline.rth2004-04-011-49/+71
| | | | | | | | | | | | | | (htab_elements): Likewise. (htab_mod, htab_mod_m2): New. (htab_delete): Refactor htab->size and htab->entries. (htab_empty): Likewise. (find_empty_slot_for_expand): Use htab_size, htab_mod, htab_mod_m2. (htab_find_with_hash, htab_find_slot_with_hash): Likewise. (htab_clear_slot): Use htab_size, htab_elements. (htab_traverse_noresize, htab_traverse): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80278 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_find_slot_with_hash): Decrease n_deletedzlomek2003-10-301-2/+2
| | | | | | | instead of increasing n_elements when inserting to deleted slot. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73090 138bc75d-0d04-0410-961f-82ee72b054a4
* * configure.in: Add check for malloc.h needed bydj2003-06-191-0/+4
| | | | | | | | | | | m68k for function free(). * configure: Regenerated. * config.in: Add HAVE_MALLOC_H. * hashtab.c: include malloc.h were available for free(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68213 138bc75d-0d04-0410-961f-82ee72b054a4
* s/burtle/iterativejason2003-05-071-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66577 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty/jason2003-05-071-0/+138
| | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66565 138bc75d-0d04-0410-961f-82ee72b054a4
* * argv.c: Fix comments.ghazi2003-04-151-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65659 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize.hubicka2003-03-171-4/+19
| | | | | | | | | | * hashtab.h (htab_traverse_noresize): Declare. * hashtab.c (htab_traverse_noresize): Break out from ... * hashtab.c (htab_traverse): ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64496 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_expand): Fix warning.hubicka2003-03-121-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64249 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_expand): Compute the size of hashtable basedhubicka2003-03-121-3/+16
| | | | | | | | on the number of elements actually used. (htab_traverse): Call htab_expand when table is too empty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64246 138bc75d-0d04-0410-961f-82ee72b054a4
* include/drow2003-01-261-2/+70
| | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61820 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_expand): Fix allocation of new entries.zlomek2003-01-201-2/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61507 138bc75d-0d04-0410-961f-82ee72b054a4
* Index: include/ChangeLoggeoffk2002-06-061-0/+23
| | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54300 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge from pch-branch up to tag pch-commit-20020603.geoffk2002-06-041-45/+22
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54232 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (higher_prime_number): Use 7 as minimum.rth2002-04-101-32/+46
| | | | | | | | (find_empty_slot_for_expand): Don't compute hash2 unless needed. (htab_find_slot_with_hash): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52099 138bc75d-0d04-0410-961f-82ee72b054a4
* include:ghazi2001-10-071-4/+4
| | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46060 138bc75d-0d04-0410-961f-82ee72b054a4
* Add commentary.rth2001-08-171-1/+24
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44978 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_hash_string): New.rth2001-08-171-0/+16
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44950 138bc75d-0d04-0410-961f-82ee72b054a4
* fix typomeissner2001-03-151-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40517 138bc75d-0d04-0410-961f-82ee72b054a4
* Silence warningmeissner2001-03-151-39/+32
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40512 138bc75d-0d04-0410-961f-82ee72b054a4
* Silence warningmeissner2001-03-151-32/+40
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40511 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (higher_prime_number): Use a table, rather than ammitchel2000-11-271-22/+56
| | | | | | | seive, to find the next prime. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37775 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_expand): Change to return int. Use calloc orhp2000-11-041-8/+58
| | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37247 138bc75d-0d04-0410-961f-82ee72b054a4
* (htab_create, htab_expand): Correct formatting of comment beforehp2000-11-031-36/+36
| | | | | | | function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37231 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c, partition.c, sort.c, xmemdup.c: Include string.hzack2000-05-291-0/+4
| | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34254 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (hash_pointer): Delete low-order bits which aremmitchel2000-05-161-1/+1
| | | | | | | probably zero, also eliminate a warning on alpha. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33934 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_expand): Add prototype.hubicka2000-04-271-0/+2
| | | | | | | (find_empty_slot_for_expand): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33487 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (hash_pointer, eq_pointer): Make definition static toghazi2000-04-241-3/+3
| | | | | | | | match prototype. (htab_expand): Cast the return value of xcalloc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33391 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.h (hash_pointer): Declare.mmitchel2000-04-241-0/+27
| | | | | | | | | | | | (eq_pointer): Likewise. * hashtab.c (hash_pointer): New function. (eq_pointer): Likewise. (htab_hash_pointer): New variable. (htab_eq_pointer): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33372 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcc/conflict.c (conflict_graph_add): Pass enum type tokenner2000-04-181-47/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33236 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.h (hashval_t): New type.mmitchel2000-03-311-7/+9
| | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32842 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (htab_find_with_hash): Avoid calculating hash2zack2000-03-291-8/+16
| | | | | | | | | unless it will be used. Rearrange loop for better optimization. (higher_prime_number): Add static prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32809 138bc75d-0d04-0410-961f-82ee72b054a4
* Some cleanups/additions for hashtablescrux2000-03-141-8/+60
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32536 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.h (struct htab): Add del_f.zack2000-03-101-1/+26
| | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32459 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c: Remove debugging variables (all_searches,zack2000-03-081-166/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32437 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (sys/types.h): File included.law1999-11-281-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30683 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c: Include stdio.h.law1999-11-101-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30475 138bc75d-0d04-0410-961f-82ee72b054a4
* * hashtab.c (traverse_hash_table): Protect prototype with PARAMS.law1999-11-081-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30453 138bc75d-0d04-0410-961f-82ee72b054a4
* 1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com>zack1999-10-231-1/+36
| | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30138 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (CFILES): Add hashtab.claw1999-10-151-0/+291
(REQUIRED_OFILES): Add hashtab.o (hashtab.o): Add dependencies. * hashtab.c: New file git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30012 138bc75d-0d04-0410-961f-82ee72b054a4