osprey/cygnus/libiberty/hashtab.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include "libiberty.h"
#include "ansidecl.h"
#include "hashtab.h"

Include dependency graph for hashtab.c:

Go to the source code of this file.

Data Types

type  prime_ent

Defines

#define CHAR_BIT   8
#define EMPTY_ENTRY   ((PTR) 0)
#define DELETED_ENTRY   ((PTR) 1)
#define mix(a, b, c)

Functions/Subroutines

static unsigned int
higher_prime_index 
PARAMS ((unsigned long))
static hashval_t htab_mod_1 PARAMS ((hashval_t, hashval_t, hashval_t, int))
static hashval_t htab_mod PARAMS ((hashval_t, htab_t))
static hashval_t hash_pointer PARAMS ((const void *))
static int eq_pointer PARAMS ((const void *, const void *))
static int htab_expand PARAMS ((htab_t))
static PTR
*find_empty_slot_for_expand 
PARAMS ((htab_t, hashval_t))
static unsigned int higher_prime_index (unsigned long n)
static hashval_t hash_pointer (PTR p) const
static int eq_pointer (PTR p1, const PTR p2) const
size_t htab_size (htab_t htab)
size_t htab_elements (htab_t htab)
static hashval_t htab_mod_1 (hashval_t x, hashval_t y, hashval_t inv, int shift)
static hashval_t htab_mod (hashval_t hash, htab_t htab)
static hashval_t htab_mod_m2 (hashval_t hash, htab_t htab)
htab_t htab_create_alloc (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f, htab_alloc alloc_f, htab_free free_f)
htab_t htab_create_alloc_ex (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f, PTR alloc_arg, htab_alloc_with_arg alloc_f, htab_free_with_arg free_f)
void htab_set_functions_ex (htab_t htab, htab_hash hash_f, htab_eq eq_f, htab_del del_f, PTR alloc_arg, htab_alloc_with_arg alloc_f, htab_free_with_arg free_f)
htab_t htab_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f)
htab_t htab_try_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f)
void htab_delete (htab_t htab)
void htab_empty (htab_t htab)
static PTRfind_empty_slot_for_expand (htab_t htab, hashval_t hash)
static int htab_expand (htab_t htab)
PTR htab_find_with_hash (htab_t htab, const PTR element, hashval_t hash)
PTR htab_find (htab_t htab, const PTR element)
PTRhtab_find_slot_with_hash (htab_t htab, const PTR element, hashval_t hash, enum insert_option insert)
PTRhtab_find_slot (htab_t htab, const PTR element, enum insert_option insert)
void htab_remove_elt (htab_t htab, PTR element)
void htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash)
void htab_clear_slot (htab_t htab, PTR *slot)
void htab_traverse_noresize (htab_t htab, htab_trav callback, PTR info)
void htab_traverse (htab_t htab, htab_trav callback, PTR info)
double htab_collisions (htab_t htab)
hashval_t htab_hash_string (PTR p) const
hashval_t iterative_hash (PTR k_in, size_t length, hashval_t initval) const

Variables

htab_hash htab_hash_pointer = hash_pointer
htab_eq htab_eq_pointer = eq_pointer
static struct prime_ent const prime_tab []


Define Documentation

#define CHAR_BIT   8

#define DELETED_ENTRY   ((PTR) 1)

#define EMPTY_ENTRY   ((PTR) 0)

#define mix ( a,
b,
c   ) 

Value:

{ \
  a -= b; a -= c; a ^= (c>>13); \
  b -= c; b -= a; b ^= (a<< 8); \
  c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \
  a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \
  b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \
  c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \
  a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \
  b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \
  c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \
}

Definition at line 902 of file hashtab.c.

Referenced by iterative_hash(), iterative_hash_hashval_t(), iterative_hash_host_wide_int(), and iterative_hash_pointer().


Function Documentation

static int eq_pointer ( PTR  p1,
const PTR  p2 
) const [static]

Definition at line 220 of file hashtab.c.

static PTR* find_empty_slot_for_expand ( htab_t  htab,
hashval_t  hash 
) [static]

Definition at line 475 of file hashtab.c.

References abort, DELETED_ENTRY, EMPTY_ENTRY, htab_mod(), htab_mod_m2(), htab_size, index(), PTR, and size.

Referenced by htab_expand().

static hashval_t hash_pointer ( PTR  p  )  const [static]

Definition at line 211 of file hashtab.c.

References long.

static unsigned int higher_prime_index ( unsigned long  n  )  [static]

Definition at line 183 of file hashtab.c.

References abort, fprintf(), high, low, and prime_ent::prime.

Referenced by htab_create_alloc(), htab_create_alloc_ex(), htab_empty(), and htab_expand().

void htab_clear_slot ( htab_t  htab,
PTR slot 
)

double htab_collisions ( htab_t  htab  ) 

htab_t htab_create ( size_t  size,
htab_hash  hash_f,
htab_eq  eq_f,
htab_del  del_f 
)

Definition at line 402 of file hashtab.c.

Referenced by alloc_mem(), allocate_ssa_names(), analyze_insns_in_loop(), assign_filter_values(), browse_tree(), cgraph_decide_inlining(), compute_ld_motion_mems(), compute_store_table(), conflict_graph_new(), convert_to_eh_region_ranges(), cpp_save_state(), create_name_tags(), create_nesting_tree(), create_structure_vars(), cselib_init(), dataflow_set_init(), DEFUN(), detect_field_duplicates(), fill_hash_bucket(), finalize_nrv(), find_referenced_vars(), fold_build1_stat(), fold_build2_stat(), fold_build3_stat(), for_each_template_parm(), gather_mem_refs(), gt_pch_save(), GTY(), i386_pe_section_type_flags(), init_alias_vars(), init_emit_once(), init_md_reader(), init_md_reader_args_cb(), init_pre(), init_reassoc(), init_update_ssa(), init_varasm_once(), initialize_macros(), initialize_original_copy_tables(), initiate_automata_lists(), initiate_automaton_decl_table(), initiate_bundle_state_table(), initiate_decl_table(), initiate_insn_decl_table(), initiate_states(), instantiate_decl(), instantiate_parameters(), iv_analysis_loop_init(), lang_finalize_version_expr_head(), lower_eh_constructs(), main(), mark_def_site_blocks(), merge_identical_invariants(), move_sese_region_to_fn(), multiply_by_cost(), optimize_inline_calls(), push_gimplify_context(), read_constants(), read_counts_file(), read_rtx(), resolve_mixers(), rewrite_ssa_into_ssa(), rs6000_add_gc_roots(), rtl_seqabstr(), scev_initialize(), see_initialize_data_structures(), see_merge_one_def_extension(), see_set_prop_merged_def(), see_set_prop_unmerged_def(), see_set_prop_unmerged_use(), see_store_reference_and_extension(), sjlj_assign_call_site_values(), ssa_rename_from_initialize(), start_recording_case_labels(), thread_block(), tlink_init(), tree_lower_complex(), tree_sra(), tree_ssa_dominator_optimize(), tree_ssa_iv_optimize_init(), tree_ssa_uncprop(), update_ssa(), verify_stmt_tree(), verify_stmts(), vn_init(), vt_initialize(), and walk_tree_without_duplicates().

htab_t htab_create_alloc ( size_t  size,
htab_hash  hash_f,
htab_eq  eq_f,
htab_del  del_f,
htab_alloc  alloc_f,
htab_free  free_f 
)

Definition at line 303 of file hashtab.c.

Referenced by _cpp_init_files(), htab_create(), htab_try_create(), init_predicate_table(), and main().

htab_t htab_create_alloc_ex ( size_t  size,
htab_hash  hash_f,
htab_eq  eq_f,
htab_del  del_f,
PTR  alloc_arg,
htab_alloc_with_arg  alloc_f,
htab_free_with_arg  free_f 
)

Definition at line 341 of file hashtab.c.

References higher_prime_index(), NULL, prime_ent::prime, PTR, and result.

void htab_delete ( htab_t  htab  ) 

Definition at line 425 of file hashtab.c.

Referenced by _cpp_cleanup_files(), assign_filter_values(), browse_tree(), cgraph_decide_inlining(), cgraph_node_remove_callees(), cgraph_remove_node(), conflict_graph_delete(), convert_to_eh_region_ranges(), create_name_tags(), create_structure_vars(), cselib_finish(), dataflow_set_destroy(), delete_alias_heapvars(), delete_points_to_sets(), delete_tree_ssa(), delete_update_ssa(), detect_field_duplicates(), elfNN_ia64_hash_table_free(), end_recording_case_labels(), finalize_nrv(), find_referenced_vars(), fini_pre(), fini_reassoc(), finish_automata_lists(), finish_automaton_decl_table(), finish_bundle_state_table(), finish_decl_table(), finish_insn_decl_table(), finish_states(), fold_build1_stat(), fold_build2_stat(), fold_build3_stat(), for_each_template_parm(), free_ldst_mems(), free_mem(), free_nesting_tree(), free_opt_info(), free_original_copy_tables(), gather_mem_refs(), gt_pch_save(), htab_del_bucket(), instantiate_decl(), instantiate_parameters(), iv_analysis_done(), lower_eh_constructs(), merge_identical_invariants(), mips_elf_merge_gots(), move_sese_region_to_fn(), optimize_inline_calls(), perfect_nestify(), pop_gimplify_context(), read_counts_file(), rename_variables(), resolve_mixers(), rewrite_blocks(), rewrite_ssa_into_ssa(), rtl_seqabstr(), scev_finalize(), see_free_data_structures(), see_free_ref_s(), sjlj_assign_call_site_values(), ssa_rename_from_free(), store_motion(), thread_block(), tree_duplicate_sese_region(), tree_lower_complex(), tree_sra(), tree_ssa_dominator_optimize(), tree_ssa_iv_optimize_finalize(), tree_ssa_uncprop(), verify_stmt_tree(), verify_stmts(), vn_delete(), vt_finalize(), and walk_tree_without_duplicates().

size_t htab_elements ( htab_t  htab  )  [inline]

Definition at line 239 of file hashtab.c.

void htab_empty ( htab_t  htab  ) 

static int htab_expand ( htab_t  htab  )  [static]

PTR htab_find ( htab_t  htab,
const PTR  element 
)

PTR* htab_find_slot ( htab_t  htab,
const PTR  element,
enum insert_option  insert 
)

Definition at line 706 of file hashtab.c.

References htab_find_slot_with_hash().

Referenced by _frvfdpic_resolve_final_relocs_info(), add_action_record(), add_c_test(), add_condition(), add_ehl_entry(), add_ehspec_entry(), add_mapping(), add_predicate(), add_referenced_var(), add_stmt_to_eh_region(), add_stmt_to_eh_region_fn(), add_to_repl_tbl(), analyze_insns_in_loop(), automata_list_finish(), build_int_cst_wide(), cgraph_find_cycles(), cgraph_insert_node_to_hashtable(), cgraph_node(), cgraph_remove_node(), cgraph_varpool_node(), conflict_graph_add(), convert_nl_goto_reference(), create_name_tags(), DEFUN(), detect_field_duplicates(), dom_opt_finalize_block(), fill_hash_bucket(), finalize_nrv_r(), find_operand_rank(), find_rtx_in_ldst(), find_var_scev_info(), for_each_template_parm_r(), force_const_mem(), frvfdpic_relocs_info_find(), get_cases_for_edge(), get_def_blocks_for(), get_mem_attrs(), get_reg_attrs(), GTY(), htab_remove_elt(), i386_pe_section_type_flags(), init_md_reader(), init_md_reader_args_cb(), insert_automaton_decl(), insert_bundle_state(), insert_decl(), insert_id_for_tree(), insert_insn_decl(), insert_operand_rank(), insert_state(), insns_for_mem_walk(), join_c_conditions(), lang_finalize_version_expr_head(), lookup_const_double(), lookup_element(), lookup_field_for_decl(), lookup_redirection_data(), lookup_tmp_var(), lookup_tramp_for_decl(), make_label_decl(), maybe_remove_eh_handler(), mips_elf_create_local_got_entry(), mips_elf_make_got_per_bfd(), mips_elf_multi_got(), mips_elf_record_global_got_symbol(), mips_elf_record_local_got_symbol(), mips_elf_resolve_final_got_entry(), multiply_by_cost(), names_replaced_by(), new_mode(), output_toc(), pop_local_label(), read_constants(), read_counts_file(), record_equiv(), record_in_finally_tree(), record_range(), record_switch_edge(), register_local_specialization(), remove_equivalence(), remove_exception_handler_label(), remove_stmt_from_eh_region(), remove_stmt_from_eh_region_fn(), save_idents(), see_analyze_merged_def_local_prop(), see_analyze_unmerged_def_local_prop(), see_analyze_use_local_prop(), see_merge_one_def_extension(), see_seek_pre_extension_expr(), see_set_prop_merged_def(), see_set_prop_unmerged_def(), see_set_prop_unmerged_use(), see_store_reference_and_extension(), set_bb_copy(), set_bb_original(), set_instantiated_value(), set_rtx_ptr_loc(), simplify_cond_and_lookup_avail_expr(), uncprop_into_successor_phis(), used_types_insert_helper(), verify_node_sharing(), verify_stmt_tree_r(), and walk_tree().

PTR* htab_find_slot_with_hash ( htab_t  htab,
const PTR  element,
hashval_t  hash,
enum insert_option  insert 
)

Definition at line 635 of file hashtab.c.

References DELETED_ENTRY, EMPTY_ENTRY, htab_expand(), htab_mod(), htab_mod_m2(), htab_size, index(), INSERT, NO_INSERT, NULL, PTR, and size.

Referenced by _cpp_find_file(), add_ttypes_entry(), add_type_for_runtime(), allocate_ssa_names(), cgraph_create_edge(), cgraph_edge(), cgraph_set_call_stmt(), clobber_variable_part(), cselib_lookup(), cselib_lookup_mem(), cvc_insert(), decl_debug_expr_insert(), decl_init_priority_insert(), decl_restrict_base_insert(), decl_shadowed_for_var_insert(), decl_value_expr_insert(), DEFUN(), delete_variable_part(), demangled_hash_lookup(), file_hash_lookup(), find_or_insert_inv(), force_const_mem(), gather_mem_refs_stmt(), gen_rtx_CONST_INT(), get_block_for_section(), get_local_sym_hash(), get_named_section_flags(), get_section(), gt_pch_note_object(), GTY(), hash_tree_cons(), heapvar_insert(), htab_find_slot(), htab_remove_elt_with_hash(), insert_expr_in_table(), ldst_entry(), lookup_avail_expr(), lookup_expr_in_table(), lookup_type_for_runtime(), machopic_indirection_name(), make_cpp_dir(), mangle_conv_op_name_for_type(), mark_constant(), named_section_first_declaration(), new_label_mapper(), niter_for_exit(), output_constant_def(), phi_trans_add(), phi_trans_lookup(), pushdecl_maybe_friend(), record_biv(), record_cond(), referenced_var_check_and_insert(), register_local_specialization(), replace_uses_equiv_to_x_with_y(), set_default_def(), set_named_section_flags(), set_variable_part(), ssa_rename_from_insert(), symbol_hash_lookup(), type_hash_add(), unshare_variable(), up_insert(), variable_union(), variable_was_changed(), vars_copy_1(), vn_add(), vn_add_with_vuses(), vn_lookup(), and vn_lookup_with_vuses().

PTR htab_find_with_hash ( htab_t  htab,
const PTR  element,
hashval_t  hash 
)

hashval_t htab_hash_string ( PTR  p  )  const

static hashval_t htab_mod ( hashval_t  hash,
htab_t  htab 
) [inline, static]

static hashval_t htab_mod_1 ( hashval_t  x,
hashval_t  y,
hashval_t  inv,
int  shift 
) [inline, static]

Definition at line 248 of file hashtab.c.

References __extension__, CHAR_BIT, q, r, t1, t2, t3, and t4.

Referenced by htab_mod(), and htab_mod_m2().

static hashval_t htab_mod_m2 ( hashval_t  hash,
htab_t  htab 
) [inline, static]

void htab_remove_elt ( htab_t  htab,
PTR  element 
)

Definition at line 720 of file hashtab.c.

References htab_remove_elt_with_hash().

Referenced by set_default_def().

void htab_remove_elt_with_hash ( htab_t  htab,
PTR  element,
hashval_t  hash 
)

void htab_set_functions_ex ( htab_t  htab,
htab_hash  hash_f,
htab_eq  eq_f,
htab_del  del_f,
PTR  alloc_arg,
htab_alloc_with_arg  alloc_f,
htab_free_with_arg  free_f 
)

Definition at line 381 of file hashtab.c.

size_t htab_size ( htab_t  htab  )  [inline]

Definition at line 230 of file hashtab.c.

void htab_traverse ( htab_t  htab,
htab_trav  callback,
PTR  info 
)

void htab_traverse_noresize ( htab_t  htab,
htab_trav  callback,
PTR  info 
)

htab_t htab_try_create ( size_t  size,
htab_hash  hash_f,
htab_eq  eq_f,
htab_del  del_f 
)

hashval_t iterative_hash ( PTR  k_in,
size_t  length,
hashval_t  initval 
) const

Definition at line 943 of file hashtab.c.

References a, b, c, len, mix, and size_t.

Referenced by iterative_hash_expr().

static PTR* find_empty_slot_for_expand PARAMS ( (htab_t, hashval_t  )  [static]

static int htab_expand PARAMS ( (htab_t  )  [static]

static int eq_pointer PARAMS ( (const void *, const void *)   )  [static]

static hashval_t hash_pointer PARAMS ( (const void *)   )  [static]

static hashval_t htab_mod PARAMS ( (hashval_t, htab_t  )  [static]

static hashval_t htab_mod_1 PARAMS ( (hashval_t, hashval_t, hashval_t, int)   )  [static]

static unsigned int higher_prime_index PARAMS ( (unsigned long  )  [static]


Variable Documentation

htab_eq htab_eq_pointer = eq_pointer

Definition at line 93 of file hashtab.c.

htab_hash htab_hash_pointer = hash_pointer

Definition at line 92 of file hashtab.c.

struct prime_ent const prime_tab[] [static]

Definition at line 145 of file hashtab.c.


Generated on Wed Apr 8 15:02:56 2009 for Open64 by  doxygen 1.5.6