PIPS
|
Modules | |
NewGen useful functions for recursion visitors | |
They may be used by some recursion. | |
NewGen inheritance tracking during visiting object | |
Methods to get parent information constructed during recursion. | |
Functions | |
void | gen_recurse_stop (void *obj) |
Tells the recursion not to go in this object. More... | |
static void | gen_internal_context_multi_recurse (void *o, void *context, bool gointabs, va_list pvar) |
Multi recursion generic visitor function. More... | |
void | gen_context_multi_recurse (void *o, void *context,...) |
Multi-recursion with context function visitor. More... | |
void | gen_full_recurse (void *o, void *context,...) |
Full multi-recursion with context function visitor. More... | |
void | gen_multi_recurse (void *o,...) |
Multi recursion visitor function. More... | |
void | gen_recurse (void *obj, int domain, bool(*filter)(void *encountered), void(*rewrite)(void *encountered_object)) |
Visit all the objects from a given types found in an object. More... | |
void | gen_context_recurse (void *obj, void *context, int domain, bool(*filter)(void *encountered_object, void *context), void(*rewrite)(void *encountered_object, void *context)) |
Visit all the objects from a given types found in an object with a context. More... | |
void gen_context_multi_recurse | ( | void * | o, |
void * | context, | ||
... | |||
) |
Multi-recursion with context function visitor.
gen_context_multi_recurse(obj, context, [domain, filter, rewrite,]* NULL);
recurse from object obj (in a top-down way), applies filter_i on encountered domain_i objects with the context, if true, recurses down from the domain_i object, and applies rewrite_i on exit from the object (in a bottom-up way).
Newgen persistant fields are not visited.
You can't visit domain number 0, but there are none...
Definition at line 3373 of file genClib.c.
References gen_internal_context_multi_recurse().
Referenced by add_counters(), atomize_all(), atomize_cse_this_statement_expressions(), bottom_up_abc_statement(), callers_to_call_sites(), collect_glopriv(), compute_callees(), convert_pointer_to_array(), cusq_ctxt_init(), eole_manageable_expression(), find_calls_to_function(), find_loops_and_calls_in_box(), forward_substitute_in_anyloop(), forward_substitute_in_call(), forward_substitute_in_exp(), freia_build_image_occurrences(), freia_compile(), freia_compute_output_images(), freia_shuffle_move_forward(), freia_switch_image_in_statement(), gen_context_recurse(), get_list_of_rhs(), get_referenced_entities_filtered(), group_constants(), guard_elimination(), guess_write_effect_on_entity(), initial_code_abc_statement(), instruction_selection(), interprocedural_abc_statement(), isolate_patch_entities(), live_out_paths_from_caller_to_callee(), live_paths_of_module_statement(), loop_statistics(), make_eliminate_original_variables(), make_mpi_conversion(), normalize_microcode(), outliner(), perform_substitution(), pips_code_abc_statement(), private_variables(), remove_redundant_communications(), remove_simple_scalar_pointers(), remove_statement_redundant(), replace_entities(), replace_entity_by_expression_with_filter(), search_nested_loops_and_calls(), sequence_working_false(), simdizer(), statement_flatten_declarations(), statement_to_called_user_entities(), statement_to_declarations(), statement_to_referenced_entities(), substitute_entity_in_expression(), substitute_image_occurrences(), test_working_false(), tiling_sequence(), top_down_abc_statement(), type_this_chunk(), and unstructured_to_flow_sensitive_postconditions_or_transformers().
void gen_context_recurse | ( | void * | obj, |
void * | context, | ||
int | domain, | ||
bool(*)(void *encountered_object, void *context) | filter, | ||
void(*)(void *encountered_object, void *context) | rewrite | ||
) |
Visit all the objects from a given types found in an object with a context.
obj | the object to start visiting |
domain | the type of objects we want to visit |
context | is a pointer that is given to the filter and rewrite methods too. It is quite useful when one wants side effects on other objects without having to rely on (dirty) global variables. |
filter | the filter method (function) to apply to an encountered object of the good type during the prefix (top-down) visit. Its second argument is the context passed texto from the global context parameter. If the method returns true, the recursion is going on. If it returns false, the visit does not go further inside this object and the rewrite method is not be called during the bottom-up visit. |
rewrite | is the method (function) to apply to an encountered object of the good type during the prefix (bottom-up) visit. Its second argument is the context passed texto from the global context parameter |
obj | starting point |
Definition at line 3483 of file genClib.c.
References gen_context_multi_recurse().
void gen_full_recurse | ( | void * | o, |
void * | context, | ||
... | |||
) |
Full multi-recursion with context function visitor.
gen_full_recurse(obj, context, [domain, filter, rewrite,]* NULL);
recurse from object obj (in a top-down way), applies filter_i on encountered domain_i objects with the context, if true, recurses down from the domain_i object, and applies rewrite_i on exit from the object (in a bottom-up way).
Newgen persistant fields and their contents ARE VISITED.
The current implementation does not try to be intelligent, thus will recurse anywhere until stopped by a decision or an object was already visited. Beware, if you do not take extra care, this mean visiting all entities and their contents when visiting from a statement in pips.
You can't visit domain number 0, but there are none.
Definition at line 3402 of file genClib.c.
References gen_internal_context_multi_recurse().
|
static |
Multi recursion generic visitor function.
It is more intended for internal use, but may be useful instead of gen_context_multi_recurse() to give iteration parameters as a va_list.
Refer to the documentation of gen_context_multi_recurse().
Beware that the function is reentrant.
Definition at line 3269 of file genClib.c.
References multi_recurse::always_recurse, driver::array_leaf, check_read_spec_performed, multi_recurse::context, multi_recurse::current, current_mrc, multi_recurse::decisions, multi_recurse::domains, multi_recurse::filters, gen_array_leaf(), gen_chunk_undefined, gen_null(), gen_trav_obj(), gen_trav_stop_recursion, get_decision_table(), hash_pointer, hash_table_free(), hash_table_make(), driver::leaf_in, driver::leaf_out, MAX_DOMAIN, message_assert, driver::null, number_of_domains, driver::obj_in, driver::obj_out, multi_recurse::previous, quick_multi_recurse_obj_in(), quick_multi_recurse_obj_out(), quick_multi_recurse_simple_in(), multi_recurse::rewrites, multi_recurse::seen, driver::simple_in, driver::simple_out, stack_free(), stack_make(), stack_pop(), stack_push(), stack_size(), tabulated_leaf_in(), and multi_recurse::upwards.
Referenced by gen_context_multi_recurse(), gen_full_recurse(), and gen_multi_recurse().
void gen_multi_recurse | ( | void * | o, |
... | |||
) |
Multi recursion visitor function.
gen_context_multi_recurse(obj, context, [domain, filter, rewrite,]* NULL);
recurse from object obj (in a top-down way), applies filter_i on encountered domain_i objects with the context, if true, recurses down from the domain_i object, and applies rewrite_i on exit from the object (in a bottom-up way).
Newgen persistant fields are not visited.
Bug : you can't visit domain number 0 if any... The good news is that there is no NewGen object of domain number 0, since it seems that to start at 7 for user domains...
Definition at line 3428 of file genClib.c.
References gen_internal_context_multi_recurse().
Referenced by add_alias_pairs_for_this_caller(), add_aliases_for_current_caller(), atomize_object(), bourdoncle_component(), bourdoncle_partition(), bourdoncle_unstructured_free(), build_binary_operators_with_huffman(), build_full_ctrl_graph(), compute_proper_reductions(), count_references_to_variable(), count_references_to_variable_element(), debug_print_referenced_entities(), do_array_to_pointer_walker(), do_linearize_array_walker(), drop_dummy_loops(), drop_it(), equal_reference_in_expression_p(), expression_substitution(), extract_distributed_non_constant_terms(), find_reference_to_variable(), FindRefToDistArray(), FindRefToDistArrayInStatement(), gen_multi_recurse_explorer(), gen_recurse(), get_all_entities(), get_operator(), handle_hpf_directives(), icm_codegen(), list_of_referenced_entities(), node_to_linked_nodes(), nodecl_p(), normalize_all_expressions_of(), normalize_first_expressions_of(), only_io_mapping(), out_regions_from_caller_to_callee(), output_the_attachments_for_emacs(), parallel_loop_nest_to_body(), perform_ac_cse(), perform_icm_association(), print_embedding_graph(), print_module_icfg(), print_unstructured(), remove_variable_from_reduction(), simple_statement(), simple_switch_old_to_new(), simplify_constant_address_expressions(), sort_all_loop_locals(), split_update_operator(), statement_structural_cleaning(), statement_to_line_number(), step_directive_parser(), subarray_shift_p(), substitute_return(), unnormalize_expression(), unstructured_shallow_copy(), unstructured_to_flow_sensitive_postconditions_or_transformers(), unstructured_to_transformer(), update_common_references_in_obj(), update_object_for_module(), update_precondition_with_call_site_preconditions(), and variable_declaration_coherency_p().
void gen_recurse | ( | void * | obj, |
int | domain, | ||
bool(*)(void *encountered) | filter, | ||
void(*)(void *encountered_object) | rewrite | ||
) |
Visit all the objects from a given types found in an object.
obj | the object to start visiting |
domain | the type of objects we want to visit |
filter | the filter method (function) to apply to an encountered object of the good type during the prefix (top-down) visit. If it returns true, the recursion is going on and the rewrite filter will be called during the bottom-up visit. If it returns false, the visit does not go further inside this object and the rewrite method will not be called during the bottom-up visit. |
rewrite | is the method (function) to apply to an encountered object of the good type during the prefix (bottom-up) visit |
obj | starting point |
Definition at line 3452 of file genClib.c.
References gen_multi_recurse().
void gen_recurse_stop | ( | void * | obj | ) |
Tells the recursion not to go in this object.
This may be interesting when the recursion modifies the visited data structure. if obj is NULL, the whole recursion is stopped !
Definition at line 3251 of file genClib.c.
References current_mrc, gen_trav_stop_recursion, hash_put(), and multi_recurse::seen.
Referenced by atom_cse_expression(), atomize_call_filter(), call_count_flt(), call_flt(), cannot_be_empty(), check_private_variables_call_walker(), check_simple(), cse_atom_call_flt(), cse_call_flt(), do_check_isolate_statement_preconditions_on_call(), do_kernelize(), do_recurse_statements_conflict_p(), do_substitute(), do_terapix_loop_optimizer(), do_terapix_pointer_initialized_from_a_mask_p(), does_it_depend(), entity_to_declaring_statement_aux(), entity_used_in_calls_walker(), entity_used_somewhere_walker(), fcs_count(), figure_out_if_it_is_a_format(), find_loop_from_label_walker(), find_statements_interactively_walker(), find_statements_with_label_walker(), find_statements_with_pragma_walker(), fsr_call_flt(), fsr_reference_flt(), guess_write_effect_on_entity_walker(), image_ref_flt(), inline_has_inlinable_calls_crawler(), insert_before_current_statement(), inv_entity_filter(), loop_flt(), loop_stop(), not_simple(), reductions_rewrite(), reference_filter(), reference_rwt(), related_effect(), replace_statement_walker(), simplify_complex_expression(), solve_name_clashes(), statement_in_statement_walker(), swis_call_flt(), test_stop(), top_down_abc_insert_before_statement(), vis_rwt(), and while_stop().