PIPS
|
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "pipsdbm.h"
#include "ri.h"
#include "ri-util.h"
#include "icfg.h"
Go to the source code of this file.
Functions | |
list | module_name_to_callees (char *module_name) const |
toposort.c More... | |
list | module_to_callees (entity mod) |
void | topological_number_assign_to_module (hash_table hash_module_to_depth, entity mod, size_t n) |
list | module_list_sort (hash_table hash_module_to_depth, list current_list, entity mod, size_t n) |
list | topologically_sorted_module_list (entity mod) |
void | print_module_name_to_toposorts (char *module_name) const |
list module_list_sort | ( | hash_table | hash_module_to_depth, |
list | current_list, | ||
entity | mod, | ||
size_t | n | ||
) |
create the callees list whose caller has the depth n
free the same_depth_list for later use
create same_depth_list whose depth is n+1
concatenate former current_list with same_depth_list
use module_list_sort recursively
hash_module_to_depth | ash_module_to_depth |
current_list | urrent_list |
mod | od |
Definition at line 123 of file toposort.c.
References CAR, CONS, depth, ENTITY, gen_copy_seq(), gen_nconc(), hash_get(), hash_put(), MAPL, module_list_sort(), module_to_callees(), and NIL.
Referenced by module_list_sort(), and topologically_sorted_module_list().
list module_name_to_callees | ( | char* | module_name | ) | const |
Entry point: list topologically_sorted_module_list(mod)
returns the list of subroutines/functions called in the module mod sorted as follow: we recursively build the graph of calls, taking mod for root, and we apply on it the topological sort. The first of the list is the module mod itself.
Pierre Berthomier, May 1990 Lei Zhou, January 1991 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 module's last callee.
Definition at line 59 of file toposort.c.
References callees_callees, db_get_memory_resource(), hash_get(), hash_pointer, hash_put(), hash_table_make(), HASH_UNDEFINED_VALUE, module_name(), and NIL.
mod | od |
Definition at line 85 of file toposort.c.
References CAR, code_declarations, CONS, ENTITY, entity_code(), entity_local_name(), entity_type, local_name_to_top_level_entity(), MAPL, NIL, and type_functional_p.
Referenced by module_list_sort(), and topological_number_assign_to_module().
void print_module_name_to_toposorts | ( | char* | module_name | ) | const |
Definition at line 195 of file toposort.c.
References CAR, concatenate(), db_get_current_workspace_directory(), debug_off, debug_on, ENTITY, entity_module_p(), entity_name, entity_undefined, fprintf(), ICFG_DEBUG_LEVEL, local_name_to_top_level_entity(), MAPL, module_name(), NIL, pips_assert, safe_fclose(), safe_fopen(), strdup(), and topologically_sorted_module_list().
void topological_number_assign_to_module | ( | hash_table | hash_module_to_depth, |
entity | mod, | ||
size_t | n | ||
) |
assigns depth n+1 to callees of current module
hash_module_to_depth | ash_module_to_depth |
mod | od |
Definition at line 102 of file toposort.c.
References CAR, depth, ENTITY, hash_get(), hash_put(), ICFG_NOT_FOUND, MAPL, module_to_callees(), NIL, and topological_number_assign_to_module().
Referenced by topological_number_assign_to_module(), and topologically_sorted_module_list().
"depth" of subroutine or function for topological sort
mod | od |
Definition at line 173 of file toposort.c.
References hash_dont_warn_on_redefinition(), hash_pointer, hash_table_free(), hash_table_make(), module_list_sort(), NIL, pips_assert, and topological_number_assign_to_module().
Referenced by print_module_name_to_toposorts().