25 #include "pips_config.h"
63 static hash_table hash_table_to_callees_string;
64 static bool hash_table_is_created =
false;
69 if ( !hash_table_is_created ) {
71 hash_table_is_created =
true;
79 (
char *)callees_list);
111 hash_put(hash_module_to_depth, (
char *) mod, (
char *) n);
113 if ( callees_list !=
NIL ) {
130 static list same_depth_list =
NIL;
134 if ( same_depth_list ==
NIL )
146 same_depth_list =
NIL;
149 if ( callees_list !=
NIL ) {
152 if (
depth == n+1 ) {
153 same_depth_list =
gen_nconc(same_depth_list,
156 (
char *) e, (
char *) -1);
162 current_list =
gen_nconc(current_list, same_depth_list);
170 return (current_list);
192 return (sorted_list);
206 fprintf(stderr,
"topological-sorting callees for %s ...\n",
222 fprintf(stderr,
"result written to %s\n", filename);
const char * module_name(const char *s)
Return the module part of an entity name.
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
void hash_dont_warn_on_redefinition(void)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
struct __hash_table * hash_table
Define hash_table structure which is hidden.
string db_get_current_workspace_directory(void)
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
code entity_code(entity e)
bool entity_module_p(entity e)
#define type_functional_p(x)
struct _newgen_struct_callees_ * callees
#define callees_callees(x)
#define code_declarations(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
static int depth
la sequence de nids
void print_module_name_to_toposorts(char *module_name) const
list topologically_sorted_module_list(entity mod)
list module_list_sort(hash_table hash_module_to_depth, list current_list, entity mod, size_t n)
list module_name_to_callees(char *module_name) const
toposort.c
list module_to_callees(entity mod)
void topological_number_assign_to_module(hash_table hash_module_to_depth, entity mod, size_t n)