PIPS
newgen_hash.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HASH_DEFAULT_SIZE   7
 
#define hash_table_undefined   ((hash_table)gen_chunk_undefined)
 Value of an undefined hash_table. More...
 
#define hash_table_undefined_p(h)   ((h)==hash_table_undefined)
 
#define HASH_UNDEFINED_VALUE   ((void *) gen_chunk_undefined)
 value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND, but it's semantically a value; this bottom value will be user-definable in a future release of NewGen More...
 
#define hash_table_empty_p(htp)   (hash_table_entry_count(htp) == 0)
 
#define HASH_MAP(k, v, code, ht)
 
#define HASH_FOREACH(key_type, k, value_type, v, ht)
 
#define hash_put_or_update(h, k, v)   hash_overwrite(h, k, v)
 

Typedefs

typedef enum hash_key_type hash_key_type
 Equality and rank functions are provided for strings, integers, pointers and Newgen chunks. More...
 
typedef struct __hash_tablehash_table
 Define hash_table structure which is hidden. More...
 
typedef _uint(* hash_rank_t) (const void *, size_t)
 
typedef int(* hash_equals_t) (const void *, const void *)
 

Enumerations

enum  hash_key_type {
  hash_string , hash_int , hash_pointer , hash_chunk ,
  hash_private
}
 Equality and rank functions are provided for strings, integers, pointers and Newgen chunks. More...
 

Functions

void hash_warn_on_redefinition (void)
 these function set the variable should_i_warn_on_redefinition to the value true or false More...
 
void hash_dont_warn_on_redefinition (void)
 
bool hash_warn_on_redefinition_p (void)
 
hash_table hash_table_generic_make (hash_key_type key_type, size_t size, hash_equals_t equals_p, hash_rank_t rank)
 this function makes a hash table of size size. More...
 
hash_table hash_table_make (hash_key_type key_type, size_t size)
 
void hash_table_free (hash_table)
 this function deletes a hash table that is no longer useful. More...
 
void hash_table_clear (hash_table)
 Clears all entries of a hash table HTP. More...
 
void * hash_delget (hash_table, const void *, void **)
 deletes key from the hash table. More...
 
void * hash_del (hash_table, const void *)
 this function removes from the hash table pointed to by htp the couple whose key is equal to key. More...
 
void * hash_get (const hash_table, const void *)
 this function retrieves in the hash table pointed to by htp the couple whose key is equal to key. More...
 
list hash_get_default_empty_list (const hash_table, const void *)
 Like hash_get() but returns an empty list instead of HASH_UNDEFINED_VALUE when a key is not found. More...
 
void hash_put (hash_table, const void *, const void *)
 This functions stores a couple (key,val) in the hash table pointed to by htp. More...
 
void hash_update (hash_table, const void *, const void *)
 update key->val in htp, that MUST be pre-existent. More...
 
bool hash_defined_p (const hash_table, const void *)
 true if key has e value in htp. More...
 
void hash_overwrite (hash_table, const void *, const void *)
 hash_put which allows silent overwrite... More...
 
void hash_table_print_header (const hash_table, FILE *)
 this function prints the header of the hash_table pointed to by htp on the opened stream fout. More...
 
void hash_table_print (const hash_table)
 this function prints the content of the hash_table pointed to by htp on stderr. More...
 
void hash_table_fprintf (FILE *, gen_string_func_t, gen_string_func_t, const hash_table)
 This function prints the content of the hash_table pointed to by htp on file descriptor f, using functions key_to_string and value_to string to display the mapping. More...
 
int hash_table_entry_count (const hash_table)
 now we define observers in order to hide the hash_table type... More...
 
int hash_table_size (const hash_table)
 returns the size of the internal array. More...
 
int hash_table_own_allocated_memory (const hash_table)
 
hash_key_type hash_table_type (const hash_table)
 returns the type of the hash_table. More...
 
hash_equals_t hash_table_equals_function (const hash_table)
 Because the hash table data structure is hidden in this source file hash.c and not exported via the newgen_include.h, it is not possible to access its fields in other files, e.g. More...
 
hash_rank_t hash_table_rank_function (const hash_table)
 
void * hash_table_scan (const hash_table, void *, void **, void **)
 
void * hash_map_get (const hash_table, const void *)
 newgen mapping to newgen hash... More...
 
void hash_map_put (hash_table, const void *, const void *)
 
void hash_map_update (hash_table, const void *, const void *)
 
void * hash_map_del (const hash_table, const void *)
 
bool hash_map_defined_p (const hash_table, const void *)
 
_uint hash_string_rank (const void *, size_t)
 en s'inspirant vaguement de Fast Hashing of Variable-Length Text Strings Peter K. More...
 

Macro Definition Documentation

◆ HASH_DEFAULT_SIZE

#define HASH_DEFAULT_SIZE   7

Definition at line 26 of file newgen_hash.h.

◆ HASH_FOREACH

#define HASH_FOREACH (   key_type,
  k,
  value_type,
  v,
  ht 
)
Value:
hash_table NGMID(h) = (ht); \
register void * NGMID(i) = NULL; \
key_type k; \
value_type v; \
while((NGMID(i) = \
hash_table_scan(NGMID(h), NGMID(i), (void**) &k, (void**) &v)))
void * hash_table_scan(const hash_table, void *, void **, void **)
Definition: hash.c:844
#define NGMID(f)
Definition: newgen_types.h:126

Definition at line 71 of file newgen_hash.h.

◆ HASH_MAP

#define HASH_MAP (   k,
  v,
  code,
  ht 
)
Value:
{ \
hash_table NGMID(h) = (ht) ; \
register void * NGMID(i) = NULL; \
void *k, *v; \
while ((NGMID(i) = \
hash_table_scan(NGMID(h), NGMID(i), &k, &v))) { \
code; \
} \
}

Definition at line 60 of file newgen_hash.h.

◆ hash_put_or_update

#define hash_put_or_update (   h,
  k,
 
)    hash_overwrite(h, k, v)

Definition at line 80 of file newgen_hash.h.

◆ hash_table_empty_p

#define hash_table_empty_p (   htp)    (hash_table_entry_count(htp) == 0)

Definition at line 58 of file newgen_hash.h.

◆ hash_table_undefined

#define hash_table_undefined   ((hash_table)gen_chunk_undefined)

Value of an undefined hash_table.

Definition at line 49 of file newgen_hash.h.

◆ hash_table_undefined_p

#define hash_table_undefined_p (   h)    ((h)==hash_table_undefined)

Definition at line 50 of file newgen_hash.h.

◆ HASH_UNDEFINED_VALUE

#define HASH_UNDEFINED_VALUE   ((void *) gen_chunk_undefined)

value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND, but it's semantically a value; this bottom value will be user-definable in a future release of NewGen

Definition at line 56 of file newgen_hash.h.

Typedef Documentation

◆ hash_equals_t

typedef int(* hash_equals_t) (const void *, const void *)

Definition at line 45 of file newgen_hash.h.

◆ hash_key_type

Equality and rank functions are provided for strings, integers, pointers and Newgen chunks.

The user can provide his/her own functions by using hash_private.

◆ hash_rank_t

typedef _uint(* hash_rank_t) (const void *, size_t)

Definition at line 44 of file newgen_hash.h.

◆ hash_table

typedef struct __hash_table* hash_table

Define hash_table structure which is hidden.

The only thing we know about it is that the entries are in an array pointed to by hash_table_array(htp), it contains hash_table_size(htp) elements. These elements can be read with hash_entry_val(...) or hash_entry_key(...). If the key is HASH_ENTRY_FREE or HASH_ENTRY_FREE_FOR_PUT then the slot is empty.

Definition at line 43 of file newgen_hash.h.

Enumeration Type Documentation

◆ hash_key_type

Equality and rank functions are provided for strings, integers, pointers and Newgen chunks.

The user can provide his/her own functions by using hash_private.

Enumerator
hash_string 
hash_int 
hash_pointer 
hash_chunk 
hash_private 

Definition at line 31 of file newgen_hash.h.

31  {
hash_key_type
Equality and rank functions are provided for strings, integers, pointers and Newgen chunks.
Definition: newgen_hash.h:31
@ hash_int
Definition: newgen_hash.h:32
@ hash_chunk
Definition: newgen_hash.h:32
@ hash_string
Definition: newgen_hash.h:32
@ hash_private
Definition: newgen_hash.h:32
@ hash_pointer
Definition: newgen_hash.h:32

Function Documentation

◆ hash_defined_p()

bool hash_defined_p ( const  hash_table,
const void *  key 
)

true if key has e value in htp.

Definition at line 484 of file hash.c.

485 {
486  return hash_get(htp, key)!=HASH_UNDEFINED_VALUE;
487 }
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56

References hash_get(), and HASH_UNDEFINED_VALUE.

Referenced by adjust_goto_from_to(), arguments_are_something(), available_component(), check_mux_availibity(), check_ref(), clean_enclosing_loops(), compute_distribution_context(), compute_distribution_controlization_context(), copy_leaf_out(), copy_obj_in(), create_or_get_a_set_from_control(), create_or_get_an_interval_node(), dagvtx_terapix_priority(), do_gpu_qualify_pointers(), entity_has_values_p(), eov_entity_to_eliminate_p(), freia_allocate_new_images_if_needed(), freia_compile(), freia_dag_optimize(), freia_extract_params(), freia_memory_management_statement(), freia_scalar_rw_dep(), freia_shuffle_move_forward(), fuse_sequences_in_unstructured(), get_upper_model(), glc_call(), hash_map_defined_p(), hash_overwrite(), hwac_freia_api(), init_label(), internal_compute_distribution_context(), quick_multi_already_seen_p(), redeclaration_enter_statement(), ref_count_rwt(), reference_written_p(), register_scalar_communications(), related_images_p(), remove_simple_scalar_pointers(), rename_loop_index(), rename_reference(), rssp_ref(), seen_p(), seq_rwt(), sigmac_name_instances(), sio_ref_rwt(), statement_to_goto_table_flt(), terapix_gram_management(), type_this_entity_if_needed(), and update_used_labels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_del()

void* hash_del ( hash_table  htp,
const void *  key 
)

this function removes from the hash table pointed to by htp the couple whose key is equal to key.

nothing is done if no such couple exists. ??? should I abort ? (FC)

Definition at line 439 of file hash.c.

440 {
441  void * tmp;
442  return hash_delget(htp, key, &tmp);
443 }
void * hash_delget(hash_table htp, const void *key, void **pkey)
deletes key from the hash table.
Definition: hash.c:398

References hash_delget().

Referenced by atomizer_of_external(), atomizer_of_intrinsic(), atomizer_of_loop(), build_first_comb(), build_number_to_statement(), calculate_delay(), da_process_list(), do_array_expansion_aux(), freia_dag_optimize(), init_statement_equivalence_table(), invalidate_expressions_in_statement(), loop_normalize_of_loop(), loop_to_complexity(), phrase_check_reference(), process_used_slots(), remove_common_variables_from_hash_table(), remove_entity_type_stack(), remove_entity_values(), remove_formal_parameters_from_hash_table(), seq_rwt(), sequence_proper_declarations_rename_in_place(), set_del_element(), set_difference(), store_expression(), update_def_into_tasks_table(), and vvs_on_prototypes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_delget()

void* hash_delget ( hash_table  htp,
const void *  key,
void **  pkey 
)

deletes key from the hash table.

returns the val and key

FI: the stack is destroyed by assert; I need to split the statement to put a breakpoint just before the stack disappears.

Definition at line 398 of file hash.c.

402 {
403  hash_entry * hep;
404  void *val;
405  _uint rank;
406 
407  /* FI: the stack is destroyed by assert; I need to split the
408  statement to put a breakpoint just before the stack
409  disappears. */
410  if(!(key!=HASH_ENTRY_FREE && key!=HASH_ENTRY_FREE_FOR_PUT))
411  message_assert("legal input key",
413 
414  htp->n_del++;
415  hep = hash_find_entry(htp, key, &rank, &htp->n_del_iter);
416 
417  if (hep->key != HASH_ENTRY_FREE && hep->key != HASH_ENTRY_FREE_FOR_PUT) {
418  // argh... was hep->key... cannot return it!
419  if (htp->delete_key)
420  htp->delete_key(hep->key), *pkey = NULL;
421  else
422  *pkey = hep->key;
423  val = hep->val;
425  htp->array[rank].val = NULL;
426  htp->n_entry -= 1;
427  htp->n_free_for_puts++;
428  return val;
429  }
430 
431  *pkey = 0;
432  return HASH_UNDEFINED_VALUE;
433 }
#define HASH_ENTRY_FREE_FOR_PUT
Definition: hash.c:53
static hash_entry * hash_find_entry(const hash_table htp, const void *key, _uint *prank, _uint *stats)
return where the key is [to be] stored, depending on the operation.
Definition: hash.c:730
#define HASH_ENTRY_FREE
Some predefined values for the key.
Definition: hash.c:52
static entity rank
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
uintptr_t _uint
Definition: newgen_types.h:54
size_t n_free_for_puts
keep statistics on the life time of the hash table...
Definition: hash.c:76
size_t n_entry
Definition: hash.c:67
size_t n_del
Definition: hash.c:77
size_t n_del_iter
Definition: hash.c:78
hash_free_func_t delete_key
Definition: hash.c:71
hash_entry * array
Definition: hash.c:72
Definition: hash.c:55
void * val
Definition: hash.c:57
void * key
Definition: hash.c:56

References __hash_table::array, __hash_table::delete_key, HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_find_entry(), HASH_UNDEFINED_VALUE, hash_entry::key, message_assert, __hash_table::n_del, __hash_table::n_del_iter, __hash_table::n_entry, __hash_table::n_free_for_puts, rank, and hash_entry::val.

Referenced by gen_delete_tabulated_name(), hash_del(), hash_map_del(), replicate_cycles(), and set_delfree_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_dont_warn_on_redefinition()

void hash_dont_warn_on_redefinition ( void  )

Definition at line 188 of file hash.c.

189 {
191 }
static bool should_i_warn_on_redefinition
internal variable to know we should warm or not
Definition: hash.c:178

References should_i_warn_on_redefinition.

Referenced by comEngine_feasability(), deatomizer(), phrase_remove_dependences(), set_union(), and topologically_sorted_module_list().

+ Here is the caller graph for this function:

◆ hash_get()

void* hash_get ( const hash_table  htp,
const void *  key 
)

this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.

the HASH_UNDEFINED_VALUE pointer is returned if no such couple exists. otherwise the corresponding value is returned.

FI: the stack is destroyed by assert; I need to split the statement to put a breakpoint just before the stack disappears.

else may be there

Definition at line 449 of file hash.c.

450 {
451  hash_entry * hep;
452  _uint n;
453 
454  /* FI: the stack is destroyed by assert; I need to split the
455  statement to put a breakpoint just before the stack
456  disappears. */
457  if(!(key!=HASH_ENTRY_FREE && key!=HASH_ENTRY_FREE_FOR_PUT))
458  message_assert("legal input key",
460 
461  if (!htp->n_entry)
462  return HASH_UNDEFINED_VALUE;
463 
464  /* else may be there */
465  htp->n_get++;
466  hep = hash_find_entry(htp, key, &n, &htp->n_get_iter);
467 
468  return hep->key!=HASH_ENTRY_FREE &&
470 }
size_t n_get
Definition: hash.c:77
size_t n_get_iter
Definition: hash.c:78

References HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_find_entry(), HASH_UNDEFINED_VALUE, hash_entry::key, message_assert, __hash_table::n_entry, __hash_table::n_get, __hash_table::n_get_iter, and hash_entry::val.

Referenced by add_address_of_value(), add_child_parent_pair(), add_conflicts(), add_cycle_dependency(), add_def_into_tasks_table(), add_exec_mmcd(), add_intermediate_alias_value(), add_intermediate_value(), add_local_intermediate_value(), add_local_old_value(), add_new_alias_value(), add_new_value(), add_new_value_name(), add_old_alias_value(), add_old_value(), add_rule(), add_sizeof_value(), add_toggle_inc_statements(), adg_number_to_ordering(), adg_vertex_to_ordering(), adjust_goto_from_to(), aliased_translation_p(), allocated_memory_already_seen_p(), ancestor_cycle_head_to_scc(), apply_number_to_statement(), apply_ordering_to_statement(), attach_ref_to_stat(), bourdoncle_partition(), broadcast_conditions(), build_aliases(), build_bdt_null(), build_esv_list(), build_options_menu_and_panel(), calculate_delay(), call_to_complexity(), callgraph(), check_for_conflict(), check_ref(), check_sharing(), comEngine_distribute(), comEngine_opt_loop_interchange(), common_to_defined_size_p(), common_to_size(), comp_exec_domain(), compare_dfs_weight(), compare_nodes_dim(), compare_unks_frenq(), compute_distribution_controlization_context(), control_to_ancestor(), control_to_label_name(), control_to_replicate(), control_translate_arcs(), controlize_distribution(), controls_to_hash_table(), copy_dfn(), copy_hsearch(), create_or_get_a_set_from_control(), create_or_get_an_interval_node(), create_realFifo_proc(), cutting_conditions(), da_process_list(), dag_terapix_measures(), dag_vertex_pred_imagelets(), dagvtx_terapix_priority(), davinci_print_non_deterministic_unstructured(), distribute(), do_array_expansion(), do_clone_entity(), do_clone_reference(), do_get_operator_id(), do_gpu_qualify_pointers(), do_HRE_memory_mapping_stat(), do_linearize_pointer_is_expression(), do_scalar_renaming_in_successors(), do_slightly_rename_entities(), effects_to_dma(), entity_basic_concrete_type(), entity_to_intermediate_value(), entity_to_new_value(), entity_to_old_value(), eov_get_replaced_enity(), external_value_name(), extract_non_conflicting_statements(), fill_gLoopToToggleEnt(), find_el_with_num(), find_or_create_newInd(), find_or_create_slot(), find_tmp_of_exp(), flint_initialize_statement_def_use_variables(), flint_variable_uninitialize_elsewhere(), fprint_delay(), fprint_statement_complexity(), free_already_seen_p(), freia_allocate_new_images_if_needed(), freia_compile(), freia_dag_optimize(), freia_extract_params(), freia_memory_management_statement(), freia_scalar_rw_dep(), freia_terapix_call(), fsi_cmp(), fuse_sequences_in_unstructured(), gen_get_ancestor(), gen_get_recurse_ancestor(), gen_get_tabulated_name_basic(), generate_code_call(), generate_code_loop(), generate_code_test_HRE(), generate_code_test_proc(), generate_fifo_stats(), generate_fifo_stats2(), generate_ind_fifo_stat2(), generate_io_wp65_code(), generate_mmcd_stat_from_ref(), generate_mmcd_stats_from_ref(), generate_scalar_variables(), generate_scalar_variables_from_list(), generate_stat_from_ref_list_HRE(), generate_stat_from_ref_list_HRE_list(), generic_type_equal_p(), genref_one_statement(), get_cached(), get_cycle_dependencies(), get_dfn(), get_fifo_from_ref(), get_from_entity_type_stack_table(), get_label_control(), get_methods(), get_new_user_file(), get_realFifoNum(), get_stmt_index_coeff(), get_supportedRef_HRE(), get_supportedRef_proc(), get_switch_name_function_for_intrinsic(), get_toggleEnt_from_ref(), get_typing_function_for_intrinsic(), get_upper_model(), get_use_entities_list(), gfc2pips_get_use_st(), glc_call(), gram_param(), hash_defined_p(), hash_get_default_empty_list(), hash_map_get(), hwac_freia_api(), if_conversion_compact_stats(), init_statement_equivalence_table(), insert_mapping(), intrinsic_precedence(), is_c_keyword_typedef(), is_not_trivial_p(), load_control_fix_point(), load_control_postcondition(), load_cycle_fix_point(), load_cycle_temporary_precondition(), load_statement_temporary_precondition(), local_print_statement_set(), loop_nest_to_local_variables(), loop_rwt(), make_all_movement_blocks(), make_array_bounds(), make_global_common_and_initialize(), make_init_newInd_stat(), make_load_blocks(), make_mmcd_stats_from_ref(), make_new_local_variables(), make_reindex(), make_seqStat(), make_store_blocks(), mapping_on_broadcast(), maximal_out_degree_of_points_to_graph(), module_list_sort(), module_name_to_callees(), move_declaration_control_node_declarations_to_statement(), new_value_entity_p(), opt_loop_interchange_fill_lists(), options_select(), other_significant_uses(), outliner_parameters(), partial_broadcast_coefficients(), partition_to_unstructured(), partition_unknowns(), pips_user_value_name(), plc_fprint_dfs(), plc_fprint_distance(), plc_fprint_proto(), plc_make_distance(), plc_make_min_dim(), prepare_array_bounds(), prgm_mapping(), process_code_seq(), process_gLoopToSync_HRE(), process_gLoopToSync_proc(), process_opt_replace(), process_ref_lists(), process_used_slots(), re_do_it(), ref_count_rwt(), reference_conflicting_test_and_update(), reference_conversion_expression(), reference_filter(), reference_to_address_of_value(), reference_written_p(), regenerate_toggles(), register_scalar_communications(), registered_controls_p(), related_effect(), related_images_p(), remove_entity_type_stack(), remove_simple_scalar_pointers(), rename_loop_index(), rename_reference(), rename_statement_declarations(), rename_variable_type(), replace_entities_call_walker(), replace_entities_expression_walker(), replace_entities_in_cusq_context(), replace_entities_loop_walker(), replace_expression_similar_to_pattern(), reuse_pred_slot(), sc_inst(), sc_kernel_specific_agent(), sc_vtx_tostring(), scc_to_dag(), search_scc_bdt(), seq_rwt(), sequence_proper_declarations_rename_in_place(), sesamify(), set_belong_p(), set_control_to_label(), set_dimensions_of_local_variables(), set_intersection(), shared_obj(), shared_obj_in(), shared_simple_in(), sigmac_name_instances(), sigmac_params_decl(), simd_replace_parameters(), sio_ref_rwt(), some_conflicts_between(), sort_unknowns(), spoc_alu_conf(), spoc_measure_conf(), spoc_poc_conf(), spoc_th_conf(), statement_to_goto_table_flt(), step_install(), step_statement_path_get(), storage_space_of_variable(), store_control_fix_point(), store_control_postcondition(), substitute_statement_label(), substitute_variable_by_expression(), terapix_gram_management(), test_rwt(), text_statement_array_comp_regions(), text_statement_continuation_conditions(), tiling_sequence(), top_down_abc_flt(), top_down_abc_rwt(), topological_number_assign_to_module(), transitive_positions(), translate_IO_ref(), type_to_sizeof_value(), uns_rwt(), unstructured_to_complexity(), update_control_postcondition(), update_def_into_tasks_table(), update_erosions(), update_number_to_statement(), update_options(), update_temporary_precondition(), update_toggle_init_stats_list(), use_output_slot(), usual_loop_tiling(), value_entity_p(), value_to_variable(), valuer(), vertex_statement(), vvs_on_prototypes(), words_intrinsic_call(), write_resulting_bdt(), and xml_Chain_Graph().

+ Here is the call graph for this function:

◆ hash_get_default_empty_list()

list hash_get_default_empty_list ( const  hash_table,
const void *  k 
)

Like hash_get() but returns an empty list instead of HASH_UNDEFINED_VALUE when a key is not found.

Definition at line 475 of file hash.c.

475  {
476  list l = (list) hash_get(h, k);
477 
478  return (l == (list) HASH_UNDEFINED_VALUE) ? NIL : l;
479 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
struct cons * list
Definition: newgen_types.h:106
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References hash_get(), HASH_UNDEFINED_VALUE, and NIL.

Referenced by controlize_goto(), covers_labels_p(), get_statement_matches(), init_label(), make_conditional_control(), and update_used_labels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_map_defined_p()

bool hash_map_defined_p ( const  hash_table,
const void *  k 
)

Definition at line 888 of file hash.c.

889 {
890  gen_chunk key;
891  key.e = (void *) k;
892  return hash_defined_p(h, &key);
893 }
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
Definition: hash.c:484
A gen_chunk is used to store every object.
Definition: genC.h:58
void * e
For externals (foreign objects)
Definition: genC.h:65

References gen_chunk::e, and hash_defined_p().

+ Here is the call graph for this function:

◆ hash_map_del()

void* hash_map_del ( const  hash_table,
const void *  k 
)

Definition at line 905 of file hash.c.

906 {
907  gen_chunk key, * oldkeychunk, * val;
908  void * result;
909 
910  key.e = (void *) k;
911  val = hash_delget(h, &key, (void**) &oldkeychunk);
912  message_assert("defined value (entry to delete must be defined!)",
913  val!=HASH_UNDEFINED_VALUE);
914  result = val->e;
915 
916  oldkeychunk->p = NEWGEN_FREED;
917  free(oldkeychunk);
918 
919  val->p = NEWGEN_FREED;
920  free(val);
921 
922  return result;
923 }
void free(void *)
#define NEWGEN_FREED
union gen_chunk * p
Definition: genC.h:69

References gen_chunk::e, free(), hash_delget(), HASH_UNDEFINED_VALUE, message_assert, NEWGEN_FREED, and gen_chunk::p.

Referenced by hash_map_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_map_get()

void* hash_map_get ( const  hash_table,
const void *  k 
)

newgen mapping to newgen hash...

Definition at line 878 of file hash.c.

879 {
880  gen_chunk key, * val;
881  key.e = (void *) k;
882  val = (gen_chunk*) hash_get(h, &key);
883  if (val==HASH_UNDEFINED_VALUE)
884  fatal("no value correspond to key %p", k);
885  return val->e;
886 }
void fatal(char *,...)

References gen_chunk::e, fatal(), hash_get(), and HASH_UNDEFINED_VALUE.

+ Here is the call graph for this function:

◆ hash_map_put()

void hash_map_put ( hash_table  h,
const void *  k,
const void *  v 
)

Definition at line 895 of file hash.c.

896 {
897  gen_chunk
898  * key = (gen_chunk*) alloc(sizeof(gen_chunk)),
899  * val = (gen_chunk*) alloc(sizeof(gen_chunk));
900  key->e = (void *) k;
901  val->e = (void *) v;
902  hash_put(h, key, val);
903 }
char * alloc(int size)
ALLOC is an "iron-clad" version of malloc(3).
Definition: build.c:501
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364

References alloc(), gen_chunk::e, and hash_put().

Referenced by hash_map_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_map_update()

void hash_map_update ( hash_table  h,
const void *  k,
const void *  v 
)

Definition at line 925 of file hash.c.

926 {
927  hash_map_del(h, k);
928  hash_map_put(h, k, v);
929 }
void * hash_map_del(hash_table h, const void *k)
Definition: hash.c:905
void hash_map_put(hash_table h, const void *k, const void *v)
Definition: hash.c:895

References hash_map_del(), and hash_map_put().

+ Here is the call graph for this function:

◆ hash_overwrite()

void hash_overwrite ( hash_table  htp,
const void *  key,
const void *  val 
)

hash_put which allows silent overwrite...

Definition at line 344 of file hash.c.

345 {
346  if (hash_defined_p(htp, key))
347  hash_update(htp, key, val);
348  else
349  hash_put(htp, key, val);
350 }
void hash_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
Definition: hash.c:491

References hash_defined_p(), hash_put(), and hash_update().

Referenced by overwrite_ordering_of_the_statement_to_current_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_put()

void hash_put ( hash_table  htp,
const void *  key,
const void *  val 
)

This functions stores a couple (key,val) in the hash table pointed to by htp.

If a couple with the same key was already stored in the table and if hash_warn_on_redefintion was requested, hash_put complains but replace the old value by the new one. This is a potential source for a memory leak. If the value to store is HASH_UNDEFINED_VALUE or if the key is HASH_ENTRY_FREE or HASH_ENTRY_FREE_FOR_INPUT, hash_put aborts. The restrictions on the key should be avoided by changing the implementation. The undefined value should be user-definable. It might be argued that users should be free to assign HASH_UNDEFINED_VALUE, but they can always perform hash_del() to get the same result

Definition at line 364 of file hash.c.

365 {
366  _uint rank;
367  hash_entry * hep;
368 
369  if (htp->n_entry+1 >= (htp->limit))
370  hash_enlarge_table(htp);
371 
372  message_assert("legal input key",
374  message_assert("input value must be defined", val!=HASH_UNDEFINED_VALUE);
375 
376  htp->n_put++;
377  hep = hash_find_entry(htp, key, &rank, &htp->n_put_iter);
378 
379  if (hep->key != HASH_ENTRY_FREE && hep->key != HASH_ENTRY_FREE_FOR_PUT) {
380  if (should_i_warn_on_redefinition && hep->val != val) {
381  (void) fprintf(stderr, "[hash_put] key redefined: %s\n",
382  hash_print_key(htp->type, key));
383  }
384  hep->val = (void *) val;
385  }
386  else {
387  if (hep->key == HASH_ENTRY_FREE_FOR_PUT)
388  htp->n_free_for_puts--;
389  htp->n_entry += 1;
390  hep->key = htp->store_key? htp->store_key(key): (void*) key;
391  hep->val = (void *) val;
392  }
393 }
static void hash_enlarge_table(hash_table htp)
Private functions.
Definition: hash.c:591
static string hash_print_key(hash_key_type, const void *)
Definition: hash.c:693
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
size_t limit
Definition: hash.c:73
hash_key_func_t store_key
Definition: hash.c:70
size_t n_put
Definition: hash.c:77
hash_key_type type
Definition: hash.c:65
size_t n_put_iter
Definition: hash.c:78

References fprintf(), hash_enlarge_table(), HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_find_entry(), hash_print_key(), HASH_UNDEFINED_VALUE, hash_entry::key, __hash_table::limit, message_assert, __hash_table::n_entry, __hash_table::n_free_for_puts, __hash_table::n_put, __hash_table::n_put_iter, rank, should_i_warn_on_redefinition, __hash_table::store_key, __hash_table::type, and hash_entry::val.

Referenced by _expression_similar_p(), add_address_of_value(), add_child_parent_pair(), add_common_variables_to_hash_table(), add_cycle_dependency(), add_def_into_tasks_table(), add_formal_parameters_to_hash_table(), add_intermediate_alias_value(), add_intermediate_value(), add_local_intermediate_value(), add_local_old_value(), add_new_alias_value(), add_new_value(), add_new_value_name(), add_old_alias_value(), add_old_value(), add_ordering_of_the_statement(), add_ordering_of_the_statement_to_current_mapping(), add_rule(), add_sizeof_value(), add_synonym_values(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_rename_entities(), adg_reorder_statement_number(), aliased_translation_p(), alloc_new_slot(), allocated_memory_already_seen_p(), assign_tmp_to_exp(), attach_ref_to_stat(), bourdoncle_component(), build_aliases(), build_first_comb(), build_options_menu_and_panel(), c_parser_put_new_typedef(), calculate_delay(), call_rwt(), callgraph(), check_for_conflict(), check_ref(), check_stmt(), clean_enclosing_loops(), clean_up_sequences_rewrite(), comp_secs_map_to_listmap(), compute_distribution_context(), compute_distribution_controlization_context(), compute_fifo_from_ref(), compute_ordering_to_dg_mapping(), control_shallow_copy(), controls_to_hash_table(), copy_dfn(), copy_hput(), copy_obj_out_constructed(), create_or_get_a_set_from_control(), create_or_get_an_interval_node(), create_realFifo_proc(), create_statements_of_label(), da_process_list(), dag_fix_image_reuse(), declarations_read(), declare_new_typedef(), do_array_expansion(), do_clone_entity(), do_HRE_memory_mapping_loop(), do_linearize_expression_is_pointer(), do_scalar_renaming_in_successors(), do_slightly_rename_entities(), edge_weight(), effects_to_dma(), effectsmap_to_listmap(), entity_basic_concrete_type(), eov_add_entity_to_eliminate(), fetch_callees_complexities(), fetch_complexity_parameters(), fill_gLoopToOpt(), fill_gLoopToToggleEnt(), fill_gRefToEncLoop_call(), fill_gRefToEncLoop_test(), find_or_create_emulated_shared_variable(), find_or_create_fifo_from_ref(), find_or_create_newInd(), finish_new_gd_ins(), FixCInternalLabels(), flint_initialize_statement_def_use_variables(), free_already_seen_p(), freia_allocate_new_images_if_needed(), freia_dag_optimize(), freia_extract_params(), freia_scalar_rw_dep(), freia_terapix_call(), freia_trpx_compile_one_dag(), fsi_seq_flt(), fsi_sort(), fuse_sequences_in_unstructured(), gen_put_tabulated_name(), gen_recurse_stop(), gen_sharing_p(), generate_code_loop(), generate_scalar_variables(), generate_scalar_variables_from_list(), generic_type_equal_p(), get_a_smem_slot(), get_methods(), get_new_user_file(), get_realFifoNum(), get_sp_of_call_p(), get_supportedRef_proc(), gfc2pips_get_use_st(), glc_call(), handle_include_file(), hash_map_put(), hash_overwrite(), hwac_freia_api(), init_intrinsic_handlers(), init_label(), init_one_statement(), init_statement_equivalence_table(), init_statement_matches_map(), initialize_mu_list(), insert_mapping(), internal_compute_distribution_context(), is_not_trivial_p(), keep_track_of_typedef(), listmap_to_compsecs_map(), listmap_to_effectsmap(), loop_nest_to_local_variables(), loop_normalize_of_loop(), loop_rwt(), loop_to_complexity(), make_mmcd_stats_from_ref(), make_new_local_variables(), make_proto(), make_simd_statement(), maximal_out_degree_of_points_to_graph(), module_list_sort(), module_name_to_callees(), mppa_compile_dag(), opencl_compile_mergeable_dag(), opencl_generate_special_kernel_ops(), outliner_extract_loop_bound(), outliner_smart_references_computation(), parser_init_keyword_typedef_table(), phrase_check_reference(), pips_user_value_name(), pipsdbm_read_statement_mapping(), plc_make_dim(), plc_make_distance(), plc_make_proto(), prepare_array_bounds(), prepare_reindexing(), preprocessor_init_keyword_typedef_table(), put_new_typedef(), put_to_entity_type_stack_table(), quick_multi_already_seen_p(), re_do_it(), ref_count_rwt(), reference_conflicting_test_and_update(), regenerate_toggles(), register_intrinsic_handler(), register_intrinsic_type_descriptor(), register_scalar_communications(), remove_simple_scalar_pointers(), replace_entity(), replicate_cycles(), reset_dfn(), restructure_if_then_else(), reuse_pred_slot(), rssp_ref(), sc_delimiter(), scc_to_dag(), seq_rwt(), sesamify(), set_add_element(), set_as_seen(), set_assign(), set_common_to_size(), set_component(), set_control_to_label(), set_dup(), set_intersection(), set_mux(), set_singleton(), set_union(), shared_obj_in(), shared_simple_in(), sigmac_name_instances(), simd_trace_call(), sort_dfg_node(), sort_unknowns(), statement_to_goto_table_flt(), statements_to_successors(), step_install(), step_statement_path_build(), storage_space_of_variable(), store_control_fix_point(), store_control_postcondition(), supported_ref_p(), sww_seq_rwt(), terapix_gram_management(), terapix_loop_handler(), test_rwt(), top_down_abc_flt(), topological_number_assign_to_module(), transitive_positions(), uns_rwt(), update_def_into_tasks_table(), update_erosions(), update_HRE_mapping_from_list(), update_number_to_statement(), update_temporary_precondition(), update_used_labels(), vvs_on_prototypes(), and wl_rwt().

+ Here is the call graph for this function:

◆ hash_string_rank()

_uint hash_string_rank ( const void *  key,
size_t  size 
)

en s'inspirant vaguement de Fast Hashing of Variable-Length Text Strings Peter K.

Pearson CACM vol 33, nb 6, June 1990 qui ne donne qu'une valeur entre 0 et 255

unsigned int T[256] with random values unsigned int h = 0; for (char * s = (char*) key; *s; s++) h = ROTATION(...,h) ^ T[ (h^(*s)) % 256]; mais...

FC:

GO: v <<= 2, v += *s;

Definition at line 642 of file hash.c.

643 {
644  _uint v = 0;
645  const char * s;
646  for (s = (char*) key; *s; s++)
647  /* FC: */ v = ((v<<7) | (v>>25)) ^ *s;
648  /* GO: v <<= 2, v += *s; */
649  return v % size;
650 }

Referenced by control_rank(), hash_table_generic_make(), and points_to_rank().

+ Here is the caller graph for this function:

◆ hash_table_clear()

void hash_table_clear ( hash_table  htp)

Clears all entries of a hash table HTP.

[pj]

Definition at line 305 of file hash.c.

306 {
307  hash_entry * p, * end ;
308 
309  if (htp->size > max_size_seen) {
310  max_size_seen = htp->size;
311 #ifdef DBG_HASH
312  fprintf(stderr, "[hash_table_clear] maximum size is %d\n", max_size_seen);
313 #endif
314  }
315 
316  end = htp->array + htp->size ;
317  htp->n_entry = 0 ;
318 
319  for ( p = htp->array ; p < end ; p++ ) {
320  p->key = HASH_ENTRY_FREE ;
321  }
322 }
char end
Definition: gtk_status.c:82
static size_t max_size_seen
Definition: hash.c:302
size_t size
Definition: hash.c:66

References __hash_table::array, end, fprintf(), HASH_ENTRY_FREE, hash_entry::key, max_size_seen, __hash_table::n_entry, and __hash_table::size.

Referenced by atomizer_of_unstructured(), dag_terapix_reset_erosion(), free_callees_complexities(), gen_sharing_p(), init_statement_equivalence_table(), seq_rwt(), sesamify(), set_clear(), and shared_pointers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_table_entry_count()

◆ hash_table_equals_function()

hash_equals_t hash_table_equals_function ( hash_table  h)

Because the hash table data structure is hidden in this source file hash.c and not exported via the newgen_include.h, it is not possible to access its fields in other files, e.g.

set.c.

Definition at line 934 of file hash.c.

935 {
936  return h->equals;
937 }
hash_equals_t equals
Definition: hash.c:69

References __hash_table::equals.

Referenced by gen_set_closure_iterate().

+ Here is the caller graph for this function:

◆ hash_table_fprintf()

void hash_table_fprintf ( FILE *  f,
gen_string_func_t  key_to_string,
gen_string_func_t  value_to_string,
const hash_table  htp 
)

This function prints the content of the hash_table pointed to by htp on file descriptor f, using functions key_to_string and value_to string to display the mapping.

it is mostly useful when debugging programs.

Definition at line 548 of file hash.c.

550 {
551  size_t i;
552 
554 
555  for (i = 0; i < htp->size; i++) {
556  hash_entry he;
557 
558  he = htp->array[i];
559 
560  if (he.key != HASH_ENTRY_FREE && he.key != HASH_ENTRY_FREE_FOR_PUT) {
561  fprintf(f, "%s -> %s\n",
562  key_to_string(he.key), value_to_string(he.val));
563  }
564  }
565 }
void hash_table_print_header(hash_table htp, FILE *fout)
this function prints the header of the hash_table pointed to by htp on the opened stream fout.
Definition: hash.c:510
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References __hash_table::array, f(), fprintf(), HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_table_print_header(), hash_entry::key, __hash_table::size, and hash_entry::val.

Referenced by print_value_mappings(), and statement_flatten_declarations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_table_free()

void hash_table_free ( hash_table  htp)

this function deletes a hash table that is no longer useful.

unused memory is freed.

Definition at line 327 of file hash.c.

328 {
329  // free allocated keys if necessary
330  if (htp->delete_key)
331  {
332  size_t i;
333  for (i=0; i<htp->size; i++)
334  if (htp->array[i].key != HASH_ENTRY_FREE &&
335  htp->array[i].key != HASH_ENTRY_FREE_FOR_PUT)
336  htp->delete_key(htp->array[i].key);
337  }
338  gen_free_area((void**) htp->array, htp->size*sizeof(hash_entry));
339  gen_free_area((void**) htp, sizeof(struct __hash_table));
340 }
void gen_free_area(void **p, int size)
free an area.
Definition: list.c:775

References __hash_table::array, __hash_table::delete_key, gen_free_area(), HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_entry::key, and __hash_table::size.

Referenced by adg_dataflowgraph(), aliased_translation_p(), array_expansion(), bourdoncle_free(), bourdoncle_partition(), callgraph(), clean_enclosing_loops(), clean_stats_to_image(), clean_up_sequences_rewrite(), clone_statement(), close_processed_include_cache(), close_seen(), comEngine_distribute(), comEngine_distribute_code(), comEngine_feasability(), comEngine_generate_code(), comEngine_generate_HRECode(), comEngine_generate_procCode(), control_graph(), control_graph_to_interval_graph_format(), controlize_distribution(), controlize_forloop(), controlize_list(), controlize_loop(), controlize_repeatloop(), controlize_sequence(), controlize_test(), controlize_whileloop(), da_process_list(), dag_terapix_measures(), davinci_dump_expression(), discard_statement_to_goto_table(), distribute(), do_isolate_statement(), do_linearize_array(), do_scalar_renaming_in_graph(), entity_basic_concrete_types_reset(), eov_free_ctx(), error_free_value_mappings(), expression_similar_get_context_p(), expression_similar_p(), FixCInternalLabels(), flint_free_statement_def_use_variables(), free_callees_complexities(), free_glopriv(), free_keyword_typedef_table(), free_obj_out(), free_statement_equivalence_table(), free_statement_matches_map(), freia_aipo_compile_calls(), freia_clean_image_occurrences(), freia_close_dep_cache(), freia_compile(), freia_dag_optimize(), freia_mppa_compile_calls(), freia_opencl_compile_calls(), freia_shuffle_move_forward(), freia_spoc_pipeline(), freia_terapix_call(), fs_filter(), fsi_sort(), fuse_sequences_in_unstructured(), gen_allocated_memory(), gen_free(), gen_free_tabulated(), gen_full_free_list(), gen_internal_context_multi_recurse(), gen_local_copy_tree(), gen_write_without_sharing(), generate_code(), generate_code_loop(), generic_print_xml_application(), get_any_comp_regions_text(), get_continuation_condition_text(), get_semantic_text(), hcfg(), HRE_distribute(), if_conversion_compact_stats(), init_statement_equivalence_table(), is_not_trivial_p(), loop_nest_to_wp65_code(), loop_statistics(), make_simd_statement(), maximal_out_degree_of_points_to_graph(), module_to_wp65_modules(), move_declaration_control_node_declarations_to_statement(), mppa_compile_dag(), outliner_parameters(), partition_to_unstructured(), phrase_remove_dependences_rwt(), pop_gen_trav_env(), print_code_or_source_comp(), reindexing(), remove_simple_scalar_pointers(), replace_entity(), replace_expression_similar_to_pattern(), reset_common_size_map(), reset_common_size_map_on_error(), reset_entity_to_size(), reset_entity_type_stack_table(), reset_ordering_to_statement(), reset_vector_to_expressions(), safe_reset_entity_to_size(), sc_delimiter(), scc_to_dag(), search_graph_bdt(), seq_rwt(), set_free(), sigmac_name_instances(), simd_memory_packing(), slightly_rename_entities(), sort_dfg_node(), sort_unknowns(), statement_dependence_graph(), statement_flatten_declarations(), step_install(), step_statement_path_finalize(), sww_seq_rwt(), text_unstructured(), top_down_abc_statement(), topologically_sorted_module_list(), type_structurally_equal_p(), typing_of_expressions(), unsplit_internal(), unstructured_shallow_copy(), and unstructured_to_complexity().

+ Here is the call graph for this function:

◆ hash_table_generic_make()

hash_table hash_table_generic_make ( hash_key_type  key_type,
size_t  size,
hash_equals_t  private_equal_p,
hash_rank_t  private_rank 
)

this function makes a hash table of size size.

if size is less or equal to zero a default size is used. the type of keys is given by key_type (see hash.txt for further details; where is hash.txt?).

private_equal_p() is a predicate to decide if two elements are equal or not

private_rank() returns an integer in interval [0,size-1]

if private_equal_p(e1, e2) then private_rank(e1)==private_rank(e2) or results are unpredicatbale.

No functionality has been used or tested for hash_type==hash_private.

Definition at line 223 of file hash.c.

227 {
228  size_t i;
229  hash_table htp;
230 
231  if (size<HASH_DEFAULT_SIZE) size=HASH_DEFAULT_SIZE - 1;
232  // get the next prime number in the table
233  size = get_next_hash_table_size(size);
234 
235  htp = (hash_table) alloc(sizeof(struct __hash_table));
236  message_assert("allocated", htp);
237 
238  htp->type = key_type;
239  htp->size = size;
240  htp->n_entry = 0;
241  htp->limit = hash_size_limit(size);
242  htp->array = (hash_entry*) alloc(size*sizeof(hash_entry));
243 
244  // initialize statistics
245  htp->n_free_for_puts = 0;
246  htp->n_put = 0;
247  htp->n_get = 0;
248  htp->n_del = 0;
249  htp->n_upd = 0;
250 
251  htp->n_put_iter = 0;
252  htp->n_get_iter = 0;
253  htp->n_del_iter = 0;
254  htp->n_upd_iter = 0;
255 
256  for (i = 0; i < size; i++)
257  htp->array[i].key = HASH_ENTRY_FREE;
258 
259  htp->store_key = NULL;
260  htp->delete_key = NULL;
261 
262  switch(key_type)
263  {
264  case hash_string:
265  htp->equals = (int(*)(const void*,const void*)) hash_string_equal;
266  htp->rank = hash_string_rank;
269  break;
270  case hash_int:
271  htp->equals = (int(*)(const void*,const void*)) hash_int_equal;
272  htp->rank = hash_int_rank;
273  break;
274  case hash_chunk:
275  htp->equals = (int(*)(const void*,const void*)) hash_chunk_equal;
276  htp->rank = (_uint (*)(const void*, _uint)) hash_chunk_rank;
277  break;
278  case hash_pointer:
279  htp->equals = hash_pointer_equal;
280  htp->rank = hash_pointer_rank;
281  break;
282  case hash_private:
283  htp->equals = private_equal_p;
284  htp->rank = private_rank;
285  break;
286  default:
287  fprintf(stderr, "[make_hash_table] bad type %d\n", key_type);
288  abort();
289  }
290 
291  return htp;
292 }
void const char const char const int
static size_t hash_size_limit(size_t current_size)
returns the maximum number of things to hold in a table
Definition: hash.c:152
static _uint hash_pointer_rank(const void *, size_t)
Definition: hash.c:657
static _uint hash_chunk_rank(const gen_chunk *, size_t)
Definition: hash.c:662
static void hash_free_string(void *s)
Definition: hash.c:203
static _uint hash_int_rank(const void *, size_t)
Definition: hash.c:652
static void * hash_store_string(const void *s)
Definition: hash.c:198
static int hash_int_equal(const void *, const void *)
Definition: hash.c:678
static int hash_pointer_equal(const void *, const void *)
Definition: hash.c:683
static int hash_chunk_equal(const gen_chunk *, const gen_chunk *)
Definition: hash.c:688
static int hash_string_equal(const char *, const char *)
Definition: hash.c:667
_uint hash_string_rank(const void *, size_t)
en s'inspirant vaguement de Fast Hashing of Variable-Length Text Strings Peter K.
Definition: hash.c:642
static size_t get_next_hash_table_size(size_t size)
Now we need the table size to be a prime number.
Definition: hash.c:166
#define abort()
Definition: misc-local.h:53
#define HASH_DEFAULT_SIZE
Definition: newgen_hash.h:26
struct __hash_table * hash_table
Define hash_table structure which is hidden.
Definition: newgen_hash.h:43
hash_rank_t rank
Definition: hash.c:68
size_t n_upd_iter
Definition: hash.c:78
size_t n_upd
Definition: hash.c:77

References abort, alloc(), __hash_table::array, __hash_table::delete_key, __hash_table::equals, fprintf(), get_next_hash_table_size(), hash_chunk, hash_chunk_equal(), hash_chunk_rank(), HASH_DEFAULT_SIZE, HASH_ENTRY_FREE, hash_free_string(), hash_int, hash_int_equal(), hash_int_rank(), hash_pointer, hash_pointer_equal(), hash_pointer_rank(), hash_private, hash_size_limit(), hash_store_string(), hash_string, hash_string_equal(), hash_string_rank(), int, hash_entry::key, __hash_table::limit, message_assert, __hash_table::n_del, __hash_table::n_del_iter, __hash_table::n_entry, __hash_table::n_free_for_puts, __hash_table::n_get, __hash_table::n_get_iter, __hash_table::n_put, __hash_table::n_put_iter, __hash_table::n_upd, __hash_table::n_upd_iter, __hash_table::rank, __hash_table::size, __hash_table::store_key, and __hash_table::type.

Referenced by hash_table_make(), and set_generic_make().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_table_make()

hash_table hash_table_make ( hash_key_type  key_type,
size_t  size 
)

Use default functions for equality check and rank computation.

Definition at line 294 of file hash.c.

295 {
296  message_assert("key_type is not hash_private for this interface",
297  key_type!=hash_private);
298  /* Use default functions for equality check and rank computation. */
299  return hash_table_generic_make(key_type, size, NULL, NULL);
300 }
hash_table hash_table_generic_make(hash_key_type key_type, size_t size, hash_equals_t private_equal_p, hash_rank_t private_rank)
this function makes a hash table of size size.
Definition: hash.c:223

References hash_private, hash_table_generic_make(), and message_assert.

Referenced by adg_dataflowgraph(), adg_read_paf(), adg_reorder_statement_number(), aliased_translation_p(), allocate_number_to_statement(), allocate_value_mappings(), array_expansion(), bourdoncle_partition(), build_aliases(), build_options_menu_and_panel(), callgraph(), clean_enclosing_loops(), clean_up_sequences_rewrite(), clone_statement(), comEngine_distribute_code(), comEngine_feasability(), comEngine_generate_code(), comEngine_generate_HRECode(), comEngine_generate_procCode(), compute_communications(), compute_distribution_context(), compute_distribution_controlization_context(), compute_ordering_to_dg_mapping(), compute_statement_to_goto_table(), control_graph(), control_graph_to_interval_graph_format(), controlize_distribution(), controlize_forloop(), controlize_list(), controlize_loop(), controlize_repeatloop(), controlize_sequence(), controlize_test(), controlize_whileloop(), copy_obj_out_constructed(), CreateIntrinsics(), da_process_list(), dag_terapix_measures(), davinci_dump_expression(), declarations_read(), do_HRE_memory_mapping_loop(), do_isolate_statement(), do_scalar_renaming_in_graph(), edge_weight(), entity_basic_concrete_types_init(), eov_make_ctx(), expression_similar_get_context_p(), expression_similar_p(), fetch_callees_complexities(), fetch_complexity_parameters(), FixCInternalLabels(), flint_initialize_statement_def_use_variables(), freia_aipo_compile_calls(), freia_allocate_new_images_if_needed(), freia_build_image_occurrences(), freia_compile(), freia_dag_optimize(), freia_init_dep_cache(), freia_mppa_compile_calls(), freia_opencl_compile_calls(), freia_scalar_rw_dep(), freia_shuffle_move_forward(), freia_spoc_pipeline(), freia_terapix_call(), fsi_sort(), fuse_sequences_in_unstructured(), gen_alloc_constructed(), gen_allocated_memory(), gen_free(), gen_free_tabulated(), gen_full_free_list(), gen_init_tabulated(), gen_internal_context_multi_recurse(), gen_local_copy_tree(), gen_sharing_p(), generate_code(), generic_print_xml_application(), get_methods(), gfc2pips_get_use_st(), hcfg(), HRE_distribute(), hwac_freia_api(), init_entity_type_storage_table(), init_expression_is_pointer(), init_intrinsic_handlers(), init_processed_include_cache(), init_seen(), init_statement_equivalence_table(), init_statement_matches_map(), init_vector_to_expressions(), initialize_common_size_map(), initialize_global_variables(), insert_mapping(), is_not_trivial_p(), kernel_data_mapping(), loop_nest_to_wp65_code(), loop_statistics(), make_keyword_typedef_table(), make_simd_statement(), maximal_out_degree_of_points_to_graph(), module_name_to_callees(), module_to_wp65_modules(), move_declaration_control_node_declarations_to_statement(), mppa_compile_dag(), new_glopriv(), normalize_microcode(), outliner_init(), outliner_smart_references_computation(), partition_to_unstructured(), phrase_remove_dependences_rwt(), pipsdbm_read_statement_mapping(), plc_make_dim(), plc_make_distance(), plc_make_min_dim(), plc_make_proto(), push_gen_trav_env(), register_scalar_communications(), reindexing(), remove_simple_scalar_pointers(), replace_entity(), restructure_if_then_else(), sc_delimiter(), scc_to_dag(), search_graph_bdt(), seq_rwt(), sesamify(), set_entity_to_size(), set_ordering_to_statement(), sigmac_name_instances(), simd_memory_packing(), simd_operator_mappings(), slightly_rename_entities(), sort_dfg_node(), sort_unknowns(), statement_dependence_graph(), statement_flatten_declarations(), statements_to_successors(), static_controlize(), step_install(), step_statement_path_init(), storage_space_of_variable(), sww_seq_rwt(), text_unstructured(), tiling_sequence(), top_down_abc_statement(), topologically_sorted_module_list(), type_structurally_equal_p(), typing_of_expressions(), unsplit_internal(), unstructured_shallow_copy(), and unstructured_to_complexity().

+ Here is the call graph for this function:

◆ hash_table_own_allocated_memory()

int hash_table_own_allocated_memory ( const  hash_table)

Definition at line 869 of file hash.c.

870 {
871  return htp ?
872  sizeof(struct __hash_table) + sizeof(hash_entry)*(htp->size) : 0 ;
873 }

References __hash_table::size.

Referenced by current_shared_obj_table_size(), and set_own_allocated_memory().

+ Here is the caller graph for this function:

◆ hash_table_print()

void hash_table_print ( hash_table  htp)

this function prints the content of the hash_table pointed to by htp on stderr.

it is mostly useful when debugging programs.

Definition at line 525 of file hash.c.

526 {
527  size_t i;
528 
529  hash_table_print_header (htp,stderr);
530 
531  for (i = 0; i < htp->size; i++) {
532  hash_entry he;
533 
534  he = htp->array[i];
535 
536  if (he.key != HASH_ENTRY_FREE && he.key != HASH_ENTRY_FREE_FOR_PUT) {
537  fprintf(stderr, "%zd %s %p\n",
538  i, hash_print_key(htp->type, he.key),
539  he.val);
540  }
541  }
542 }

References __hash_table::array, fprintf(), HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_print_key(), hash_table_print_header(), hash_entry::key, __hash_table::size, __hash_table::type, and hash_entry::val.

+ Here is the call graph for this function:

◆ hash_table_print_header()

void hash_table_print_header ( const  hash_table,
FILE *  fout 
)

this function prints the header of the hash_table pointed to by htp on the opened stream fout.

to be used by pips, we should not print this as it is only for debugging NewGen and it is not important data I (go) comment it. fprintf(fout, "limit %d\n", htp->limit);

Definition at line 510 of file hash.c.

511 {
512  fprintf(fout, "hash_key_type: %d\n", htp->type);
513  fprintf(fout, "size: %zd\n", htp->size);
514  /* to be used by pips, we should not print this
515  as it is only for debugging NewGen and it is not important data
516  I (go) comment it.
517  fprintf(fout, "limit %d\n", htp->limit);
518  */
519  fprintf(fout, "n_entry: %zd\n", htp->n_entry);
520 }

References fprintf(), __hash_table::n_entry, __hash_table::size, and __hash_table::type.

Referenced by hash_table_dump(), hash_table_fprintf(), hash_table_print(), and transformer_map_print().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash_table_rank_function()

hash_rank_t hash_table_rank_function ( const  hash_table)

Definition at line 939 of file hash.c.

940 {
941  return h->rank;
942 }

References __hash_table::rank.

Referenced by gen_set_closure_iterate().

+ Here is the caller graph for this function:

◆ hash_table_scan()

void* hash_table_scan ( const  hash_table,
void *  hentryp_arg,
void **  pkey,
void **  pval 
)

Definition at line 844 of file hash.c.

848 {
849  hash_entry * hentryp = (hash_entry *) hentryp_arg;
850  hash_entry * hend = htp->array + htp->size;
851 
852  if (!hentryp) hentryp = (void*) htp->array;
853 
854  while (hentryp < hend)
855  {
856  void *key = hentryp->key;
857 
858  if ((key !=HASH_ENTRY_FREE) && (key !=HASH_ENTRY_FREE_FOR_PUT))
859  {
860  *pkey = key;
861  if (pval) *pval = hentryp->val;
862  return hentryp + 1;
863  }
864  hentryp++;
865  }
866  return NULL;
867 }

References __hash_table::array, HASH_ENTRY_FREE, HASH_ENTRY_FREE_FOR_PUT, hash_entry::key, __hash_table::size, and hash_entry::val.

Referenced by covers_labels_p(), do_expressions_to_vector(), init_statement_equivalence_table(), invalidate_expressions_in_statement(), make_simd_statement(), and move_declaration_control_node_declarations_to_statement().

+ Here is the caller graph for this function:

◆ hash_table_size()

int hash_table_size ( const  hash_table)

returns the size of the internal array.

Definition at line 825 of file hash.c.

826 {
827  return htp->size;
828 }

References __hash_table::size.

◆ hash_table_type()

hash_key_type hash_table_type ( const  hash_table)

returns the type of the hash_table.

Definition at line 832 of file hash.c.

833 {
834  return htp->type;
835 }

References __hash_table::type.

Referenced by copy_obj_out_constructed().

+ Here is the caller graph for this function:

◆ hash_update()

void hash_update ( hash_table  htp,
const void *  key,
const void *  val 
)

◆ hash_warn_on_redefinition()

void hash_warn_on_redefinition ( void  )

these function set the variable should_i_warn_on_redefinition to the value true or false

Definition at line 183 of file hash.c.

184 {
186 }

References should_i_warn_on_redefinition.

Referenced by comEngine_feasability(), deatomizer(), fetch_complexity_parameters(), make_scalar_integer_entity(), phrase_remove_dependences(), rice_dependence_graph(), set_union(), and static_controlize().

+ Here is the caller graph for this function:

◆ hash_warn_on_redefinition_p()

bool hash_warn_on_redefinition_p ( void  )

Definition at line 193 of file hash.c.

194 {
196 }

References should_i_warn_on_redefinition.

Referenced by set_union().

+ Here is the caller graph for this function: