PIPS
|
Go to the source code of this file.
Macros | |
#define | CALLGRAPH_INCLUDED |
Warning! Do not modify this file that is automatically generated! More... | |
#define | CALLGRAPH_NOT_FOUND NULL |
#define | CALLGRAPH_DRAW "CALLGRAPH_DRAW" |
#define | CALLGRAPH_DEBUG "CALLGRAPH_DEBUG" |
#define | CALLGRAPH_DEBUG_LEVEL "CALLGRAPH_DEBUG_LEVEL" |
#define | CALLGRAPH_SHORT_NAMES "CALLGRAPH_SHORT_NAMES" |
#define | CALLGRAPH_INDENT 4 |
Functions | |
list | string_to_callees (const string) |
CALLGRAPH_INCLUDED. More... | |
list | entity_to_callees (entity) |
bool | module_is_called_by_main_program_p (entity) |
list | callers_to_call_sites (list, entity) |
given a list callers_statement of module statements returns a list of calls to module called_module More... | |
list | callers_to_statements (list) |
given a list callers of module name calling module called module return a list of their body More... | |
void | sort_parameters (entity, gen_cmp_func_t) |
change the parameter order for function module using comparison function cmp both compilation unit and callers are touched SG: it may be put in ri-util, but this would create a dependency from callgraph ... More... | |
bool | module_to_callgraph (entity, text(*)(const string)) |
callees | compute_callees (const statement) |
Recompute the callees of a module statement. More... | |
bool | callgraph (const string) |
callgraph computes the caller list of each module, using the callees list of them. More... | |
void | print_callees (callees) |
print.c More... | |
bool | print_decorated_call_graph (const string, text(*)(const string)) |
bool | print_call_graph (const string) |
bool | graph_of_calls (const string) |
graph.c More... | |
bool | full_graph_of_calls (string) |
To be called by pipsmake. More... | |
#define CALLGRAPH_DEBUG "CALLGRAPH_DEBUG" |
Definition at line 42 of file callgraph.h.
#define CALLGRAPH_DEBUG_LEVEL "CALLGRAPH_DEBUG_LEVEL" |
Definition at line 43 of file callgraph.h.
#define CALLGRAPH_DRAW "CALLGRAPH_DRAW" |
Definition at line 41 of file callgraph.h.
#define CALLGRAPH_INCLUDED |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/callgraph/callgraph-local.h instead, to add your own modifications. header file built by cproto callgraph-local.h callgraph.h include file for callgraphs
Definition at line 37 of file callgraph.h.
#define CALLGRAPH_INDENT 4 |
Definition at line 46 of file callgraph.h.
#define CALLGRAPH_NOT_FOUND NULL |
Definition at line 39 of file callgraph.h.
#define CALLGRAPH_SHORT_NAMES "CALLGRAPH_SHORT_NAMES" |
Definition at line 44 of file callgraph.h.
given a list callers_statement
of module statements returns a list of calls to module called_module
callers_statement | allers_statement |
called_module | alled_module |
Definition at line 149 of file callgraph.c.
References call_domain, FOREACH, gather_call_sites(), gather_call_sites_in_block(), gen_context_multi_recurse(), gen_true2(), NIL, gather_call_sites_t::sites, STATEMENT, and statement_domain.
Referenced by do_linearize_array_manage_callers(), normalize_microcode(), and sort_parameters().
given a list callers
of module name calling module called
module return a list of their body
callers | allers |
Definition at line 163 of file callgraph.c.
References caller_name, CONS, db_get_memory_resource(), FOREACH, gen_nreverse(), NIL, STATEMENT, and STRING.
Referenced by delay_communications_interprocedurally(), do_linearize_array_manage_callers(), normalize_microcode(), and sort_parameters().
callgraph computes the caller list of each module, using the callees list of them.
As a side effect, it also computes their heights and depths in the call graph and detects recursive call cycles.
callgraph is not able to generate missing source code.
Note: although callgraph is directly and internally used by pipsmake which needs to know about the callers of a module to chain its rules, it might be better to store it in a future (new) callgraph library (FI)
Argument "name" is not used. It is instantiated as a specific module by make() but this routine process the whole program.
Number of modules called whose source code is missing but synthesized by PIPS
Should we deal with strings or with entities?
Define the module_set and initialize the module callers, except for modules whose source code is missing.
Compute iteratively the callers from the callees. Synthesize missing codes if necessary and if the corresponding property is set.
The number of iterations depends on the order of the modules in the hash-tables.
Simple but inefficient implementation for Cathar-2
Should not be an error as PIPS can synthesize missing code and does it elsewhere...
set_pips_current_computation(DBR_CALLEES, module_called);
push_pips_current_computation(DBR_CALLEES, module_called);
It has no callees to exploit anyway; it does not matter that it is not looped over by the main loop. module_callers is going to be updated and will be used to store the results.
You cannot call pips_user_error() again, as it has just been called by rmake via apply_a_rule()
pop_pips_current_computation(DBR_CALLEES, module_called);
reset_pips_current_computation();
Since Fabien is not available to help with pipsdbm... Let's move on with Cathare-2!
name | ame |
Definition at line 460 of file callgraph.c.
References asprintf, called_modules, callees_callees, callees_undefined, CAR, CONS, db_get_memory_resource(), db_get_module_list(), DB_PUT_MEMORY_RESOURCE, depth, ENDP, fprintf(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), gen_nconc(), hash_get(), HASH_MAP, hash_put(), hash_string, hash_table_free(), hash_table_make(), HASH_UNDEFINED_VALUE, ifdebug, list_undefined, make_callees(), module_name(), NIL, pips_assert, pips_debug, pips_user_warning, POP, print_callees(), reset_current_phase_context(), rmake(), set_add_element(), set_belong_p(), set_current_phase_context(), set_free(), set_make(), set_string, strdup(), STRING, and transitive_positions().
Recompute the callees of a module statement.
stat | is the module statement |
stat | tat |
Definition at line 355 of file callgraph.c.
References add_call_to_callees(), call_domain, declaration_statement_add_call_to_callees(), gen_context_multi_recurse(), gen_null(), gen_true2(), make_callees(), NIL, and statement_domain.
Referenced by delay_communications(), delay_communications_interprocedurally(), delay_load_communications(), delay_store_communications(), do_isolate_statement_preconditions_satisified_p(), do_kernelize(), do_unfolding(), expression_substitution(), freia_compiler(), fsm_generation(), fsm_merge_states(), fsm_split_state(), full_fsm_generation(), full_spaghettify(), generate_starpu_pragma(), gpu_ify(), gpu_memory(), if_conversion(), inline_calls(), isolate_statement(), kernel_load_store_engine(), kernelize(), old__gpu_ify(), outline(), outliner_independent_recursively(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), phrase_distributor_init(), pragma_outliner(), prepend_call(), process_reduced_loops(), redundant_load_store_elimination(), rename_operator(), safescale_distributor(), safescale_distributor_init(), scalopify(), scalopragma(), sesamify(), simd_remove_reductions(), simdizer(), spaghettify(), taskify(), and wrap_kernel_argument().
mod | od |
Definition at line 89 of file callgraph.c.
References CONS, ENTITY, entity_name, FOREACH, module_name(), module_name_to_entity(), NIL, STRING, and string_to_callees().
Referenced by callgraph_module_name().
To be called by pipsmake.
Generate a global resource, hence name is ignored.
build file name... and open it.
prolog, per module stuff, epilog.
close and clean...
put resulting resource into pipsdbm.
name | ame |
Definition at line 147 of file graph.c.
References concatenate(), db_build_file_resource_name(), db_get_current_workspace_directory(), db_get_module_list(), DB_PUT_FILE_RESOURCE, DV_SUFFIX, file_name, fprintf(), free(), full_name, gen_array_free(), gen_array_item(), gen_array_nitems(), node(), out, pips_debug, PROGRAM_RESOURCE_OWNER, safe_fclose(), safe_fopen(), and strdup().
graph.c
graph.c
builds the daVinci file for module "name".
do the job here.
name | ame |
Definition at line 120 of file graph.c.
References close_seen(), concatenate(), db_build_file_resource_name(), db_get_current_workspace_directory(), DB_PUT_FILE_RESOURCE, DV_SUFFIX, file_name, fprintf(), free(), full_name, init_seen(), out, recursive_append(), safe_fclose(), safe_fopen(), and strdup().
mod | od |
Definition at line 103 of file callgraph.c.
References callees_callees, caller_name, CAR, CDR, current_caller, db_get_memory_resource(), ENDP, entity_main_module_p(), module_local_name(), module_name_to_entity(), and STRING.
Referenced by alias_propagation(), and alias_propagation_callers().
module | odule |
Definition at line 270 of file callgraph.c.
References callgraph_module_name(), concatenate(), db_build_file_resource_name(), db_get_current_workspace_directory(), DB_PUT_FILE_RESOURCE, free(), full, module, module_resource_name(), safe_fclose(), safe_fopen(), and strdup().
Referenced by print_decorated_call_graph().
bool print_call_graph | ( | const | string | ) |
string | odule_name |
Definition at line 82 of file print.c.
References module_name(), and print_decorated_call_graph().
void print_callees | ( | callees | c | ) |
print.c
print.c
They should be called by pipsmake
Lei Zhou, February 91 Modification:
Definition at line 52 of file print.c.
References callees_callees, MAP, printf(), and STRING.
Referenced by callgraph().
string | odule_name |
Definition at line 64 of file print.c.
References CALLGRAPH_DEBUG_LEVEL, debug_off, debug_on, module_name(), module_name_to_entity(), module_to_callgraph(), and pips_debug.
Referenced by print_call_graph(), print_call_graph_with_complexities(), print_call_graph_with_preconditions(), print_call_graph_with_total_preconditions(), and print_call_graph_with_transformers().
void sort_parameters | ( | entity | module, |
gen_cmp_func_t | cmp | ||
) |
change the parameter order for function module
using comparison function cmp
both compilation unit and callers are touched SG: it may be put in ri-util, but this would create a dependency from callgraph ...
retrieve the formal parameters
order them
update offset
update parameter list
change call sites
for each call site , reorder arguments according to table reordering
tell dbm of the update
yes! some people use free in pips !
module | odule |
cmp | mp |
Definition at line 180 of file callgraph.c.
References CALL, call_arguments, callees_callees, callers_to_call_sites(), callers_to_statements(), CAR, compilation_unit_of_module(), CONS, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, db_touch_resource(), ENDP, ENTITY, entity_storage, EXPRESSION, f(), FOREACH, formal_offset, gen_free_list(), gen_length(), gen_nreverse(), gen_nth(), gen_sort_list(), get_current_module_name(), intptr_t, module, module_formal_parameters(), module_functional_parameters, NIL, offset, PARAMETER, POP, STATEMENT, storage_formal, and STRING.
Referenced by normalize_microcode_parameter_orders().
CALLGRAPH_INCLUDED.
cproto-generated files callgraph.c
CALLGRAPH_INCLUDED.
Entry point:
Pierre Berthomier, May 1990 Lei Zhou, January 1991 Guillaume Oget, June 1995 To have asprintf(): DB_PUT_FILE_RESOURCE is defined there get all the callees of the module module_name,return the no-empty list of string. if the module has callee(s),the first element of the return list is the mudule's last callee.
module_name | odule_name |
Definition at line 69 of file callgraph.c.
References BLOCKDATA_PREFIX, callees_callees, callees_undefined, COMMON_PREFIX, db_get_memory_resource(), local_name(), MAIN_PREFIX, module_name(), and static_module_name_p().
Referenced by entity_to_callees().