PIPS
|
Macros | |
#define | DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val) db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, true) |
conform to old interface. More... | |
#define | DB_PUT_FILE_RESOURCE DB_PUT_MEMORY_RESOURCE |
Put a file resource into the current workspace database. More... | |
#define | DB_PUT_NEW_FILE_RESOURCE(res_name, own_name, res_val) db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, false) |
Put a new file resource into the current workspace database. More... | |
#define | DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val) db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, true) |
conform to old interface. More... | |
#define | DB_PUT_FILE_RESOURCE DB_PUT_MEMORY_RESOURCE |
Put a file resource into the current workspace database. More... | |
#define | DB_PUT_NEW_FILE_RESOURCE(res_name, own_name, res_val) db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, false) |
Put a new file resource into the current workspace database. More... | |
Functions | |
string | db_get_memory_resource (const char *rname, const char *oname, bool pure) |
Return the pointer to the resource, whatever it is. More... | |
void | db_put_or_update_memory_resource (const char *rname, const char *oname, void *p, bool update_is_ok) |
Put a resource into the current workspace database. More... | |
bool | db_module_exists_p (const char *name) |
Return whether name is a "valid" module. More... | |
static gen_array_t | db_get_module_or_function_list (bool module_p, bool func_p) |
Returns an allocated array a with the sorted list of modules. More... | |
gen_array_t | db_get_module_list (void) |
Get an array of all the modules (functions, procedures and compilation units) of a workspace. More... | |
gen_array_t | db_get_function_list (void) |
Get an array of all the functions and procedures (not compilation units) of a workspace. More... | |
gen_array_t | db_get_compilation_unit_list (void) |
Get an array of all the compilation units of a workspace. More... | |
#define DB_PUT_FILE_RESOURCE DB_PUT_MEMORY_RESOURCE |
Put a file resource into the current workspace database.
This function allows to update a file resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
Definition at line 85 of file pipsdbm-local.h.
#define DB_PUT_FILE_RESOURCE DB_PUT_MEMORY_RESOURCE |
Put a file resource into the current workspace database.
This function allows to update a file resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
#define DB_PUT_MEMORY_RESOURCE | ( | res_name, | |
own_name, | |||
res_val | |||
) | db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, true) |
conform to old interface.
Put a memory resource into the current workspace database
This function allows to update a memory resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
Definition at line 66 of file pipsdbm-local.h.
#define DB_PUT_MEMORY_RESOURCE | ( | res_name, | |
own_name, | |||
res_val | |||
) | db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, true) |
conform to old interface.
Put a memory resource into the current workspace database
This function allows to update a memory resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
#define DB_PUT_NEW_FILE_RESOURCE | ( | res_name, | |
own_name, | |||
res_val | |||
) | db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, false) |
Put a new file resource into the current workspace database.
This function disallows to update a resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
Definition at line 103 of file pipsdbm-local.h.
#define DB_PUT_NEW_FILE_RESOURCE | ( | res_name, | |
own_name, | |||
res_val | |||
) | db_put_or_update_memory_resource(res_name, own_name, (void*) res_val, false) |
Put a new file resource into the current workspace database.
This function disallows to update a resource already available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
res_val | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
gen_array_t db_get_compilation_unit_list | ( | void | ) |
Get an array of all the compilation units of a workspace.
Definition at line 1287 of file database.c.
References db_get_module_or_function_list().
gen_array_t db_get_function_list | ( | void | ) |
Get an array of all the functions and procedures (not compilation units) of a workspace.
Definition at line 1277 of file database.c.
References db_get_module_or_function_list().
Return the pointer to the resource, whatever it is.
Assume that the resource is available.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
pure | is used to declare the programmer intentions about the future of the resource. |
If pure is false, then the resource is saved on disk and/or marked as outdated before being returned. The idea is that we can modify and use this resource as we want in a phase, it is a throwable resource. Next time someone will want to use this resource, it will be read back from disk or recomputed and nobody will seen it has been changed by the first phase. The idea here is to behave as if db_get_memory_resource() return a copy, so you are responsible of its future (garbage collecting for example if you do not want it any longer).
This feature has been introduced in a time when gen_copy() did not exist to duplicate resources and using persistence as a way to get a copy was a sensible trick. But now we have gen_copy(), it is far more efficient to use it instead of writing it to disk and parsing it again or recomputing it. So in all new phases developed in PIPS, pure should be always true and gen_copy() should be used when necessary.
else we have something.
does it unlink the file?
Save if possible to hide side effects.
the pointer is there...
make as stored now...
Mark the resource as lost so next time it will be required, pipsmake will recompute it for example:
rname | name |
oname | name |
pure | ure |
Definition at line 755 of file database.c.
References db_delete_resource(), db_load_resource(), DB_OK, db_resource_db_status, db_resource_pointer, db_resource_required_p, db_resource_stored_p, db_resource_undefined_p, db_save_resource(), db_status_tag, dbll_check_resource(), dbll_storable_p(), debug_db_resource, debug_off, debug_on, get_db_resource(), ifdebug, is_db_status_stored, pips_assert, pips_debug, and pips_internal_error.
Referenced by actual_c_parser(), add_alias_lists_callee(), add_alias_lists_callees(), add_alias_pairs_for_this_caller(), add_aliases_for_current_call_site(), add_aliases_for_current_caller(), add_classes_callees(), add_classes_for_this_callee(), add_common_variables_to_hash_table(), add_control_counters(), AddEntityToCompilationUnit(), alias_check(), alias_check_two_variables(), alias_classes(), alias_lists(), alias_pairs(), alias_propagation(), aliases_text(), any_complexities(), array_bound_check_bottom_up(), array_bound_check_interprocedural(), array_bound_check_top_down(), array_dfg(), array_expansion(), atomizer(), bdsc_code_instrumentation(), build_real_resources(), call_site_to_module_precondition_text(), callers_to_statements(), callgraph(), callgraph_module_name(), chains(), check_call_mode_consistency(), check_tiling_legality(), clean_declarations(), clean_labels(), clear_pragma(), comEngine_distribute(), common_is_visible_p(), comp_regions(), compilation_unit_of_module(), compile_body(), computation_intensity(), continuation_conditions(), controlize_distribution(), controlizer(), copy_value_of_write(), copy_value_of_write_with_cumulated_regions(), create_HRE_module(), cumulated_reductions(), db_checkpoint_workspace(), db_get_in_simple_pv(), db_get_initial_simple_pv(), db_get_out_simple_pv(), db_get_program_simple_pv(), db_get_simple_pv(), db_open_workspace(), deatomizer(), delay_communications(), delay_communications_init(), delay_communications_interprocedurally(), delay_load_communications(), delay_store_communications(), do_check_isolate_statement_preconditions_on_call(), do_inlining(), do_it(), do_kernelize(), do_linearize_array_manage_callers(), do_unfolding(), dowhile_to_while(), dsc_code_parallelization(), eliminate_original_variables(), expression_substitution(), fetch_callees_complexities(), filter_file(), filter_proper_effects(), find_code_status(), flag_as_stub(), flag_kernel(), flag_loops(), flatten_code(), flinter(), for_loop_to_do_loop(), for_loop_to_while_loop(), formal_array_resizing_bottom_up(), formal_variable_add_aliases(), forward_substitute(), freia_compiler(), freia_remove_scalar_ww_deps(), freia_unroll_while(), fsm_generation(), fsm_merge_states(), fsm_split_state(), full_control_graph(), full_fsm_generation(), full_spaghettify(), full_unroll(), full_unroll_pragma(), gen_multi_recurse_explorer(), generate_starpu_pragma(), generate_two_addresses_code(), generic_module_initial_pointer_values(), generic_module_name_to_transformers(), generic_module_pointer_values(), generic_points_to_analysis(), generic_print_code_pv(), generic_print_xml_application(), get_any_comp_regions_text(), get_callees(), get_callers(), get_continuation_condition_text(), get_loop_execution_parallel(), get_module_precondition(), get_semantic_text(), get_stubs(), global_parallelization(), gpu_ify(), gpu_ify_statement(), gpu_memory(), gpu_promote_sequential(), gpu_qualify_pointers(), gpu_xml_dump(), group_constants(), guard_elimination(), hbdsc_parallelization(), hpfc_directives_handler(), html_prettyprint(), icm_codegen(), if_conversion(), if_conversion_compact(), if_conversion_init(), ikernel_load_store(), impact_check(), impact_check_two_variables(), in_alias_pairs(), in_regions_of_external(), init_convex_in_out_regions(), init_convex_rw_regions(), init_convex_summary_in_out_regions(), init_convex_summary_rw_regions(), init_use_preconditions(), init_use_proper_effects(), initial_points_to(), initial_precondition(), initialize_global_variables(), inline_calls(), insert_check_alias_before_statement(), insert_flag_before_call_site(), insert_test_before_caller(), insert_test_before_statement(), instruction_selection(), instruction_to_wp65_code(), interactive_loop_transformation(), interprocedural_mapping(), invariant_code_motion(), is_a_kernel(), isolate_statement(), just_show(), kernel_data_mapping(), kernel_load_store_engine(), kernelize(), language_module_p(), linearize_array_generic(), live_in_summary_paths_engine(), live_out_paths_from_caller_to_callee(), live_out_region_engine(), live_out_summary_paths_engine(), live_paths_engine(), load_body_effects(), load_hpfc_status(), load_step_comm(), load_summary_effects(), load_summary_precondition(), load_summary_reductions(), load_summary_total_postcondition(), load_summary_transformer(), loop_auto_unroll(), loop_expansion(), loop_expansion_init(), loop_nest_unswitching(), loop_pragma(), loop_statistics(), main(), main_summary_precondition(), make_start_ru_module(), module_entity_to_compilation_unit_entity(), module_is_called_by_main_program_p(), module_loops(), module_name_to_callees(), module_name_to_input_file_name(), module_name_to_preconditions(), module_name_to_total_preconditions(), module_to_all_declarations(), module_to_value_mappings(), mpi_conversion(), mpi_task_generation(), new_atomizer(), new_controlizer(), node(), normalize_microcode(), normalize_microcode_anotate(), old__gpu_ify(), old_array_bound_check_instrumentation(), old_reductions(), old_summary_precondition(), omp_loop_parallel_threshold_set(), one_thread_parallelize(), openmp_task_generation(), optimize_expressions(), ordinary_summary_precondition(), out_alias_pairs(), out_regions_from_caller_to_callee(), outline(), outliner_independent(), outliner_independent_recursively(), partial_eval(), perform_icm_association(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), phrase_distributor_init(), phrase_remove_dependences(), pipsdbm_read_statement_function(), pipsdbm_read_statement_mapping(), pocc_prettyprinter(), pragma_outliner(), preconditions_inter_full_with_points_to(), prgm_mapping(), print_any_reductions(), print_array_dfg(), print_bdt(), print_c_code(), print_code_or_source(), print_code_or_source_comp(), print_code_points_to(), print_code_smalltalk(), print_code_static_control(), print_crough(), print_dependence_or_chains_graph(), print_dot_dependence_or_chains_graph(), print_filtered_dg_or_dvdg(), print_initial_precondition(), print_interface(), print_loopnest_dependence_cone(), print_loops(), print_module_icfg(), print_parallelized_code_common(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), print_plc(), print_program_precondition(), print_xml_application_main_with_points_to(), print_xml_application_with_points_to(), print_xml_code(), print_xml_code_with_explicit_motif(), process_reduced_loops(), process_user_file(), ProcessEntry(), program_points_to(), program_precondition(), proper_reductions(), recompile_module(), recursive_append(), reduction_atomization(), reduction_detection(), reduction_propagation(), redundant_load_store_elimination(), refine_transformers_with_points_to(), regions_of_external(), regions_to_loops(), reindexing(), remove_common_variables_from_hash_table(), remove_simple_scalar_pointers(), RemoveEntityFromCompilationUnit(), rename_operator(), restructure_control(), rice_dependence_graph(), rstream_interface(), run_inlining(), safescale_distributor(), safescale_distributor_init(), safescale_module_analysis(), scalar_renaming(), scalopify(), scalopragma(), scheduling(), sequence_dependence_graph(), sesam_buffers_processing(), sesamify(), set_effects(), set_loop_execution_parallel(), set_pattern(), set_resources_for_module(), show(), simd_atomizer(), simd_memory_packing(), simd_remove_reductions(), simd_unroll_as_needed(), simdizer(), simdizer_auto_tile(), simdizer_auto_unroll(), simdizer_init(), simplify_complex(), simplify_constant_address_expressions(), simplify_subscripts(), single_assign(), solve_hardware_constraints(), sort_parameters(), spaghettify(), spear_log_alist(), spire_distributed_unstructured_to_structured(), spire_shared_unstructured_to_structured(), split_initializations(), split_structures(), split_update_operator(), statement_insertion(), statement_insertion_fix_access_in_callers(), static_controlize(), step_analyse(), step_analyse_CHAINS_DG(), step_compile_analysed_module(), step_compile_generated_module(), step_directives_init(), step_install(), step_parser(), step_translate_and_map_step_regions(), storage_formal_offset(), store_step_comm(), string_to_callees(), strip_mine(), summary_complexity(), summary_precondition(), summary_reductions(), summary_total_postcondition(), symbolic_tiling(), task_mapping(), taskify(), terapix_remove_divide(), terapix_warmup(), text_summary_complexity(), tiling_sequence(), transformers_inter_full_with_points_to(), type_checker(), unroll(), unspaghettify(), update_precondition_with_call_site_preconditions(), update_summary_precondition(), used_before_set(), user_call_to_points_to_fast_interprocedural(), user_call_to_points_to_interprocedural(), user_call_to_points_to_interprocedural_binding_set(), variable_replication(), verify_formal_and_common_variables(), wp65(), wrap_kernel_argument(), xml_Chains(), and xml_Task().
gen_array_t db_get_module_list | ( | void | ) |
Get an array of all the modules (functions, procedures and compilation units) of a workspace.
Definition at line 1266 of file database.c.
References db_get_module_or_function_list().
Referenced by bootstrap(), build_real_resources(), callgraph(), db_save_workspace(), end_select_module_callback(), end_select_module_notify(), epips_select_module(), full_graph_of_calls(), generate_module_menu(), generic_program_pointer_values(), get_main(), get_main_entity_name(), get_module_names(), info(), open_module_if_unique(), program_points_to(), program_precondition(), remove_module_entity(), select_module_from_menubar_callback(), select_module_notify(), send_the_names_of_the_available_modules_to_emacs(), tp_some_info(), and try_to_parse_everything_just_in_case().
|
static |
Returns an allocated array a with the sorted list of modules.
strings are duplicated.
Compilation units were not added because Fabien Coelho wanted to avoid them in validation files: they do depend on include files varying from machine to machine. Another reason to avoid them could be that they are not real module with a signature and code. However, the semantics of tpips ALL does include them. It's up to the validation designer to avoid including varying stuff in test files. Another possibility would be to regenerate include statements...
module_p | is used to select all modules, functions and compilation units too. If true, compilation units are included as well as functions. |
func_p | is used to obtain either functions or compilation units. It is only active if module_p is set to false. |
the environment variable PIPS_IGNORE_FUNCTION_RX helps filtering out functions, typically static inlined functions added by some "standard" header files.
Definition at line 1231 of file database.c.
References compilation_unit_p(), DB_OK, DB_RESOURCES_FOREACH, db_symbol_name, gen_array_dupappend(), gen_array_make(), gen_array_sort(), IGNORE_RX, pips_assert, pips_debug, pips_user_error, and same_string_p.
Referenced by db_get_compilation_unit_list(), db_get_function_list(), and db_get_module_list().
bool db_module_exists_p | ( | const char * | name | ) |
Return whether name is a "valid" module.
As FI points out to me (FC), it just means that the name has been used by some-one, some-where, some-time...
It just checks that an non empty resource table is associated to this name. The table may be created when resources are marked as required by pipsmake, and is never destroyed?
name | ame |
Definition at line 1129 of file database.c.
References apply_db_resources(), bound_db_resources_p(), db_owned_resources_hash_table, db_symbol_domain, db_symbol_undefined_p, gen_find_tabulated(), hash_table_entry_count(), and ok.
Referenced by open_module().
void db_put_or_update_memory_resource | ( | const char * | rname, |
const char * | oname, | ||
void * | p, | ||
bool | update_is_ok | ||
) |
Put a resource into the current workspace database.
rname | is a resource name, such as DBR_CODE for the code of a module. The construction of these aliases are DBB_ + the uppercased name of a resource defined in pipsmake-rc.tex. They are defined automatically in include/resources.h |
oname | is the resource owner name, typically a module name. |
p | is an opaque pointer to the resource to be stored. Methods defined in methods.h will know how to deal with. |
update_is_ok | is a parameter to allow updating a resource. |
Check the database coherency:
Get the database resource associated to the given resource:
The resource does not exist: it was just created, so mark it as loaded into memory:
The resource already exists...
If the resource is not required and we do not want to update it:
Store data
< ??? memory leak? depends?
Mark the resource as loaded into memory:
Timestamp the resource with the current logical time:
If there is a text file associated to the resource, get its modification time:
< Or what else?
rname | name |
oname | name |
update_is_ok | pdate_is_ok |
Definition at line 854 of file database.c.
References db_get_logical_time(), DB_OK, db_resource_db_status, db_resource_file_time, db_resource_pointer, db_resource_required_p, db_resource_time, db_status_tag, db_status_undefined_p, dbll_check_resource(), dbll_stat_local_file(), debug_db_resource, debug_off, debug_on, displayable_file_p(), find_or_create_db_resource(), ifdebug, is_db_status_loaded, make_db_status_loaded(), pips_assert, pips_debug, and pips_internal_error.
Referenced by AddEntityToCompilationUnit(), kernel_load_store_engine(), and RemoveEntityFromCompilationUnit().