
Go to the source code of this file.
Data Structures | |
| struct | cons |
| The structure used to build lists in NewGen. More... | |
Defines | |
| #define | NIL ((list)NULL) |
| The empty list (nil in Lisp). | |
| #define | POP(l) ((l)=(l)->cdr) |
| Modify a list pointer to point on the next element of the list. | |
| #define | ENDP(l) ((l)==NIL) |
| Test if a list is empty. | |
| #define | list_undefined ((cons *)-3) |
| Undefined list definition :-). | |
| #define | list_undefined_p(c) ((c)==list_undefined) |
| Return if a list is undefined. | |
| #define | CAR(pcons) ((pcons)->car) |
| Get the value of the first element of a list. | |
| #define | CDR(pcons) ((pcons)->cdr) |
| Get the list less its first element. | |
| #define | REFCAR(pc) (&(CAR(pc).p)) |
| Get the adress of the first element of a list. | |
| #define | CONS(_t_, _i_, _l_) gen_##_t_##_cons((_i_),(_l_)) |
| List element cell constructor (insert an element at the beginning of a list). | |
| #define | UNIQUE_NAME_1(prefix, x) prefix##x |
| Some CPP magics to get a line-number-dependent "unique" identifier to have list iteration variable with unique names and avoid conflicts if we have multiple FOREACH in the same statement block:. | |
| #define | UNIQUE_NAME_2(prefix, x) UNIQUE_NAME_1 (prefix, x) |
| #define | UNIQUE_NAME UNIQUE_NAME_2 (iter_, __LINE__) |
| Well, it does not work if 2 FOREACH are on the same line, but it should not happen if a PIPS programmer does not apply for the code offuscation contest. | |
| #define | FOREACH(_fe_CASTER, _fe_item, _fe_list) |
| Apply/map an instruction block on all the elements of a list. | |
| #define | MAPL(_map_list_cp, _code, _l) |
| Apply some code on the addresses of all the elements of a list. | |
| #define | MAP(_map_CASTER, _map_item, _map_code, _map_list) |
| Apply/map an instruction block on all the elements of a list (old fashioned). | |
| #define | gen_BOOL_cons gen_bool_cons |
| Another name to the funtion to insert a boolean element at the start of a list. | |
| #define | gen_INT_cons gen_int_cons |
| Another name to the funtion to insert an integer element at the start of a list. | |
| #define | gen_LIST_cons gen_list_cons |
| Another name to the funtion to insert a list element at the start of a list. | |
| #define | gen_CONSP_cons gen_list_cons |
| Another name to the funtion to insert a list element at the start of a list. | |
| #define | gen_STRING_cons gen_string_cons |
| Another name to the funtion to insert a string element at the start of a list. | |
Typedefs | |
| typedef struct cons | cons |
| The structure used to build lists in NewGen. | |
Functions | |
| void | gen_copy (void *, void *) |
| define CONS(type,x,l) gen_cons((void*) (x), (l)) | |
| bool | gen_eq (const void *, const void *) |
| void * | gen_identity (const void *) |
| Just return the argument. | |
| void * | gen_find_tabulated (string, int) |
| list | gen_filter_tabulated (bool(*)(gen_chunk *), int) |
| returns the list of entities with this caracteristics. | |
| void | gen_free_area (void **, int) |
| free an area. | |
| void | gen_mapc_tabulated (void(*)(), int) |
| list | gen_append (list, const list) |
| list | gen_concatenate (const list, const list) |
| concatenate two lists. | |
| list | gen_copy_seq (const list) |
| list | gen_nconc (list, list) |
| physically concatenates CP1 and CP2 but do not duplicates the elements | |
| list | gen_full_copy_list (const list) |
| list | gen_make_list (int,...) |
| list | gen_nreverse (list) |
| void * | gen_find (const void *, const list, gen_filter2_func_t, gen_extract_func_t) |
| void * | gen_find_from_end (const void *, const list, gen_filter2_func_t, gen_extract_func_t) |
| void * | gen_find_eq (const void *, const list) |
| void * | gen_find_if (gen_filter_func_t, const list, gen_extract_func_t) |
| void * | gen_find_if_from_end (gen_filter_func_t, list, gen_extract_func_t) |
| the last match is returned | |
| void | gen_free_list (list) |
| free the spine of the list | |
| void | gen_full_free_list (list) |
| list | gen_last (const list) |
| void * | gen_car (const list) |
| size_t | gen_length (const list) |
| size_t | list_own_allocated_memory (const list) |
| gen_chunk | gen_nth (int, const list) |
| to be used as ENTITY(gen_nth(3, l)). | |
| list | gen_nthcdr (int, const list) |
| caution: the first item is 0! was: return( (n<=0) ? l : gen_nthcdr( n-1, CDR( l ))) ; if n>gen_length(l), NIL is returned. | |
| void | gen_map (gen_iter_func_t, const list) |
| void | gen_mapl (gen_iter_func_t, const list) |
| MAP. | |
| void * | gen_reduce (void *, void *(*)(void *, const list), const list) |
| void | gen_remove (list *, const void *) |
| remove all occurences of item o from list *cpp, which is thus modified. | |
| void | gen_remove_once (list *, const void *) |
| Remove the first occurence of o in list pl:. | |
| list | gen_some (gen_filter_func_t, const list) |
| void | gen_insert_after (const void *, const void *, list) |
| list | gen_insert_before (const void *, const void *, list) |
| list | gen_once (const void *, list) |
| Prepend an item to a list only if it is not already in the list. | |
| bool | gen_in_list_p (const void *, const list) |
| int | gen_occurences (const void *, const list) |
| bool | gen_once_p (const list) |
| FC: ARGH...O(n^2)! | |
| void | gen_sort_list (list, gen_cmp_func_t) |
| Sorts a list of gen_chunks in place, to avoid allocations. | |
| void | gen_list_patch (list, const void *, const void *) |
| Replace all the reference to x in list l by a reference to y:. | |
| void | gen_closure (list(*)(), const list) |
| list | gen_copy_string_list (const list) |
| void | gen_free_string_list (list) |
| list | gen_cons (const void *, const list) |
| list | gen_bool_cons (bool, const list) |
| typed cons for "basic" types | |
| list | gen_int_cons (_int, const list) |
| list | gen_string_cons (string, const list) |
| list | gen_list_cons (const list, const list) |
| list | gen_typed_cons (_int, const void *, const list) |
| CONS a list with minimal type checking this cannot be done within the CONS macro because possible functions calls must not be replicated. | |
| list | gen_CHUNK_cons (const gen_chunk *, const list) |
| void | gen_list_and (list *, const list) |
| Compute A = A inter B: complexity in O(n2). | |
| void | gen_list_and_not (list *, const list) |
| Compute A = A inter non B:. | |
| int | gen_position (const void *, const list) |
| Element ranks are strictly positive as for first, second, and so on. | |
| bool | gen_list_cyclic_p (const list ml) |
| list | gen_list_head (list *, int) |
| void | gen_substitute_chunk_by_list (list *pl, const void *o, list sl) |
| substitute item o by list sl in list *pl, which is modified as a side effect. | |
| #define UNIQUE_NAME UNIQUE_NAME_2 (iter_, __LINE__) |
Well, it does not work if 2 FOREACH are on the same line, but it should not happen if a PIPS programmer does not apply for the code offuscation contest.
.. :-)
Definition at line 161 of file newgen_list.h.
Some CPP magics to get a line-number-dependent "unique" identifier to have list iteration variable with unique names and avoid conflicts if we have multiple FOREACH in the same statement block:.
Definition at line 156 of file newgen_list.h.
Definition at line 157 of file newgen_list.h.
returns the list of entities with this caracteristics.
Definition at line 141 of file tabulated.c.
References CHUNK, CONS, gen_chunk_undefined, get_tabulated_from_domain(), i, and NIL.
Referenced by db_get_module_list_initial_order(), GenericCleanLocalEntities(), and RemoveLocalEntities().
00142 { 00143 gen_tabulated_p gtp = get_tabulated_from_domain(domain); 00144 register int i, size = gtp->size; 00145 list l; 00146 00147 for (l=NIL, i=0; i<size; i++) { 00148 gen_chunk * o = gtp->table[i].p; 00149 if (o && o != gen_chunk_undefined) { 00150 if (filter(o)) l = CONS(CHUNK, o, l); 00151 } 00152 } 00153 00154 return l; 00155 }


| void* gen_find_tabulated | ( | string | , | |
| int | ||||
| ) |
Definition at line 215 of file tabulated.c.
References gen_chunk_undefined, gen_get_tabulated_name_basic(), get_tabulated_from_domain(), HASH_UNDEFINED_VALUE, and message_assert.
Referenced by add_non_declared_reference_to_declaration(), add_old_value(), add_symbolic_constant_to_declaration(), add_test(), alias_check(), anywhere_effect(), build_new_ref(), clone_variable_with_new_name(), cmf_layout_align(), complex_bound_generation(), craft_layout_align(), create_local_index(), create_local_index2(), create_named_entity(), create_parameter_for_new_module(), create_parameter_variable_for_new_module(), create_private_integer_variable_for_new_module(), create_private_variable_for_new_module(), create_state_variable(), create_tile_basis(), creer_nom_var(), db_module_exists_p(), ecrit_une_var_neg(), entity_empty_label(), entity_field_to_entity(), entity_intrinsic(), entity_to_module_entity(), external_entity_to_old_value(), fetch_complexity_parameters(), find_entity(), find_entity_0(), find_entity_1(), find_label_entity(), find_operator(), find_or_create_coeff(), find_or_create_db_symbol(), find_or_create_emulated_shared_variable(), find_or_create_entity(), find_or_create_scalar_entity(), find_or_create_typed_entity(), FindEntity(), FindEntityFromLocalNameAndPrefix(), FindEntityFromLocalNameAndPrefixAndScope(), FindOrCreateEntityLikeModel(), gen_enter_tabulated(), gen_find_db_symbol(), gen_find_entity(), gen_find_opcodeClass(), generate_pseudo_formal_variable_for_formal_label(), get_list_of_variable_to_filter(), get_time_ent(), get_variables_to_filter(), global_name_to_entity(), global_new_value_to_global_old_value(), init_loop_ctrl(), init_new_df_ref(), init_new_do_loop(), local_name_to_top_level_entity(), local_name_to_variable(), loop_normalize_of_loop(), make_anywhere_effect(), make_array_bounds(), make_array_entity(), make_beta_entity(), make_bound_expression(), make_constraint_expression(), make_empty_module(), make_emulated_shared_variable(), make_entity_copy(), make_entity_copy_with_new_name(), make_factor_expression(), make_float_constant_entity(), make_func_op(), make_host_and_node_modules(), make_id_expression(), make_integer_constant_entity(), make_local_value_entity(), make_movements_loop_body_wp65(), make_new_index_entity(), make_new_module_variable(), make_new_scalar_variable_with_prefix(), make_op_exp(), make_phi_entity(), make_psi_entity(), make_rational_exp(), make_ref(), make_return_statement(), make_rho_entity(), make_scalar_entity(), make_tile_index_entity_n(), MakeAssignedOrComputedGotoInst(), MakeCurrentFunction(), MakeDiVar(), MakeDsiVar(), MakeLiVar(), MakeLoopCounter(), my_build_new_ref(), name_to_variable(), NameToFunctionalEntity(), new_eng_loop(), new_label_name(), new_param(), predicate_to_expression(), psystem_to_expression(), Pvecteur_to_expression(), rational_op_exp(), region_translate_global_value(), SafeFindOrCreateEntity(), sc_add_new_variable_name(), signed_integer_constant_expression_p(), simplify_minmax_contrainte(), step_add_parameter(), step_call_outlined_master(), step_create_mpi_before_loop(), step_find_loop_range_suffix_id(), step_find_new_module_name(), step_make_new_directive_module_name(), translate_global_value(), update_called_modules(), update_label_do_directive_module_name(), value_to_variable(), and vect_gen_read().
00216 { 00217 _int number = gen_get_tabulated_name_basic(domain, key); 00218 00219 if (number == (_int) HASH_UNDEFINED_VALUE) 00220 { 00221 return gen_chunk_undefined; 00222 } 00223 else 00224 { 00225 gen_tabulated_p gtp = get_tabulated_from_domain(domain); 00226 message_assert("valid tabulated number", number>=0 && number<gtp->size); 00227 return gtp->table[number].p; 00228 } 00229 }

| void gen_free_string_list | ( | list | ) |
| void gen_full_free_list | ( | list | ) |
Definition at line 1009 of file genClib.c.
References CAR, cons::cdr, gen_free(), hash_pointer, hash_table_free(), hash_table_make(), and NULL.
Referenced by __attribute__(), any_basic_update_operation_to_transformer(), apply_a_rule(), c_convex_effects_on_actual_parameter_forward_translation(), c_summary_effect_to_proper_effects(), check_physical_resource_up_to_date(), check_proper_reductions(), clean_up_sequences_rewrite(), cleanup_call(), condition_to_transformer(), directive_block_filter(), do_expand_reference(), do_resource_usage_check(), expression_effects_to_transformer(), hwac_replace_statement(), intrinsic_call_to_type(), list_of_compatible_reductions(), list_of_effects_generic_binary_op(), make_pointer_from_variable(), make_required(), other_cool_enough_for_a_last_substitution(), prepare_expansion(), proper_effects_of_call(), proper_effects_of_expression_instruction(), reduce_array_declaration_dimension(), reductions_rewrite(), remove_interval_predecessors(), rmake(), rw_effects_of_declarations(), rw_effects_of_sequence(), safe_any_expression_to_transformer(), safe_expression_to_transformer(), seq_flt(), simd_check_argType(), statement_clean_declarations_helper(), step_send_regions(), and update_preserved_resources().
01010 { 01011 list p, nextp ; 01012 bool first_in_stack = (free_already_seen==(hash_table)NULL); 01013 01014 if (first_in_stack) 01015 free_already_seen = hash_table_make(hash_pointer, 0); 01016 01017 for (p = l; p ; p=nextp) 01018 { 01019 nextp = p->cdr; 01020 gen_free(CAR(p).p); 01021 newgen_free(p); 01022 } 01023 01024 if (first_in_stack) 01025 { 01026 hash_table_free(free_already_seen); 01027 free_already_seen = NULL; 01028 } 01029 }


| void gen_mapc_tabulated | ( | void(*)() | , | |
| int | ||||
| ) |
| void* gen_reduce | ( | void * | , | |
| void * | *)(void *, const list, | |||
| const | list | |||
| ) |
1.6.2-20100208