PIPS
|
Go to the source code of this file.
Macros | |
#define | PIPSDBM_DEBUG_LEVEL "PIPSDBM_DEBUG_LEVEL" |
Warning! Do not modify this file that is automatically generated! More... | |
#define | PROGRAM_RESOURCE_OWNER "" |
#define | WORKSPACE_TMP_SPACE "Tmp" |
#define | WORKSPACE_SRC_SPACE "Src" |
#define | WORKSPACE_PROGRAM_SPACE "Program" |
#define | WORKSPACE_METADATA_SPACE "Metadata" |
#define | MAIN_FILE_NAMES "PROGRAM.main" |
Name of the file containing the names of the main procedures. 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... | |
#define | db_get_file_resource db_get_memory_resource |
#define | db_unput_a_resource(r, o) db_delete_resource(r,o) |
#define | build_pgmwd db_get_workspace_directory_name |
#define | db_make_subdirectory(n) free(db_get_directory_name_for_module(n)) |
Functions | |
int | genread_input (void) |
void | db_create_pips_database (void) |
??? statement_mapping More... | |
bool | db_open_pips_database (FILE *) |
void | db_save_pips_database (FILE *) |
void | db_close_pips_database (void) |
void | db_reset_pips_database_if_necessary (void) |
void | dump_all_db_resource_status (FILE *, string) |
void | db_delete_resource (const char *, const char *) |
Delete a resource. More... | |
bool | db_update_time (const char *, const char *) |
this should really be a put. More... | |
void | db_print_all_required_resources (FILE *) |
void | db_clean_all_required_resources (void) |
bool | db_resource_required_or_available_p (const char *, const char *) |
from now on we must not know about the database internals? More... | |
bool | db_resource_is_required_p (const char *, const char *) |
true if exists and in required state. More... | |
bool | db_resource_p (const char *, const char *) |
true if exists and in loaded or stored state. More... | |
bool | db_touch_resource (const char *, const char *) |
touch logical time for resource[owner], possibly behind the back of pipsdbm. More... | |
int | db_time_of_resource (const char *, const char *) |
string | db_get_resource_id (const char *, const char *) |
some way to identify a resource... More... | |
string | db_get_memory_resource (const char *, const char *, bool) |
Return the pointer to the resource, whatever it is. More... | |
void | db_set_resource_as_required (const char *, const char *) |
void | db_put_or_update_memory_resource (const char *, const char *, void *, bool) |
Put a resource into the current workspace database. More... | |
void | db_invalidate_memory_resource (const char *, const char *) |
int | db_unput_resources (const char *) |
Delete all the resources of a given type "rname". More... | |
list | db_retrieve_resources (const char *) |
Retrieve all the db resources of a given resource type, "rname". More... | |
string | db_resource_name (void *) |
To be used for debugging. More... | |
string | db_resource_owner_name (void *) |
To be used for debugging. More... | |
void | db_save_and_free_memory_resource_if_any (const char *, const char *, bool) |
void | db_delete_all_resources (void) |
FC: I added this function to clean all resources, hence avoiding to save them. More... | |
bool | db_set_current_module_name (const char *) |
string | db_get_current_module_name (void) |
Also used to check whether set... More... | |
void | db_reset_current_module_name (void) |
int | db_delete_obsolete_resources (bool(*)(const char *, const char *)) |
delete all obsolete resources before a close. More... | |
bool | db_module_exists_p (const char *) |
Return whether name is a "valid" module. More... | |
gen_array_t | db_get_module_list_initial_order (void) |
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... | |
int | dbll_number_of_resources (void) |
string | dbll_get_ith_resource_name (int) |
bool | dbll_very_special_resource_p (const char *, const char *) |
void | db_set_current_builder_name (const char *) |
void | db_reset_current_builder_name (void) |
string | db_get_current_builder_name (void) |
string | db_get_directory_name_for_module (const char *) |
returns the allocated and mkdir'ed directory for module name More... | |
string | db_build_file_resource_name (const char *, const char *, const char *) |
returns an allocated file name for a file resource. More... | |
string | get_resource_file_name (const char *, const char *) |
allocate a full file name for the given resource. More... | |
void | dbll_unlink_resource_file (const char *, const char *, bool) |
int | dbll_stat_local_file (const char *, bool) |
It is impportant that the workspace directory does not appear in the file name so as to allow workspaces to be moveable. More... | |
int | dbll_stat_resource_file (const char *, const char *, bool) |
void | dbll_save_resource (const char *, const char *, void *) |
save rname of oname p. More... | |
void * | dbll_load_resource (const char *, const char *) |
void | dbll_free_resource (const char *, const char *, void *) |
bool | dbll_check_resource (const char *, const char *, void *) |
Internal consistency of the resource, not the global consistency wrt other resources and pipsmake rules which is managed by the pipsmake library at a higher level. More... | |
bool | dbll_storable_p (const char *) |
void | dbll_save_and_free_resource (const char *, const char *, void *, bool) |
bool | displayable_file_p (const char *) |
rather approximated. More... | |
bool | dbll_database_managed_file_p (const char *) |
returns whether the file is managed within the database. More... | |
bool | workspace_name_p (const char *) |
workspace.c More... | |
string | db_get_current_workspace_name (void) |
the function is used to check that there is some current workspace... More... | |
string | db_get_workspace_directory_name (const char *) |
returns an allocated string. More... | |
string | db_get_current_workspace_directory (void) |
int | db_inc_logical_time (void) |
0 means not set... More... | |
int | db_get_logical_time (void) |
string | db_get_meta_data_directory (void) |
bool | workspace_exists_p (const char *) |
bool | workspace_ok_p (const char *) |
bool | db_create_workspace (const char *) |
void | db_checkpoint_workspace (void) |
bool | db_close_workspace (bool) |
bool | db_open_workspace (const char *) |
char * | pipsdbm_read_entities (FILE *) |
externals.c More... | |
void | pipsdbm_free_entities (char *) |
void | pipsdbm_write_statement_mapping (FILE *, statement_mapping) |
Write a statement mapping. More... | |
hash_table | pipsdbm_read_statement_mapping (FILE *) |
Read a statement mapping. More... | |
bool | pipsdbm_check_statement_mapping (statement_mapping) |
a little bit partial, because domain are not checked. More... | |
void | pipsdbm_free_statement_mapping (statement_mapping) |
bool | pipsdbm_consistent_statement_function (gen_chunkp) |
void | pipsdbm_write_statement_function (FILE *, gen_chunkp) |
the stored stuff need be based on the ordering... More... | |
gen_chunkp | pipsdbm_read_statement_function (FILE *) |
Should use a higher level pipsdbm_read_statement_mapping() to survive to XML. More... | |
void | free_static_control_mapping (statement_mapping) |
Modification Dec 11 1995: ne pas utiliser free_static_control car il libere des champs qui appartiennent a d'autres structures que celles controlees par static_controlize...(champs d'origine) Les liberation de ces champs par un autre transformer (use_def_elim) entrainait alors un core dump au niveau de cette procedure. More... | |
void | declarations_write (FILE *, hash_table) |
Functions to read and write declarations resource, which is a hash table whose key and value are string (keyword/typedef and TK_keyword/TK_typedef) More... | |
hash_table | declarations_read (FILE *) |
bool | some_main_entity_p (void) |
util.c More... | |
string | get_main_entity_name (void) |
Return the local name of the main module if it is available, or the local name of any module by default. More... | |
void | interrupt_pipsmake_asap (void) |
misc.c More... | |
void | dont_interrupt_pipsmake_asap (void) |
bool | interrupt_pipsmake_asap_p (void) |
void | init_request_timers (void) |
Functions for timing one request. More... | |
void | init_log_timers (void) |
Functions for timing one phase. More... | |
void | dbm_start_timer (void) |
void | dbm_stop_timer (void) |
accumulate dbm related times for one phase More... | |
void | get_string_timers (string *, string *) |
compute times elapsed since init_log_timers(), i.e. More... | |
void | get_request_string_timers (string *, string *, string *) |
compute times elapsed since init_request_log_timers(), i.e. More... | |
void | init_resource_usage_check (void) |
init variables More... | |
void | add_read_resource (string, string) |
add an element to the read set More... | |
void | add_write_resource (string, string) |
add an element to the write set More... | |
void | get_logged_resources (set *, set *) |
Get the made sets. More... | |
Variables | |
FILE * | genread_in |
symbols exported by parser / lexer More... | |
const char * | dbll_current_module |
lowlevel.c More... | |
#define build_pgmwd db_get_workspace_directory_name |
#define db_get_file_resource db_get_memory_resource |
#define db_make_subdirectory | ( | n | ) | free(db_get_directory_name_for_module(n)) |
#define db_unput_a_resource | ( | r, | |
o | |||
) | db_delete_resource(r,o) |
#define MAIN_FILE_NAMES "PROGRAM.main" |
#define PIPSDBM_DEBUG_LEVEL "PIPSDBM_DEBUG_LEVEL" |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/pipsdbm/pipsdbm-local.h instead, to add your own modifications. header file built by cproto pipsdbm-local.h
add an element to the read set
rname | name |
oname | name |
Definition at line 251 of file misc.c.
References concatenate(), res_read, set_add_element(), set_undefined_p, and strdup().
add an element to the write set
rname | name |
oname | name |
Definition at line 260 of file misc.c.
References concatenate(), res_write, set_add_element(), set_undefined_p, and strdup().
string db_build_file_resource_name | ( | const char * | rname, |
const char * | oname, | ||
const char * | suffix | ||
) |
returns an allocated file name for a file resource.
may depend on the current builder, someday. this function is to be used by all phases that generate files. it does not include the directory for movability
mkdir as a side effect.
the next name must be compatible with the Display script... it may depend on the builder function maybe (if pipsmake tells) may include the resource name? as lower letters?
rname | name |
oname | name |
suffix | uffix |
Definition at line 169 of file lowlevel.c.
References concatenate(), db_get_directory_name_for_module(), DEFAULT_OWNER_NAME, free(), pips_debug, same_string_p, strdup(), and STUB_ERROR.
Referenced by actual_symbol_table_dump(), add_new_compilation_unit(), add_new_module_from_text(), filter_file(), flinter(), full_graph_of_calls(), generic_print_xml_application(), gpu_xml_dump(), graph_of_calls(), html_prettyprint(), html_prettyprint_symbol_table(), loop_statistics(), make_resource_from_starting_node(), make_text_resource(), module_to_callgraph(), print_c_code(), print_code_smalltalk(), print_crough(), print_dependence_or_chains_graph(), print_dot_dependence_or_chains_graph(), print_filtered_dg_or_dvdg(), print_interface(), print_loopnest_dependence_cone(), print_loops(), print_sesam_tasks_buffers_header(), print_xml_code(), print_xml_code_with_explicit_motif(), process_user_file(), step_compile(), store_new_module(), and unsplit_internal().
void db_checkpoint_workspace | ( | void | ) |
load ENTITIES (since no one ask for them as they should...)
Definition at line 350 of file workspace.c.
References db_get_current_workspace_name(), db_get_memory_resource(), db_resource_p(), db_save_workspace(), debug_off, debug_on, dump_all_db_resource_status(), ifdebug, pips_debug, and PIPSDBM_DEBUG_LEVEL.
Referenced by checkpoint_workspace().
void db_clean_all_required_resources | ( | void | ) |
of db_symbols
Owner Symbol, Owned Resources
Resource Symbol, DB Resource
DEBUG?
Mark owner symbol os as to be deleted if set of owned resouces is empty.
maybe temporarily required by pipsmake but some error occured
Definition at line 460 of file database.c.
References CONS, db_delete_resource(), db_owned_resources_hash_table, DB_OWNED_RESOURCES_MAP, db_resource_required_p, DB_RESOURCES_MAP, DB_SYMBOL, db_symbol_name, delete_db_resources(), dump_db_resource(), hash_table_entry_count(), MAP, NIL, pips_debug, and pips_user_warning.
Referenced by make(), and safe_do_something().
void db_close_pips_database | ( | void | ) |
Definition at line 150 of file database.c.
References DB_OK, and DB_UNDEF.
Referenced by save_meta_data().
free?
is_quit | s_quit |
Definition at line 367 of file workspace.c.
References db_get_current_workspace_name(), db_reset_current_workspace_name(), db_save_workspace(), debug_off, debug_on, pips_debug, and PIPSDBM_DEBUG_LEVEL.
Referenced by create(), main(), make_close_workspace(), make_open_workspace(), old_reductions(), tpips_internal_error(), and tpips_user_error().
void db_create_pips_database | ( | void | ) |
??? statement_mapping
cproto-generated files database.c
??? statement_mapping
Definition at line 109 of file database.c.
References DB_OK, and DB_UNDEF.
Referenced by db_create_workspace().
bool db_create_workspace | ( | const char * | name | ) |
name | ame |
Definition at line 282 of file workspace.c.
References create_directory(), db_create_pips_database(), db_get_workspace_directory_name(), db_set_current_workspace_name(), debug_off, debug_on, free(), ok, pips_debug, pips_user_warning, PIPSDBM_DEBUG_LEVEL, and purge_directory().
Referenced by create(), end_create_workspace_notify(), execute_workspace_creation_and_so_on_given_with_options(), and pips_main().
void db_delete_all_resources | ( | void | ) |
FC: I added this function to clean all resources, hence avoiding to save them.
This speed up hpfc at low cost;-).
Definition at line 1030 of file database.c.
References DB_OK, db_unput_resources(), dbll_get_ith_resource_name(), and dbll_number_of_resources().
Referenced by delete_all_resources(), and delete_some_resources().
delete all obsolete resources before a close.
return the number of resources destroyed.
of string
Definition at line 1076 of file database.c.
References CAR, CONS, db_delete_resource(), DB_OK, DB_OWNED_RESOURCES_FOREACH, db_resource_required_p, DB_RESOURCES_FOREACH, db_symbol_name, dbll_unlink_resource_file(), debug_off, debug_on, ENDP, gen_free_list(), NIL, pips_debug, POP, and STRING.
Referenced by delete_obsolete_resources().
void db_delete_resource | ( | const char * | rname, |
const char * | oname | ||
) |
Delete a resource.
let us do it!
??? I should unlink the file
rname | name |
oname | name |
Definition at line 353 of file database.c.
References DB_OK, db_owned_resources_undefined_p, db_resource_loaded_and_stored_p, db_resource_loaded_p, db_resource_pointer, db_resource_undefined_p, dbll_free_resource(), delete_db_owned_resources(), find_or_create_db_symbol(), free_db_resource(), get_db_owned_resources(), get_resource(), and pips_assert.
Referenced by db_clean_all_required_resources(), db_clean_db_resources(), db_delete_obsolete_resources(), db_get_memory_resource(), db_save_and_free_resource(), db_unput_resources(), outliner_independent(), and remove_a_resource().
string db_get_current_builder_name | ( | void | ) |
string db_get_current_module_name | ( | void | ) |
Also used to check whether set...
so no asserts, even DB_OK.
Definition at line 1059 of file database.c.
References current_module_name.
Referenced by create_new_entity(), display(), edit_notify(), get_time_ent(), get_view_file(), gpips_display_plain_file(), gpips_execute_and_display_something(), gpips_execute_and_display_something_from_alias(), hpfc_notify(), info(), lazy_open_module(), make_close_workspace(), open_module(), pa_feasibility_ofl_ctrl(), perform(), select_a_module_by_default(), select_module_from_menubar_callback(), select_module_notify(), show_module(), tp_some_info(), transform_notify(), wpips_display_plain_file(), wpips_display_WP65_file(), wpips_execute_and_display_something(), wpips_execute_and_display_something_from_alias(), and wpips_file_view().
string db_get_current_workspace_directory | ( | void | ) |
Definition at line 96 of file workspace.c.
References db_get_current_workspace_name(), db_get_workspace_directory_name(), pips_assert, string_undefined, and STUB_WARNING.
Referenced by actual_c_parser(), actual_symbol_table_dump(), add_new_compilation_unit(), add_new_module_from_text(), alias_check(), callgraph_module_name(), compile_a_pure_function(), compile_a_special_io_function(), compile_f90_module(), create_workspace(), davinci_dump_expressions(), davinci_print_control_nodes(), davinci_print_non_deterministic_unstructured(), db_get_directory_name_for_module(), dbll_stat_local_file(), do_recompile_module(), filter_file(), flinter(), full_graph_of_calls(), generic_print_xml_application(), get_first_main_module(), get_main_entity_name(), gpu_xml_dump(), graph_of_calls(), hbdsc_parallelization(), hpfc_filter(), hpfc_generate_path_name_of_file_name(), hpfc_install(), hpfc_make(), hpfc_print_file(), hpfc_run(), html_prettyprint(), html_prettyprint_symbol_table(), insert_something_in_the_wpips_log_window(), loop_statistics(), make_resource_from_starting_node(), make_text_resource(), module_name_to_input_file_name(), module_to_callgraph(), open_workspace(), outliner_independent(), pips_split_file(), print_array_dfg(), print_bdt(), print_c_code(), print_code_smalltalk(), print_crough(), print_dependence_or_chains_graph(), print_dinf_statistics(), print_dot_dependence_or_chains_graph(), print_dsup_statistics(), print_filtered_dg_or_dvdg(), print_interface(), print_loopnest_dependence_cone(), print_loops(), print_module_name_to_toposorts(), print_plc(), print_proj_op_statistics(), print_sesam_tasks_buffers_header(), print_umay_statistics(), print_umust_statistics(), print_xml_code(), print_xml_code_with_explicit_motif(), process_user_file(), put_generated_resources_for_common(), put_generated_resources_for_module(), put_generated_resources_for_program(), region_translation_statistics_close(), rice_dependence_graph(), sequence_dependence_graph(), some_main_entity_p(), step_compile(), step_compile_generated_module(), the_actual_parser(), unsplit_internal(), used_before_set(), and writeresult().
string db_get_current_workspace_name | ( | void | ) |
the function is used to check that there is some current workspace...
Definition at line 82 of file workspace.c.
References current_workspace_name.
Referenced by activate_phase(), check_delete_workspace(), checkpoint_workspace(), close_workspace(), close_workspace_if_opened(), create(), create_workspace(), db_checkpoint_workspace(), db_close_workspace(), db_get_current_workspace_directory(), edit_notify(), end_create_workspace_notify(), end_delete_workspace_notify(), epips_select_module(), generate_a_directory_menu(), generate_module_menu(), get_module_names(), get_view_file(), hpfc_get_file_list(), hpfc_install(), info(), lazy_open_module(), load_meta_data(), make_close_workspace(), make_open_workspace(), old_reductions(), open_module(), open_module_if_unique(), open_or_create_workspace(), open_workspace(), open_workspace_notify(), options_select(), perform(), quit_notify(), save_meta_data(), send_the_names_of_the_available_modules_to_emacs(), show_workspace(), start_create_workspace_notify(), start_delete_workspace_notify(), start_directory_notify(), tp_close_the_workspace(), tp_some_info(), and tpips_user_error().
string db_get_directory_name_for_module | ( | const char * | name | ) |
returns the allocated and mkdir'ed directory for module name
MKDIR
name | ame |
Definition at line 150 of file lowlevel.c.
References concatenate(), create_directory(), db_get_current_workspace_directory(), directory_exists_p(), free(), pips_assert, pips_user_irrecoverable_error, same_string_p, and strdup().
Referenced by dag_dot_dump(), db_build_file_resource_name(), db_get_meta_data_directory(), generate_hpf_remapping_file(), get_new_tmp_file_name(), get_opencl_file_name(), get_resource_file_name(), helper_file_name(), hpfc_init(), insert_check_alias_before_statement(), insert_flag_before_call_site(), insert_test_before_caller(), insert_test_before_statement(), process_thru_C_pp(), process_thru_fortran_pp(), push_path(), step_install(), text_area_included(), unsplit_internal(), and used_before_set().
int db_get_logical_time | ( | void | ) |
Definition at line 112 of file workspace.c.
References logical_time.
Referenced by db_check_time(), db_put_or_update_memory_resource(), db_set_resource_as_required(), db_touch_resource(), db_update_time(), and save_meta_data().
string db_get_meta_data_directory | ( | void | ) |
Definition at line 139 of file workspace.c.
References db_get_directory_name_for_module(), and METADATA.
Referenced by build_pgm_makefile().
gen_array_t db_get_module_list_initial_order | ( | void | ) |
of db_symbol
Definition at line 1151 of file database.c.
References bound_db_resources_p(), compilation_unit_p(), DB_OK, DB_SYMBOL, db_symbol_domain, db_symbol_name, FOREACH, gen_array_dupappend(), gen_array_make(), gen_filter_tabulated(), gen_free_list(), gen_true(), IGNORE_RX, pips_user_error, same_string_p, string_undefined_p, and symbol().
Referenced by step_compile_generated_module(), step_install(), and unsplit_internal().
string db_get_resource_id | ( | const char * | rname, |
const char * | oname | ||
) |
some way to identify a resource...
could be an id...
rname | name |
oname | name |
Definition at line 704 of file database.c.
References get_real_db_resource().
Referenced by check_physical_resource_up_to_date(), make_required(), rmake(), and update_preserved_resources().
string db_get_workspace_directory_name | ( | const char * | name | ) |
returns an allocated string.
name | ame |
Definition at line 91 of file workspace.c.
References concatenate(), MD_DATABASE, and strdup().
Referenced by db_create_workspace(), db_get_current_workspace_directory(), db_open_workspace(), workspace_exists_p(), and workspace_ok_p().
int db_inc_logical_time | ( | void | ) |
0 means not set...
Definition at line 107 of file workspace.c.
References logical_time.
Referenced by db_check_time(), and update_preserved_resources().
void db_invalidate_memory_resource | ( | const char * | rname, |
const char * | oname | ||
) |
Check the database coherency:
Get the database resource associated to the given resource:
rname | name |
oname | name |
Definition at line 897 of file database.c.
References DB_OK, db_resource_db_status, db_resource_file_time, db_status_undefined_p, and find_or_create_db_resource().
bool db_open_pips_database | ( | FILE * | fd | ) |
fd | d |
Definition at line 119 of file database.c.
References db_clean_db_resources(), DB_OK, db_resources_undefined_p, DB_UNDEF, dump_all_db_resource_status(), ifdebug, and read_db_resources().
Referenced by load_meta_data().
bool db_open_workspace | ( | const char * | name | ) |
failure!
load ENTITIES (since no one ask for them as they should;-)
should touch them somehow to force latter saving?
name | ame |
Definition at line 380 of file workspace.c.
References db_get_memory_resource(), db_get_workspace_directory_name(), db_resource_p(), db_set_current_workspace_name(), debug_off, debug_on, directory_exists_p(), free(), load_meta_data(), ok, pips_debug, pips_user_warning, PIPSDBM_DEBUG_LEVEL, and reset_meta_data().
Referenced by main(), make_open_workspace(), and old_reductions().
void db_print_all_required_resources | ( | FILE * | file | ) |
first collect result
then sort, dump and free
file | ile |
Definition at line 421 of file database.c.
References CAR, CONS, DB_OWNED_RESOURCES_MAP, db_resource_db_status, db_resource_required_p, db_resource_time, DB_RESOURCES_MAP, db_status_string(), db_symbol_name, fprintf(), free(), gen_free_list(), gen_sort_list(), make_tmp_result(), MAPL, NIL, t_tmp_result::owner_name, pips_debug, t_tmp_result::res_name, t_tmp_result::time, and tmp_result_cmp().
Referenced by make(), and rmake().
void db_reset_current_builder_name | ( | void | ) |
Definition at line 134 of file lowlevel.c.
References current_builder, free(), and pips_assert.
void db_reset_current_module_name | ( | void | ) |
Definition at line 1064 of file database.c.
References current_module_name, DB_OK, free(), and pips_assert.
Referenced by display(), make_close_workspace(), open_module(), and perform().
void db_reset_pips_database_if_necessary | ( | void | ) |
Definition at line 155 of file database.c.
Referenced by reset_meta_data().
bool db_resource_is_required_p | ( | const char * | rname, |
const char * | oname | ||
) |
true if exists and in required state.
rname | name |
oname | name |
Definition at line 512 of file database.c.
References DB_OK, db_resource_required_p, db_resource_undefined_p, and get_db_resource().
Referenced by rmake().
string db_resource_name | ( | void * | dbr | ) |
To be used for debugging.
dbr | br |
Definition at line 1000 of file database.c.
References db_resource_name_or_owner_name().
Referenced by make_cache_consistent_p(), print_make_cache(), and remove_resource_from_make_cache().
string db_resource_owner_name | ( | void * | dbr | ) |
To be used for debugging.
dbr | br |
Definition at line 1006 of file database.c.
References db_resource_name_or_owner_name().
Referenced by make_cache_consistent_p(), print_make_cache(), and remove_resource_from_make_cache().
bool db_resource_p | ( | const char * | rname, |
const char * | oname | ||
) |
true if exists and in loaded or stored state.
rname | name |
oname | name |
Definition at line 524 of file database.c.
References DB_OK, db_resource_loaded_and_stored_p, db_resource_loaded_p, db_resource_stored_p, db_resource_undefined_p, and get_db_resource().
Referenced by bootstrap(), bootstrap_kernels(), bootstrap_stubs(), check_physical_resource_up_to_date(), check_resource_up_to_date(), compilation_unit_of_module(), db_checkpoint_workspace(), db_open_workspace(), do_inlining(), flag_as_stub(), flag_kernel(), generic_initializer(), get_module_precondition(), get_stubs(), just_show(), language_module_p(), load_summary_transformer(), make_cache_consistent_p(), make_required(), module_entity_to_compilation_unit_entity(), module_in_user_file_p(), module_name_to_input_file_name(), node(), old_summary_precondition(), preserve_virtual_resource(), recursive_append(), remove_a_resource(), rmake(), show(), the_actual_parser(), and touch_a_resource().
bool db_resource_required_or_available_p | ( | const char * | rname, |
const char * | oname | ||
) |
from now on we must not know about the database internals?
true if exists and in ANY state.
rname | name |
oname | name |
Definition at line 505 of file database.c.
References DB_OK, db_resource_undefined_p, get_db_resource(), and STUB_ERROR.
Referenced by AddEntityToCompilationUnit(), outliner_independent(), RemoveEntityFromCompilationUnit(), and step_analysed_module_p().
list db_retrieve_resources | ( | const char * | rname | ) |
Retrieve all the db resources of a given resource type, "rname".
Scan all module hash tables to find all resources of kind "rname", no matter what the owner is.
Used only to clean up the make cache in pipsmake.c.
Derived from db_unput_resources()
Scan all resource maps or of owners
See if it contains a resource of kind rname, normalized to r
rname | name |
Definition at line 943 of file database.c.
References bound_db_owned_resources_p(), CONS, DB_OK, DB_RESOURCE, DB_RESOURCES_MAP, find_or_create_db_symbol(), get_resource(), NIL, and pips_debug.
Referenced by delete_named_resources().
void db_save_and_free_memory_resource_if_any | ( | const char * | rname, |
const char * | oname, | ||
bool | do_free | ||
) |
rname | name |
oname | name |
do_free | o_free |
Definition at line 1012 of file database.c.
References DB_OK, db_resource_loaded_and_stored_p, db_resource_loaded_p, db_resource_undefined_p, db_save_and_free_resource(), get_db_resource(), and pips_debug.
Referenced by db_close_module().
void db_save_pips_database | ( | FILE * | fd | ) |
db_resources dbres;
??? check for required resources left over?
save a cleaned COPY with status artificially set as STORED...
dbres = copy_db_resources(get_pips_database()); db_clean_db_resources(dbres);
free_db_resources(dbres);
fd | d |
Definition at line 137 of file database.c.
References DB_OK, and write_db_resources().
Referenced by save_meta_data().
void db_set_current_builder_name | ( | const char * | name | ) |
name | ame |
Definition at line 128 of file lowlevel.c.
References current_builder, pips_assert, and strdup().
bool db_set_current_module_name | ( | const char * | name | ) |
can be rejected softly
name | ame |
Definition at line 1045 of file database.c.
References current_module_name, DB_OK, init_owned_resources_if_necessary(), ok, pips_assert, pips_user_warning, simple_name_p(), and strdup().
Referenced by display(), open_module(), and perform().
void db_set_resource_as_required | ( | const char * | rname, |
const char * | oname | ||
) |
newly created db_resource...
rname | name |
oname | name |
Definition at line 797 of file database.c.
References db_get_logical_time(), DB_OK, db_resource_db_status, db_resource_pointer, db_resource_time, db_status_loaded_and_stored_p, db_status_loaded_p, db_status_string(), db_status_tag, db_status_undefined_p, dbll_free_resource(), find_or_create_db_resource(), is_db_status_required, make_db_status(), pips_debug, and UU.
Referenced by rmake().
int db_time_of_resource | ( | const char * | rname, |
const char * | oname | ||
) |
we load the resource if it is a simple file name... the file time stamps are checked here anyway.
will update time if needed.
may update time...
rname | name |
oname | name |
Definition at line 603 of file database.c.
References db_check_time(), db_load_resource(), DB_OK, db_resource_required_p, db_resource_stored_p, db_resource_time, db_resource_undefined_p, displayable_file_p(), and get_db_resource().
Referenced by check_physical_resource_up_to_date(), and rmake().
bool db_touch_resource | ( | const char * | rname, |
const char * | oname | ||
) |
touch logical time for resource[owner], possibly behind the back of pipsdbm.
rname | name |
oname | name |
Definition at line 538 of file database.c.
References db_get_logical_time(), DB_OK, db_resource_time, get_real_db_resource(), and STUB_ERROR.
Referenced by AddEntityToCompilationUnit(), linearize_array_generic(), normalize_microcode(), outliner_independent(), preserve_virtual_resource(), RemoveEntityFromCompilationUnit(), sort_parameters(), and touch_a_resource().
int db_unput_resources | ( | const char * | rname | ) |
Delete all the resources of a given type "rname".
Return the number of deleted resources
Each owner map has to be checked because of two-level mapping used.
rname | name |
Definition at line 915 of file database.c.
References bound_db_owned_resources_p(), count, db_delete_resource(), DB_OK, DB_RESOURCES_MAP, db_symbol_name, dbll_unlink_resource_file(), find_or_create_db_symbol(), and pips_debug.
Referenced by activate_phase(), db_delete_all_resources(), and delete_named_resources().
bool db_update_time | ( | const char * | rname, |
const char * | oname | ||
) |
this should really be a put.
Just there for upward compatibility.
bll_stat_resource_file(rname, oname, true);
rname | name |
oname | name |
Definition at line 380 of file database.c.
References db_get_logical_time(), DB_OK, db_resource_file_time, db_resource_pointer, db_resource_time, dbll_stat_local_file(), displayable_file_p(), get_real_db_resource(), and pips_assert.
bool dbll_check_resource | ( | const char * | rname, |
const char * | oname, | ||
void * | p | ||
) |
Internal consistency of the resource, not the global consistency wrt other resources and pipsmake rules which is managed by the pipsmake library at a higher level.
Know right away which resource is Newgen inconsistent
FI: I find this message I have added myself pretty useless in general as a core dump occurs in case some inconsistency is found.
rname | name |
oname | name |
Definition at line 324 of file lowlevel.c.
References bool_to_string(), methods::check_function, get_methods(), and pips_debug.
Referenced by db_get_memory_resource(), and db_put_or_update_memory_resource().
bool dbll_database_managed_file_p | ( | const char * | name | ) |
returns whether the file is managed within the database.
that is it is not a SOURCE_FILE. basically SOURCE_FILEs are given relative names with leading . or /, while within the database a leading "*.database/" is always appended.
name | ame |
Definition at line 376 of file lowlevel.c.
Referenced by db_check_time().
void dbll_free_resource | ( | const char * | rname, |
const char * | oname, | ||
void * | p | ||
) |
rname | name |
oname | name |
Definition at line 313 of file lowlevel.c.
References methods::free_function, get_methods(), and pips_debug.
Referenced by db_delete_resource(), db_save_and_free_resource(), db_set_resource_as_required(), and dbll_save_and_free_resource().
Definition at line 113 of file lowlevel.c.
References all_methods, dbll_number_of_resources(), methods::name, and pips_assert.
Referenced by db_close_module(), and db_delete_all_resources().
void* dbll_load_resource | ( | const char * | rname, |
const char * | oname | ||
) |
rname | name |
oname | name |
Definition at line 294 of file lowlevel.c.
References close_resource_file(), dbll_current_module, f(), get_methods(), no_read, open_resource_file(), pips_debug, pips_internal_error, and methods::read_function.
Referenced by db_load_resource().
int dbll_number_of_resources | ( | void | ) |
I'm not sure sizeof(all_methods) is ANSI C. FC
Definition at line 108 of file lowlevel.c.
References all_methods.
Referenced by db_close_module(), db_delete_all_resources(), dbll_get_ith_resource_name(), and get_methods().
void dbll_save_and_free_resource | ( | const char * | rname, |
const char * | oname, | ||
void * | p, | ||
bool | do_free | ||
) |
rname | name |
oname | name |
do_free | o_free |
Definition at line 350 of file lowlevel.c.
References dbll_free_resource(), and dbll_save_resource().
Referenced by db_save_and_free_resource().
void dbll_save_resource | ( | const char * | rname, |
const char * | oname, | ||
void * | p | ||
) |
save rname of oname p.
get the method, then apply it.
rname | name |
oname | name |
Definition at line 275 of file lowlevel.c.
References close_resource_file(), dbll_current_module, f(), get_methods(), no_write, open_resource_file(), pips_debug, pips_user_warning, and methods::write_function.
Referenced by db_save_resource(), and dbll_save_and_free_resource().
It is impportant that the workspace directory does not appear in the file name so as to allow workspaces to be moveable.
file_name | ile_name |
okifnotthere | kifnotthere |
Definition at line 251 of file lowlevel.c.
References concatenate(), db_get_current_workspace_directory(), dbll_stat_file(), file_name, free(), full_name, and strdup().
Referenced by db_check_time(), db_put_or_update_memory_resource(), and db_update_time().
rname | name |
oname | name |
okifnotthere | kifnotthere |
Definition at line 265 of file lowlevel.c.
References dbll_stat_file(), file_name, free(), and get_resource_file_name().
Referenced by db_check_time(), db_clean_db_resources(), db_save_and_free_resource(), and db_save_resource().
bool dbll_storable_p | ( | const char * | rname | ) |
rname | name |
Definition at line 341 of file lowlevel.c.
References get_methods(), no_write, and methods::write_function.
Referenced by db_get_memory_resource(), db_save_and_free_resource(), and db_save_resource().
void dbll_unlink_resource_file | ( | const char * | rname, |
const char * | oname, | ||
bool | erroriffailed | ||
) |
rname | name |
oname | name |
erroriffailed | rroriffailed |
Definition at line 219 of file lowlevel.c.
References free(), full_name, get_resource_file_name(), and pips_internal_error.
Referenced by db_delete_obsolete_resources(), and db_unput_resources().
bool dbll_very_special_resource_p | ( | const char * | rname, |
const char * | oname | ||
) |
rname | name |
oname | name |
Definition at line 119 of file lowlevel.c.
References same_string_p.
Referenced by db_load_resource(), and db_save_and_free_resource().
void dbm_start_timer | ( | void | ) |
Definition at line 131 of file misc.c.
References dbm_time, real_dbm_time, and set_current_time().
void dbm_stop_timer | ( | void | ) |
accumulate dbm related times for one phase
Definition at line 137 of file misc.c.
References current, dbm_time, real_dbm_time, real_total_dbm_time, set_current_time(), and total_dbm_time.
hash_table declarations_read | ( | FILE * | f | ) |
Definition at line 345 of file externals.c.
References f(), hash_put(), hash_string, hash_table_make(), and safe_readline().
void declarations_write | ( | FILE * | f, |
hash_table | h | ||
) |
Functions to read and write declarations resource, which is a hash table whose key and value are string (keyword/typedef and TK_keyword/TK_typedef)
Definition at line 335 of file externals.c.
References f(), fprintf(), and HASH_MAP.
bool displayable_file_p | ( | const char * | name | ) |
rather approximated.
beware that this function is used to check whether a resource is a file, and also to check its current time on pipsmake dependencies.
name | ame |
Definition at line 361 of file lowlevel.c.
References find_suffix(), get_methods(), methods::write_function, and writeln_string().
Referenced by db_check_time(), db_put_or_update_memory_resource(), db_save_resource(), db_time_of_resource(), db_update_time(), get_view_file(), just_show(), and show().
void dont_interrupt_pipsmake_asap | ( | void | ) |
Definition at line 53 of file misc.c.
References flag_interrupt_pipsmake_asap.
Referenced by apply(), concurrent_apply(), delete_some_resources(), and make().
void dump_all_db_resource_status | ( | FILE * | file, |
string | where | ||
) |
file | ile |
where | here |
Definition at line 198 of file database.c.
References DB_OWNED_RESOURCES_MAP, db_resource_db_status, db_resource_file_time, db_resource_pointer, db_resource_time, DB_RESOURCES_MAP, db_status_string(), db_symbol_name, fprintf(), and pips_debug.
Referenced by db_checkpoint_workspace(), db_clean_db_resources(), and db_open_pips_database().
void free_static_control_mapping | ( | statement_mapping | map | ) |
Modification Dec 11 1995: ne pas utiliser free_static_control car il libere des champs qui appartiennent a d'autres structures que celles controlees par static_controlize...(champs d'origine) Les liberation de ces champs par un autre transformer (use_def_elim) entrainait alors un core dump au niveau de cette procedure.
On fait a la place des gen_free_list en detail –DB ]
map | ap |
Definition at line 318 of file externals.c.
References FREE_STATEMENT_MAPPING, gen_free(), gen_free_list(), STATEMENT_MAPPING_MAP, static_control_loops, static_control_params, and static_control_tests.
int genread_input | ( | void | ) |
string get_main_entity_name | ( | void | ) |
Return the local name of the main module if it is available, or the local name of any module by default.
Hopefully, the module names are sorted and the same module of rank 0 is always returned.
A new string is allocated.
Up to a memory leak: entity get_main_entity(void) == module_name_to_entity(get_main_entity_name())
??? some default if there is no main...
This has an impact on interprocedural analysis and especially semantics and works well if only one function is analyzed.
Definition at line 63 of file util.c.
References buffer, concatenate(), db_get_current_workspace_directory(), db_get_module_list(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), MAIN_FILE_NAMES, MAXIMAL_MODULE_NAME_SIZE, pips_assert, pips_user_warning, safe_fgets(), strdup(), string_undefined, and strndup().
Referenced by generic_program_pointer_values(), print_program_precondition(), program_points_to(), program_postcondition(), and program_precondition().
compute times elapsed since init_request_log_timers(), i.e.
for one request to pipsmake (btw this code is misplaced...)
global | lobal |
phases | hases |
dbm | bm |
Definition at line 196 of file misc.c.
References MAX_TIME_STRING_LENGTH, real_request_dbm_time, real_request_phase_time, real_request_time, request_dbm_time, request_phase_time, request_time, s1, and set_current_time().
Referenced by logs_off().
string get_resource_file_name | ( | const char * | rname, |
const char * | oname | ||
) |
allocate a full file name for the given resource.
rname | name |
oname | name |
Definition at line 187 of file lowlevel.c.
References concatenate(), db_get_directory_name_for_module(), DEFAULT_OWNER_NAME, file_name, free(), same_string_p, and strdup().
Referenced by close_resource_file(), dbll_stat_resource_file(), dbll_unlink_resource_file(), f95split(), open_resource_file(), and process_user_file().
compute times elapsed since init_log_timers(), i.e.
for one phase
accumulate phase times in request times, ignoring sub-processes ???
with_io | ith_io |
io | o |
Definition at line 155 of file misc.c.
References MAX_TIME_STRING_LENGTH, phase_time, real_phase_time, real_request_dbm_time, real_request_phase_time, real_total_dbm_time, request_dbm_time, request_phase_time, s1, set_current_time(), and total_dbm_time.
Referenced by apply_a_rule().
void init_log_timers | ( | void | ) |
Functions for timing one phase.
Definition at line 122 of file misc.c.
References phase_time, real_phase_time, real_total_dbm_time, set_current_time(), and total_dbm_time.
Referenced by apply_a_rule().
void init_request_timers | ( | void | ) |
Functions for timing one request.
initialize accumulators for dbm and phase times
Definition at line 106 of file misc.c.
References real_request_dbm_time, real_request_phase_time, real_request_time, request_dbm_time, request_phase_time, request_time, and set_current_time().
Referenced by logs_on().
void init_resource_usage_check | ( | void | ) |
init variables
Definition at line 240 of file misc.c.
References res_read, res_write, set_clear(), set_make(), set_string, and set_undefined_p.
Referenced by apply_a_rule().
void interrupt_pipsmake_asap | ( | void | ) |
misc.c
Definition at line 48 of file misc.c.
References flag_interrupt_pipsmake_asap.
Referenced by pips_signal_handler(), and wpips_interrupt_pipsmake().
bool interrupt_pipsmake_asap_p | ( | void | ) |
Definition at line 58 of file misc.c.
References flag_interrupt_pipsmake_asap.
Referenced by apply_a_rule().
bool pipsdbm_check_statement_mapping | ( | statement_mapping | h | ) |
a little bit partial, because domain are not checked.
Definition at line 178 of file externals.c.
References gen_consistent_p(), pips_assert, statement_consistent_p(), and STATEMENT_MAPPING_MAP.
bool pipsdbm_consistent_statement_function | ( | gen_chunkp | map | ) |
map | ap |
Definition at line 226 of file externals.c.
References gen_consistent_p(), gen_type(), statement_domain, STATEMENT_FUNCTION_MAP, and x.
void pipsdbm_free_entities | ( | char * | p | ) |
Definition at line 72 of file externals.c.
References entity_domain, gen_free_tabulated(), and pips_assert.
void pipsdbm_free_statement_mapping | ( | statement_mapping | h | ) |
Definition at line 190 of file externals.c.
References FREE_STATEMENT_MAPPING, gen_free(), and STATEMENT_MAPPING_MAP.
char* pipsdbm_read_entities | ( | FILE * | fd | ) |
fd | d |
Definition at line 64 of file externals.c.
References entity_domain, gen_read_tabulated(), and pips_assert.
gen_chunkp pipsdbm_read_statement_function | ( | FILE * | fd | ) |
Should use a higher level pipsdbm_read_statement_mapping() to survive to XML.
get meta data.
allocate the statement function.
now reads each couple and rebuild the function.
fd | d |
Definition at line 271 of file externals.c.
References db_get_memory_resource(), dbll_current_module, gen_alloc(), GEN_CHECK_ALLOC, gen_read(), HASH_EXTEND, lire_int(), ordering_to_statement(), pips_assert, pips_debug, reset_ordering_to_statement(), set_ordering_to_statement(), and STATEMENT_ORDERING_UNDEFINED.
hash_table pipsdbm_read_statement_mapping | ( | FILE * | fd | ) |
Read a statement mapping.
This function is quite too low level... It mixes raw getc() from a FILE with gen_read. To survive other NewGen backend (XML), fprintf could be replaced with a gen_getc() that could peek in a CDATA for example in the case of XML.
But in this case it should be a call to something like so = gen_read_int(fd) instead to do even simpler and read an int value (in textual form or in <int>...</int> in the case of XML.
get meta data.
fd | d |
Definition at line 147 of file externals.c.
References db_get_memory_resource(), dbll_current_module, gen_read(), hash_pointer, hash_put(), hash_table_make(), lire_int(), ordering_to_statement(), pips_assert, pips_debug, reset_ordering_to_statement(), set_ordering_to_statement(), and STATEMENT_ORDERING_UNDEFINED.
void pipsdbm_write_statement_function | ( | FILE * | fd, |
gen_chunkp | map | ||
) |
the stored stuff need be based on the ordering...
because newgen won't regenerate pointers...
Should use a higher level pipsdbm_write_statement_mapping() to survive to XML
save it!
fd | file to write to |
map | statement function |
Definition at line 245 of file externals.c.
References fprintf(), gen_write(), gen_chunk::i, number_of_ordered_statements(), pips_user_warning, STATEMENT_FUNCTION_MAP, statement_identification(), statement_ordering, STATEMENT_ORDERING_UNDEFINED, and x.
void pipsdbm_write_statement_mapping | ( | FILE * | fd, |
statement_mapping | h | ||
) |
Write a statement mapping.
This function is quite too low level... It mixes raw printf in a FILE with gen_write. To survive other NewGen backend (XML), fprintf could be replaced with a gen_fprintf() that could encapsulate the output in a CDATA for example in the case of XML.
But in this case it should be a call to something like gen_write_int(fd, order) instead to do even simpler.
save it!
fd | file to write to |
h | hash table to dump |
Definition at line 115 of file externals.c.
References fprintf(), gen_write(), pips_user_warning, statement_mapping_count(), STATEMENT_MAPPING_MAP, statement_ordering, and STATEMENT_ORDERING_UNDEFINED.
bool some_main_entity_p | ( | void | ) |
util.c
util.c
Definition at line 37 of file util.c.
References concatenate(), db_get_current_workspace_directory(), free(), MAIN_FILE_NAMES, and strdup().
Referenced by ordinary_summary_precondition(), and summary_total_postcondition().
bool workspace_exists_p | ( | const char * | name | ) |
name | ame |
Definition at line 266 of file workspace.c.
References db_get_workspace_directory_name(), directory_exists_p(), free(), and full_name.
Referenced by continue_create_workspace_notify(), create(), and open_workspace().
bool workspace_name_p | ( | const char * | name | ) |
name | ame |
Definition at line 46 of file workspace.c.
References WORKSPACE_NAME_CHARS.
Referenced by continue_create_workspace_notify(), db_set_current_workspace_name(), end_create_workspace_notify(), and open_or_create_workspace().
bool workspace_ok_p | ( | const char * | name | ) |
name | ame |
Definition at line 274 of file workspace.c.
References db_get_workspace_directory_name(), file_readable_p(), free(), and full_name.
Referenced by open_workspace().
|
extern |
Definition at line 41 of file lowlevel.c.
Referenced by dbll_load_resource(), dbll_save_resource(), pipsdbm_read_statement_function(), and pipsdbm_read_statement_mapping().
|
extern |
symbols exported by parser / lexer