25 #include "pips_config.h"
57 #include "resources.h"
91 pips_debug(2,
"\nSPAGHETTIFY: Module statement: =====================================\n");
122 if (new_stat != NULL) {
166 return returned_statement;
183 debug_on(
"SPAGUETTIFY_DEBUG_LEVEL");
188 pips_assert(
"Statement is consistent after SPAGUETTIFY",
bool statement_consistent_p(statement p)
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
struct _newgen_struct_statement_ * statement
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
statement spaghettify_forloop(statement stat, const char *module_name)
This function takes the statement stat as parameter and return a new spaghettized statement,...
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
entity set_current_module_entity(entity)
static.c
void gen_list_patch(list l, const void *x, const void *y)
Replace all the reference to x in list l by a reference to y:
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
bool statement_with_empty_comment_p(statement)
Return true if the statement has an empty statement:
statement spaghettify_loop(statement stat, const char *module_name)
This function takes the statement stat as parameter and return a new spaghettized statement,...
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
statement spaghettify_test(statement, const char *)
test_spaghettify.c
string statement_type_as_string(statement)
phrase_tools.c
statement spaghettify_whileloop(statement, const char *)
whileloop_spaghettify.c
void print_statement(statement)
Print a statement on stderr.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
#define statement_ordering(x)
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_sequence
#define instruction_tag(x)
#define statement_domain_number(x)
#define sequence_statements(x)
#define instruction_sequence(x)
#define statement_instruction(x)
#define statement_comments(x)
#define statement_number(x)
#define STATEMENT(x)
STATEMENT.
bool spaghettify(const char *module_name)
statement spaghettify_statement(statement stat, const char *module_name)
The spaghettifier is used in context of PHRASE project while creating "Finite State Machine"-like cod...