PIPS
|
Go to the source code of this file.
Macros | |
#define | STATEMENT_FUNCTION_MAP(k, v, code, _map_hash_h) |
this piece of code makes low level assumptions about newgen internals. More... | |
Functions | |
static int | lire_int (FILE *fd) |
reads an int while sharing file and buffers with newgen... More... | |
char * | pipsdbm_read_entities (FILE *fd) |
externals.c More... | |
void | pipsdbm_free_entities (char *p) |
static int | statement_mapping_count (statement_mapping h) |
The old statement_mapping is an hash_table managed directly. More... | |
void | pipsdbm_write_statement_mapping (FILE *fd, statement_mapping h) |
Write a statement mapping. More... | |
hash_table | pipsdbm_read_statement_mapping (FILE *fd) |
Read a statement mapping. More... | |
bool | pipsdbm_check_statement_mapping (statement_mapping h) |
a little bit partial, because domain are not checked. More... | |
void | pipsdbm_free_statement_mapping (statement_mapping h) |
static int | number_of_ordered_statements (hash_table h) |
count the number of statements with a valid ordering. More... | |
bool | pipsdbm_consistent_statement_function (gen_chunkp map) |
void | pipsdbm_write_statement_function (FILE *fd, gen_chunkp map) |
the stored stuff need be based on the ordering... More... | |
gen_chunkp | pipsdbm_read_statement_function (FILE *fd) |
Should use a higher level pipsdbm_read_statement_mapping() to survive to XML. More... | |
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. More... | |
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) More... | |
hash_table | declarations_read (FILE *f) |
#define STATEMENT_FUNCTION_MAP | ( | k, | |
v, | |||
code, | |||
_map_hash_h | |||
) |
this piece of code makes low level assumptions about newgen internals.
see also the comments about statement mappings above.
Definition at line 202 of file externals.c.
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.
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.
|
static |
reads an int while sharing file and buffers with newgen...
trim
Definition at line 40 of file externals.c.
References genread_in, genread_input(), and pips_internal_error.
Referenced by pipsdbm_read_statement_function(), and pipsdbm_read_statement_mapping().
|
static |
count the number of statements with a valid ordering.
Definition at line 213 of file externals.c.
References pips_assert, STATEMENT_FUNCTION_MAP, statement_ordering, STATEMENT_ORDERING_UNDEFINED, and x.
Referenced by pipsdbm_write_statement_function().
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 | file to read from |
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.
|
static |
The old statement_mapping is an hash_table managed directly.
this table associates statement to any newgen type. Now explicit newgen functions ("->") should be prefered. the storing of the mapping is based on the statement ordering for later reconstruction with the CODE. tabulating statements would help, but is that desirable?
MY opinion is that all newgen objects should have a unique id associated to it, as an addditional hidden field, to support persistence more easily. Well, there would be some problemes, too.
FC.
Definition at line 94 of file externals.c.
References STATEMENT_MAPPING_MAP, statement_ordering, and STATEMENT_ORDERING_UNDEFINED.
Referenced by pipsdbm_write_statement_mapping().