newgen_set.h File Reference

#include "newgen_types.h"
#include "newgen_hash.h"
Include dependency graph for newgen_set.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define set_undefined   ((set)(-16))
#define set_undefined_p(s)   ((s)==set_undefined)
#define set_equal(s1, s2)   set_equal_p(s1,s2)
#define SET_MAP(element, code, the_set)
#define SET_FOREACH(type_name, the_item, the_set)
 enumerate set elements in their internal order.

Typedefs

typedef struct _set_chunkset

Enumerations

enum  set_type { set_string = hash_string, set_int = hash_int, set_pointer = hash_pointer, set_private = hash_private }
 

Note: hash_chunk is not included in set_type.

More...

Functions

set set_generic_make (set_type, hash_equals_t, hash_rank_t)
 what about this replacement? define SET_MAP(the_item, the_code, the_set) \ { SET_FOREACH(void *, the_item, the_set) the_code; }
set set_make (set_type)
 Create an empty set of any type but hash_private.
set set_singleton (set_type, const void *)
 create a singleton set of any type but hash_private
set set_dup (const set)
void set_free (set)
int set_size (const set)
 returns the number of items in s.
int set_own_allocated_memory (const set)
set_type set_get_type (const set)
 return the type of set s
hash_table set_private_get_hash_table (const set)
 return the internal hash table of set s
bool set_belong_p (const set, const void *)
bool list_in_set_p (const list, const set)
bool set_equal_p (const set, const set)
 returns whether s1 == s2
bool set_empty_p (const set)
 tell whether set s is empty.
bool set_inclusion_p (const set, const set)
 return whether s1 s2
bool set_intersection_p (const set, const set)
 returns whether s1 n s2 <> 0 complexity of the intersection
set set_clear (set)
 Assign the empty set to s s := {}.
set set_assign (set, const set)
 Assign a set with the content of another set.
set set_append_list (set, const list)
 add list l items to set s, which is returned.
set set_assign_list (set, const list)
 assigns a list contents to a set all duplicated elements are lost
set set_add_element (set, const set, const void *)
set set_union (set, const set, const set)
set set_intersection (set, const set, const set)
set set_difference (set, const set, const set)
set set_del_element (set, const set, const void *)
set set_delfree_element (set, const set, const void *)
 May be useful for string sets .
void gen_set_closure_iterate (void(*)(void *, set), set, bool)
void gen_set_closure (void(*)(void *, set), set)
 a set-based implementation of gen_closure that does not go twice in the same object.
string set_to_string (string, const set, gen_string_func_t)
 return allocated string for set s
void set_fprint (FILE *, string, const set, gen_string_func_t)
 print set s to file stream out.
list set_to_sorted_list (const set, gen_cmp_func_t)
list set_to_list (const set)
 create a list from a set the set is not freed

Define Documentation

#define set_equal ( s1,
s2   )     set_equal_p(s1,s2)

Definition at line 52 of file newgen_set.h.

#define SET_FOREACH ( type_name,
the_item,
the_set   ) 
Value:
hash_table _hash_##the_item =                                           \
    set_private_get_hash_table(the_set);                                \
  void * _value_##the_item;                                             \
  void * _point_##the_item = NULL;                                      \
  type_name the_item;                                                   \
  for (; (_point_##the_item =                                           \
          hash_table_scan(_hash_##the_item,                             \
                          _point_##the_item,                            \
                          (void **) &the_item,                          \
                          &_value_##the_item));)

enumerate set elements in their internal order.

caution, this enumeration is not deterministic!

Parameters:
var_type is the plain type name (*not* capitalized).
var variable name, unique in scope
the_set expression that lead to a set, for instance a variable

SET_FOREACH(var_type, var, the_set) { instructions; }

note that due to variables which are declared in the current scope:

  • the "var" name must be unique in the scope, and is used as a suffix for declaring temporaries.
  • put braces around the macro when using it as a loop body or condition case.

Ronan, I wish to avoid an ugly double macro expansion hack here. Just change the scalar variable name "var" if need be.

Definition at line 81 of file newgen_set.h.

Referenced by basic_deref_addr(), basic_deref_array(), basic_deref_deref(), basic_deref_field(), basic_deref_ptr_to_field(), basic_deref_ref(), basic_field_addr(), basic_ptr_to_field_addr(), basic_ptr_to_field_field(), basic_ptr_to_field_ref(), basic_ref_addr(), basic_ref_array(), basic_ref_deref(), basic_ref_field(), basic_ref_heap(), basic_ref_ptr_to_field(), basic_ref_ref(), dag_cleanup_other_statements(), dag_compute_outputs(), dag_optimize(), do_unfolding(), entity_generate_missing_declarations(), for_to_do_loop_conversion(), freia_spoc_pipeline(), gen_set_closure_iterate(), get_referenced_entities(), has_similar_entity(), image_is_needed(), inline_expression_call(), merge_points_to_set(), print_entity_set(), private_variables(), set_inclusion_p(), set_to_list(), set_to_string_buffer(), struct_double_pointer(), and struct_pointer().

#define SET_MAP ( element,
code,
the_set   ) 
#define set_undefined   ((set)(-16))
#define set_undefined_p ( s   )     ((s)==set_undefined)

Typedef Documentation

typedef struct _set_chunk* set

Definition at line 38 of file newgen_set.h.


Enumeration Type Documentation

enum set_type

Note: hash_chunk is not included in set_type.

Enumerator:
set_string 
set_int 
set_pointer 
set_private 

Definition at line 41 of file newgen_set.h.

00041              {
00042   set_string = hash_string ,
00043   set_int = hash_int,
00044   set_pointer = hash_pointer,
00045   set_private = hash_private
00046 } set_type ;


Function Documentation

void gen_set_closure ( void(*)(void *, set iterate,
set  initial 
)

a set-based implementation of gen_closure that does not go twice in the same object.

FC 27/10/95.

Definition at line 360 of file set.c.

References gen_set_closure_iterate(), and TRUE.

Referenced by propagate_the_usefulness_through_the_predecessor_graph().

00361 {
00362   gen_set_closure_iterate(iterate, initial, TRUE);
00363 }

Here is the call graph for this function:

Here is the caller graph for this function:

void gen_set_closure_iterate ( void(*)(void *, set ,
set  ,
bool   
)

Definition at line 314 of file set.c.

References hash_table_equals_function(), hash_table_rank_function(), seen, set_assign(), set_clear(), set_difference(), set_empty_p(), SET_FOREACH, set_free(), set_generic_make(), set_union(), __hash_table::type, and x.

Referenced by gen_set_closure().

00317 {
00318   set curr, next, seen;
00319   set_type t = initial->type;
00320 
00321   seen = set_generic_make(t,
00322                           hash_table_equals_function(initial->table),
00323                           hash_table_rank_function(initial->table));
00324   curr = set_generic_make(t,
00325                           hash_table_equals_function(initial->table),
00326                           hash_table_rank_function(initial->table));
00327   next = set_generic_make(t,
00328                           hash_table_equals_function(initial->table),
00329                           hash_table_rank_function(initial->table));
00330 
00331   set_assign(curr, initial);
00332 
00333   while (!set_empty_p(curr))
00334   {
00335     SET_FOREACH(void *, x, curr)
00336       iterate(x, next);
00337 
00338     if (dont_iterate_twice)
00339     {
00340       set_union(seen, seen, curr);
00341       set_difference(curr, next, seen);
00342     }
00343     else
00344     {
00345       set_assign(curr, next);
00346     }
00347     set_clear(next);
00348   }
00349 
00350   set_free(curr);
00351   set_free(seen);
00352   set_free(next);
00353 
00354 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool list_in_set_p ( const list  l,
const set  s 
)
Returns:
whether all items in l are in s

Definition at line 162 of file set.c.

References c, FOREACH, s, and set_belong_p().

00163 {
00164   FOREACH(chunk, c, l)
00165     if (!set_belong_p(s, c))
00166       return false;
00167   return true;
00168 }

Here is the call graph for this function:

set set_add_element ( set  s1,
const set  s2,
const void *  e 
)
Returns:
s1 = s2 u { e }.

Definition at line 137 of file set.c.

References HASH_MAP, hash_put(), s1, set_belong_p(), set_clear(), and v.

Referenced by __attribute__(), add_entity_to_defs(), add_loop_index_entity(), add_read_resource(), add_stat_called_user_entities(), add_stat_referenced_entities(), add_write_resource(), basic_deref_addr(), basic_deref_array(), basic_deref_deref(), basic_deref_field(), basic_deref_ptr_to_field(), basic_deref_ref(), basic_field_addr(), basic_ptr_to_field_addr(), basic_ptr_to_field_field(), basic_ptr_to_field_ref(), basic_ref_addr(), basic_ref_array(), basic_ref_deref(), basic_ref_field(), basic_ref_heap(), basic_ref_ptr_to_field(), basic_ref_ref(), build_statement_to_statement_dependence_mapping(), callgraph(), check_control_coherency(), check_physical_resource_up_to_date(), compact_list(), dag_cleanup_other_statements(), dag_compute_outputs(), dag_optimize(), display_linked_control_nodes(), distributable_statement_p(), do_unfolding(), DoInvariantsStatements(), DoRedundantsStatements(), expand_call(), expand_reference(), find_covering_reference_path(), flint_initialize_statement_def_use_variables(), freia_spoc_pipeline(), gen_copy_set(), gen_list_cyclic_p(), genkill_one_statement(), genread_parse(), get_more_derived_resources(), get_referenced_entities(), inline_split_declarations(), invariant_vertex_to_invariant_entities(), iterate_through_the_predecessor_graph(), kill_statement(), loop_flt(), merge_points_to_set(), recursive_functional_type_supporting_entities(), recursive_type_supporting_entities(), recursive_type_supporting_references(), recursive_type_supporting_types(), reference_flt(), region_of_statement(), remove_all_unreachable_controls_of_an_unstructured(), rmake(), scc_region(), set_add_scalars(), set_append_list(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), single_image_assignement_p(), statement_clean_declarations_call_walker(), statement_clean_declarations_list_walker(), statement_clean_declarations_loop_walker(), statement_clean_declarations_reference_walker(), struct_double_pointer(), struct_pointer(), subtitute_induction_statement_in(), update_number_to_statement(), use_def_deal_if_useful(), and vertices_to_statements().

00138 {
00139   if( s1 == s2 ) {
00140     if (! set_belong_p(s1, e))
00141       hash_put(s1->table, e, e);
00142     return( s1 ) ;
00143   }
00144   else {
00145     set_clear( s1 ) ;
00146     HASH_MAP( k, v, {hash_put( s1->table, k, v ) ;}, s2->table ) ;
00147     if (! set_belong_p(s1, e))
00148       hash_put(s1->table, e, e);
00149     return( s1 ) ;
00150   }
00151 }

Here is the call graph for this function:

set set_append_list ( set  s,
const list  l 
)

add list l items to set s, which is returned.

Parameters:
s modified set
l provided list

Definition at line 402 of file set.c.

References FOREACH, i, s, and set_add_element().

Referenced by get_private_entities_walker(), and set_assign_list().

00403 {
00404   FOREACH(chunk, i, l)
00405     set_add_element(s, s, i);
00406   return s;
00407 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_assign ( set  s1,
const set  s2 
)

Assign a set with the content of another set.

Parameters:
s1 the set to write into
s2 the set to copy

If the same set is given twice, nothing is done.

Returns:
the target set.

Definition at line 114 of file set.c.

References HASH_MAP, hash_put(), s1, set_clear(), and v.

Referenced by basic_deref_addr(), basic_ref_addr(), gen_copy_set(), gen_set_closure_iterate(), genkill_block(), genkill_unstructured(), inout_block(), inout_control(), inout_loop(), inout_statement(), inout_test(), inout_unstructured(), points_to_assignment(), points_to_call(), points_to_do_whileloop(), points_to_expression(), points_to_forloop(), points_to_intrinsic(), points_to_sequence(), points_to_statement(), points_to_whileloop(), recursive_points_to_statement(), set_del_element(), set_delfree_element(), set_difference(), set_union(), and struct_decomposition().

00115 {
00116   if (s1 == s2) {
00117     return s1;
00118   }
00119   else {
00120     set_clear(s1);
00121     HASH_MAP(k, v, hash_put( s1->table, k, v ), s2->table);
00122     return s1;
00123   }
00124 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_assign_list ( set  s,
const list  l 
)

assigns a list contents to a set all duplicated elements are lost

Parameters:
s set being assigned to.
l list to turn into a set

Definition at line 416 of file set.c.

References s, set_append_list(), and set_clear().

Referenced by concat_new_entities(), do_unfolding(), freia_spoc_pipeline(), guard_expanded_statement_if_needed(), is_consummed_by_vertex(), sequence_flt(), and sort_entities_with_dep().

00417 {
00418   set_clear(s);
00419   return set_append_list(s, l);
00420 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool set_belong_p ( const set  s,
const void *  e 
)
Returns:
whether e s.

Definition at line 155 of file set.c.

References hash_get(), HASH_UNDEFINED_VALUE, and s.

Referenced by __attribute__(), add_entity_to_defs(), add_loop_index_entity(), add_stat_called_user_entities(), add_stat_referenced_entities(), AK_ignore_this_vertex(), callgraph(), check_control_coherency(), check_physical_resource_up_to_date(), check_private_variables_call_walker(), common_ignore_this_vertex(), compact_list(), concat_new_entities(), dag_compute_outputs(), dag_optimize(), display_linked_control_nodes(), do_resource_usage_check(), DoRedundantsStatements(), expand_call(), expand_expression(), expand_reference(), find_covering_reference_path(), flint_variable_uninitialize_elsewhere(), freia_cmp_statement(), freia_spoc_pipeline(), gen_list_cyclic_p(), get_more_derived_resources(), guard_expanded_statement_if_needed(), inv_entity_filter(), invariant_vertex_to_invariant_entities(), list_in_set_p(), merge_points_to_set(), recursive_functional_type_supporting_entities(), recursive_type_supporting_entities(), recursive_type_supporting_references(), recursive_type_supporting_types(), remove_all_unreachable_controls_of_an_unstructured(), remove_this_statement_if_useless(), rice_update_dependence_graph(), rmake(), search_parallel_loops(), set_add_element(), set_inclusion_p(), single_image_assignement_p(), statement_clean_declarations_helper(), subtitute_induction_statement_in(), subtitute_induction_statement_out(), unused_local_variable_p(), update_preserved_resources(), vertex_invariant_p(), and vertex_redundant_p().

00156 {
00157   return hash_get(s->table, e) != HASH_UNDEFINED_VALUE;
00158 }

Here is the call graph for this function:

set set_clear ( set   ) 

Assign the empty set to s s := {}.

Definition at line 287 of file set.c.

References hash_table_clear(), and s.

Referenced by check_for_effected_statement(), do_resource_usage_check(), gen_set_closure_iterate(), genkill_one_statement(), genkill_unstructured(), init_one_statement(), init_resource_usage_check(), inout_control(), merge_points_to_set(), points_to_do_whileloop(), points_to_forloop(), points_to_whileloop(), set_add_element(), set_assign(), set_assign_list(), and set_intersection().

00288 {
00289   hash_table_clear(s->table);
00290   return s;
00291 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_del_element ( set  s1,
const set  s2,
const void *  e 
)
Returns:
s1 = s2 - { e }.

Definition at line 226 of file set.c.

References hash_del(), s1, and set_assign().

Referenced by delete_named_resources(), do_resource_usage_check(), freia_spoc_pipeline(), is_consummed_by_vertex(), mask_effects(), sort_entities_with_dep(), subtitute_induction_statement_out(), and update_preserved_resources().

00227 {
00228   set_assign( s1, s2 ) ;
00229   hash_del( s1->table, e );
00230   return s1;
00231 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_delfree_element ( set  s1,
const set  s2,
const void *  e 
)

May be useful for string sets .

.. NOT TESTED

FI:Confusing for Newgen users because gen_free() is expected?

Definition at line 237 of file set.c.

References free(), hash_delget(), s1, and set_assign().

00238 {
00239   void * pe;
00240   set_assign(s1, s2);
00241   (void) hash_delget(s1->table, e ,&pe);
00242   free(pe);
00243   return s1;
00244 }

Here is the call graph for this function:

set set_difference ( set  s1,
const set  s2,
const set  s3 
)
set set_dup ( const set  s  ) 
Returns:
duplicated set

Definition at line 128 of file set.c.

References HASH_MAP, hash_put(), n, s, set_make(), and v.

00129 {
00130   set n = set_make(s->type);
00131   HASH_MAP(k, v, hash_put(n->table, k, v ), s->table);
00132   return n;
00133 }

Here is the call graph for this function:

bool set_empty_p ( const set  s  ) 

tell whether set s is empty.

returnn s=={}

Definition at line 309 of file set.c.

References s, and set_size().

Referenced by do_unfolding(), freia_scalar_rw_dep(), freia_spoc_pipeline(), gen_set_closure_iterate(), induction_substitution(), points_to_assignment(), points_to_storage(), set_intersection_p(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), and subtitute_induction_statement_in().

00310 {
00311   return set_size(s)==0;
00312 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool set_equal_p ( const   set,
const   set 
)

returns whether s1 == s2

Definition at line 277 of file set.c.

References s1, set_inclusion_p(), and set_size().

Referenced by inout_control(), points_to_do_whileloop(), points_to_forloop(), and points_to_whileloop().

00278 {
00279   if (s1==s2) return true;
00280   return set_size(s1)==set_size(s2) &&
00281     set_inclusion_p(s1, s2) && set_inclusion_p(s2, s1);
00282 }

Here is the call graph for this function:

Here is the caller graph for this function:

void set_fprint ( FILE *  ,
string  ,
const   set,
gen_string_func_t   
)

print set s to file stream out.

Definition at line 466 of file set.c.

References s, set_to_string_buffer(), string_buffer_free(), and string_buffer_to_file().

Referenced by dag_compute_outputs().

00467 {
00468   string_buffer sb = set_to_string_buffer(name, s, item_name);
00469   string_buffer_to_file(sb, out);
00470   putc('\n', out);
00471   string_buffer_free(&sb);
00472 }

Here is the call graph for this function:

Here is the caller graph for this function:

void set_free ( set   ) 

Definition at line 293 of file set.c.

References gen_free_area(), hash_table_free(), and s.

00294 {
00295   hash_table_free(s->table);
00296   gen_free_area((void**) s, sizeof(struct _set_chunk));
00297 }

Here is the call graph for this function:

set set_generic_make ( set_type  typ,
hash_equals_t  private_equal_p,
hash_rank_t  private_rank 
)

what about this replacement? define SET_MAP(the_item, the_code, the_set) \ { SET_FOREACH(void *, the_item, the_set) the_code; }

functions implemented in set.c

what about this replacement? define SET_MAP(the_item, the_code, the_set) \ { SET_FOREACH(void *, the_item, the_set) the_code; }

discrepancy: size_t sometimes, _uint elsewherewhy not use the functional types now defined in newgen_hash.h?

Definition at line 71 of file set.c.

References alloc(), hash_table_generic_make(), INITIAL_SET_SIZE, and message_assert.

Referenced by basic_deref_addr(), basic_deref_array(), basic_deref_deref(), basic_deref_field(), basic_deref_ptr_to_field(), basic_deref_ref(), basic_field_addr(), basic_ptr_to_field_addr(), basic_ptr_to_field_field(), basic_ptr_to_field_ref(), basic_ref_addr(), basic_ref_array(), basic_ref_deref(), basic_ref_field(), basic_ref_heap(), basic_ref_ptr_to_field(), basic_ref_ref(), gen_set_closure_iterate(), merge_points_to_set(), points_to_assignment(), points_to_call(), points_to_do_whileloop(), points_to_expression(), points_to_forloop(), points_to_intrinsic(), points_to_sequence(), points_to_statement(), points_to_test(), points_to_whileloop(), recursive_points_to_statement(), set_intersection(), set_make(), struct_decomposition(), struct_double_pointer(), and struct_pointer().

00074 {
00075   set hp = (set) alloc(sizeof(struct _set_chunk));
00076   message_assert("allocated", hp);
00077 
00078   hp->table = hash_table_generic_make( typ,
00079                                        INITIAL_SET_SIZE,
00080                                        private_equal_p,
00081                                        private_rank ) ;
00082   hp->type = typ ;
00083   return hp;
00084 }

Here is the call graph for this function:

Here is the caller graph for this function:

set_type set_get_type ( const   set  ) 

return the type of set s

Definition at line 63 of file set.c.

References s.

00064 {
00065   return s->type;
00066 }

bool set_inclusion_p ( const   set,
const   set 
)

return whether s1 s2

Definition at line 266 of file set.c.

References i, s1, set_belong_p(), and SET_FOREACH.

Referenced by set_equal_p().

00267 {
00268   if (s1==s2) return true;
00269   SET_FOREACH(void *, i, s1)
00270     if (!set_belong_p(s2, i))
00271       return false;
00272   return true;
00273 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_intersection ( set  s1,
const set  s2,
const set  s3 
)
Returns:
s1 = s2 n s3.

Definition at line 190 of file set.c.

References hash_get(), HASH_MAP, hash_put(), hash_table_equals_function(), hash_table_rank_function(), HASH_UNDEFINED_VALUE, s1, set_clear(), set_generic_make(), and v.

Referenced by do_unfolding(), for_to_do_loop_conversion(), freia_scalar_rw_dep(), genkill_test(), genkill_unstructured(), merge_points_to_set(), and set_intersection_p().

00191 {
00192   if( s1 != s2 && s1 != s3 ) {
00193     set_clear( s1 ) ;
00194     HASH_MAP( k, v, {if( hash_get( s2->table, k )
00195                          != HASH_UNDEFINED_VALUE )
00196           hash_put( s1->table, k, v ) ;},
00197       s3->table ) ;
00198     return( s1 ) ;
00199   }

Here is the call graph for this function:

Here is the caller graph for this function:

bool set_intersection_p ( const   set,
const   set 
)

returns whether s1 n s2 <> 0 complexity of the intersection

Definition at line 249 of file set.c.

References s1, set_empty_p(), set_free(), set_intersection(), set_make(), and set_pointer.

Referenced by is_consummed_by_vertex().

00250 {
00251   bool non_empty_intersection;
00252   if (set_empty_p(s1) || set_empty_p(s2))
00253     non_empty_intersection = false;
00254   else
00255   {
00256     set inter = set_make(set_pointer);
00257     set_intersection(inter, s1, s2);
00258     non_empty_intersection = !set_empty_p(inter);
00259     set_free(inter);
00260   }
00261   return non_empty_intersection;
00262 }

Here is the call graph for this function:

Here is the caller graph for this function:

set set_make ( set_type   ) 

Create an empty set of any type but hash_private.

Use default functions for equality check and rank computation.

Definition at line 87 of file set.c.

References hash_private, message_assert, NULL, and set_generic_make().

Referenced by build_number_to_statement(), build_statement_to_statement_dependence_mapping(), callgraph(), check_control_coherency(), check_for_effected_statement(), compact_list(), concat_new_entities(), create_or_get_a_set_from_control(), dag_cleanup_other_statements(), dag_compute_outputs(), dag_optimize(), delete_all_resources(), delete_derived_resources(), display_linked_control_nodes(), distributable_loop(), do_unfolding(), DoInvariantsStatements(), DoRedundantsStatements(), dynamic_cleanup(), entity_generate_missing_declarations(), find_covering_reference_path(), flint_initialize_statement_def_use_variables(), for_to_do_loop_conversion(), fortran_constant_expression_supporting_entities(), freia_scalar_rw_dep(), freia_spoc_pipeline(), functional_type_supporting_entities(), functional_type_supporting_types(), gen_copy_set(), gen_list_cyclic_p(), genread_parse(), get_private_entities(), get_referenced_entities(), guard_expanded_statement_if_needed(), icm_codegen(), induction_substitution(), init_make_cache(), init_resource_usage_check(), inline_split_declarations(), is_consummed_by_vertex(), outliner(), recursive_functional_type_supporting_entities(), region_of_loop(), remove_all_unreachable_controls_of_an_unstructured(), scc_region(), sequence_flt(), set_dup(), set_intersection_p(), set_singleton(), SimplifyGraph(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), single_image_assignement_p(), sort_entities_with_dep(), statement_to_called_user_entities(), statement_to_referenced_entities(), SupressDependances(), text_loop_90(), type_supporting_entities(), type_supporting_references(), type_supporting_types(), and use_def_elimination_on_a_statement().

00088 {
00089   message_assert("typ is not hash_private", typ!=hash_private);
00090   /* Use default functions for equality check and rank computation. */
00091   return set_generic_make(typ, NULL, NULL);
00092 }

Here is the call graph for this function:

int set_own_allocated_memory ( const   set  ) 

Definition at line 365 of file set.c.

Referenced by allocated_memory_simple_in().

00366 {
00367   return sizeof(struct _set_chunk)+hash_table_own_allocated_memory(s->table);
00368 }

Here is the caller graph for this function:

hash_table set_private_get_hash_table ( const   set  ) 

return the internal hash table of set s

Definition at line 56 of file set.c.

References s.

00057 {
00058   return s->table;
00059 }

set set_singleton ( set_type  type,
const void *  p 
)

create a singleton set of any type but hash_private

use set_add_element() instead for hash_private

Definition at line 98 of file set.c.

References hash_put(), s, and set_make().

00099 {
00100   set s = set_make( type ) ;
00101   hash_put( s->table, p, p ) ;
00102   return s;
00103 }

Here is the call graph for this function:

int set_size ( const   set  ) 

returns the number of items in s.

Definition at line 301 of file set.c.

References hash_table_entry_count(), and s.

Referenced by freia_spoc_pipeline(), set_empty_p(), set_equal_p(), set_to_string_buffer(), subtitute_induction_statement_in(), and subtitute_induction_statement_out().

00302 {
00303   return hash_table_entry_count(s->table);
00304 }

Here is the call graph for this function:

Here is the caller graph for this function:

list set_to_list ( const set  s  ) 

create a list from a set the set is not freed

Warning:
no assumption can be made on the ordering of returned list
Parameters:
s set where the data are
Returns:
an allocated list of elements from s

Definition at line 378 of file set.c.

References gen_cons(), NIL, s, SET_FOREACH, and v.

Referenced by outliner(), and set_to_sorted_list().

00379 {
00380   list l =NIL;
00381   SET_FOREACH(void *, v, s)
00382     l = gen_cons(v,l);
00383   return l;
00384 }

Here is the call graph for this function:

Here is the caller graph for this function:

list set_to_sorted_list ( const set  s,
gen_cmp_func_t  cmp 
)
Returns:
a sorted list from a set. provide comparison function as gen_sort_list, which calls "qsort".

Definition at line 389 of file set.c.

References gen_sort_list(), s, and set_to_list().

Referenced by dag_compute_outputs(), freia_scalar_rw_dep(), points_to_storage(), and sort_entities_with_dep().

00390 {
00391   list l = set_to_list(s);
00392   gen_sort_list(l, cmp);
00393   return l;
00394 }

Here is the call graph for this function:

Here is the caller graph for this function:

string set_to_string ( string  name,
const set  s,
gen_string_func_t  item_name 
)

return allocated string for set s

Parameters:
name set description
s the set
item_name user function to build a string for each item

Definition at line 455 of file set.c.

References s, set_to_string_buffer(), string_buffer_free(), and string_buffer_to_string().

00456 {
00457   string_buffer sb = set_to_string_buffer(name, s, item_name);
00458   string res = string_buffer_to_string(sb);
00459   string_buffer_free(&sb);
00460   return res;
00461 }

Here is the call graph for this function:

set set_union ( set  s1,
const set  s2,
const set  s3 
)
Returns:
s1 = s2 u s3.

Definition at line 172 of file set.c.

References hash_dont_warn_on_redefinition(), HASH_MAP, hash_put(), hash_warn_on_redefinition(), hash_warn_on_redefinition_p(), s1, set_assign(), and v.

Referenced by basic_deref_addr(), basic_deref_array(), basic_deref_deref(), basic_deref_field(), basic_deref_ptr_to_field(), basic_deref_ref(), basic_field_addr(), basic_ptr_to_field_addr(), basic_ptr_to_field_field(), basic_ptr_to_field_ref(), basic_ref_addr(), basic_ref_array(), basic_ref_deref(), basic_ref_field(), basic_ref_heap(), basic_ref_ptr_to_field(), basic_ref_ref(), entity_generate_missing_declarations(), gen_set_closure_iterate(), genkill_block(), genkill_forloop(), genkill_loop(), genkill_test(), genkill_unstructured(), genkill_whileloop(), get_referenced_entities(), inout_block(), inout_call(), inout_control(), inout_forloop(), inout_loop(), inout_test(), inout_unstructured(), inout_whileloop(), merge_points_to_set(), outliner(), points_to_test(), sort_entities_with_dep(), struct_decomposition(), struct_double_pointer(), and struct_pointer().

00173 {
00174   // do not warn on redefinitions when computing an union.
00175   bool warning = hash_warn_on_redefinition_p();
00176   if (warning) hash_dont_warn_on_redefinition();
00177   if( s1 != s3 ) {
00178     set_assign(s1, s2) ;
00179     HASH_MAP( k, v, hash_put( s1->table, k, v), s3->table ) ;
00180   }
00181   else {
00182     HASH_MAP( k, v, hash_put( s1->table, k, v), s2->table ) ;
00183   }
00184   if (warning) hash_warn_on_redefinition();
00185   return s1;
00186 }

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208