25 #include "pips_config.h"
47 #include "resources.h"
82 return strdup(
"WHILELOOP");
94 return strdup(
"UNSTRUCTURED");
102 return strdup(
"UNDEFINED");
150 string line =
"***********************************************************************\n";
155 string next_nodes_as_string =
"";
156 string previous_nodes_as_string =
"";
192 asprintf (&title,
"CONTROL: %d\n", ordering);
200 "NEXT: ", next_nodes_as_string,
"\n",
201 "PREVIOUS: ", previous_nodes_as_string,
"\n",
219 string entry_as_string, exit_as_string, temp;
221 entry_as_string =
strdup(temp);
223 exit_as_string =
strdup(temp);
226 "ENTRY: ", entry_as_string,
"\n",
227 "PREVIOUS: ", exit_as_string,
"\n",
231 string next_nodes_as_string =
"";
232 string previous_nodes_as_string =
"";
251 asprintf (&title,
"CONTROL: %p\n", current_control);
254 "NEXT: ", next_nodes_as_string,
"\n",
255 "PREVIOUS: ", previous_nodes_as_string,
"\n",
270 const char* new_name,
326 const char* base_name,
331 entity returned_variable = NULL;
335 while (returned_variable == NULL) {
344 return returned_variable;
409 int ordering_up = (an_ordering & 0xffff0000) >> 16;
410 int ordering_down = (an_ordering & 0x0000ffff);
411 return ordering_up + ((ordering_down-1) << 16);
419 string searched_string;
423 string new_comments = NULL;
425 searched_string =
strdup(comment_portion);
426 searched_string[strcspn(comment_portion,
"%s")] =
'\0';
428 next_line = strtok (comments,
"\n");
429 if (next_line != NULL) {
431 if (strstr(next_line,searched_string) == NULL) {
432 if (new_comments != NULL) {
439 next_line = strtok(NULL,
"\n");
441 while (next_line != NULL);
444 if (new_comments != NULL) {
471 if (strstr(comments,
context->searched_string) != NULL) {
488 context.searched_string[strcspn(comment_portion,
"%s")] =
'\0';
503 return context.list_of_statements;
511 searched_stat) != NULL);
529 if (s2 ==
context->searched_statement) {
530 context->found_sequence_statement = s;
541 context.searched_statement = searched_stat;
542 context.found_sequence_statement = NULL;
547 return context.found_sequence_statement;
563 pips_debug(5,
"BEGIN replace_in_sequence_statement_with:\n");
565 pips_assert(
"Statement is contained in a sequence",
566 sequence_statement != NULL);
591 pips_debug(7,
"I've got this for the sequence\n");
593 pips_debug(7,
"I've got this for the root statement\n");
597 pips_debug(5,
"END replace_in_sequence_statement_with:\n");
call make_call(entity a1, list a2)
type copy_type(type p)
TYPE.
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
value copy_value(value p)
VALUE.
storage copy_storage(storage p)
STORAGE.
instruction make_instruction(enum instruction_utype tag, void *val)
synchronization make_synchronization_none(void)
static reference ref
Current stmt (an integer)
static list predecessors(statement st, graph tg)
static list successors(list l)
static entity new_variable
entity to be replaced, the primary?
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
const char * module_name(const char *s)
Return the module part of an entity name.
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
#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_with_empty_comment_p(statement)
Return true if the statement has an empty 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
#define MODULE_SEP_STRING
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
string concatenate(const char *,...)
Return the concatenation of the given strings.
void * gen_find_tabulated(const char *, int)
void print_reference(reference r)
void print_statement(statement)
Print a statement on stderr.
#define make_entity(n, t, s, i)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define empty_comments
Empty comments (i.e.
#define ASSIGN_OPERATOR_NAME
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 module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_empty_label(void)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
extensions empty_extensions(void)
extension.c
void AddEntityToDeclarations(entity, entity)
END_EOLE.
#define REFERENCE(x)
REFERENCE.
#define reference_variable(x)
#define control_predecessors(x)
#define statement_ordering(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define CONTROL(x)
CONTROL.
#define EXPRESSION(x)
EXPRESSION.
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_sequence
#define instruction_tag(x)
#define statement_domain_number(x)
#define sequence_statements(x)
#define statement_extensions(x)
#define instruction_sequence(x)
#define control_successors(x)
#define unstructured_exit(x)
#define unstructured_entry(x)
#define statement_instruction(x)
#define statement_comments(x)
#define control_statement(x)
#define statement_number(x)
#define entity_domain
newgen_syntax_domain_defined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
char * variable_name(Variable v)
polynome_ri.c
static int line
FLEX_SCANNER.
The structure used to build lists in NewGen.
statement searched_statement
statement found_sequence_statement