25 #include "pips_config.h"
56 bool consistency_p =
true;
64 if(exit_node==entry_node) {
65 consistency_p =
false;
66 if(assert_p)
pips_assert(
"Entry and exit nodes are different",
false);
75 consistency_p =
false;
76 if(assert_p)
pips_assert(
"Entry node has at least one predecessor",
false);
83 consistency_p =
false;
84 if(assert_p)
pips_assert(
"Exit node has no successor",
false);
95 consistency_p =
false;
96 if(assert_p)
pips_assert(
"Exit node is not a test",
false);
105 consistency_p =
false;
106 if(assert_p)
pips_assert(
"Exit node has predecessors but is unreachable",
false);
119 consistency_p =
false;
120 if(assert_p)
pips_assert(
"Unreachable exit node is a CONTINUE statement",
false);
133 consistency_p =
false;
134 if(assert_p)
pips_assert(
"Unique predecessor of exit node is a test",
false);
155 consistency_p =
false;
158 "\nEntry node: %p\nExit node: %p\n"
159 "c1 node: %p\nc2 node: %p\nc3 node: %p\n",
160 entry_node, exit_node, c1, c2, c3);
162 pips_assert(
"c3, the unique predecessor of the unique successor of c1, is c1",
167 consistency_p =
false;
170 "\nEntry node: %p\nExit node: %p\nc1 node: %p\nc2 node: %p\n\n",
171 entry_node, exit_node, c1, c2);
174 "c2 has c1 as unique predecessor. c2 must be the entry node",
185 return consistency_p;
195 bool while_p =
false;
198 debug(5,
"unstructured_while_p",
"Begin with graph\n");
200 "\nEntry node: %p\nExit node: %p\n\n",
201 entry_node, exit_node);
bool unstructured_consistency_p(unstructured u, bool assert_p)
Basic functions about control flow graphs (CFG), aka unstructured data structure.
bool unstructured_while_p(unstructured u)
Test if an unstructured is found to be like a structured while-loop.
void display_linked_control_nodes(control c)
Display all the control nodes reached or reachable from c for debugging purpose.
void forward_control_map_get_blocs(c, l)
Build recursively the list of all controls forward-reachable from a control of an unstructured.
#define ENDP(l)
Test if a list is empty.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
void * gen_find_eq(const void *item, const list seq)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
bool statement_test_p(statement)
bool continue_statement_p(statement)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
string bool_to_string(bool)
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define control_predecessors(x)
#define CONTROL(x)
CONTROL.
#define control_successors(x)
#define unstructured_exit(x)
#define control_statement(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.