25 #include "pips_config.h"
73 return *statement_is_empty =
false;;
91 bool statement_is_empty =
true;
94 pips_debug(3,
"returning %d\n", statement_is_empty);
96 return statement_is_empty;
225 bool declaration_p =
false;
241 return declaration_p;
248 bool continue_p =
true;
294 fprintf(stderr,
"cannot compare %td (%d,%d) and %td (%d,%d)\n",
530 bool check_io =
false;
938 if(strlen(errmess)>0) {
1101 bool declaration_p =
true;
1105 declaration_p =
false;
1110 return declaration_p;
1275 string function_name;
1572 user_error(
"clear_label",
"Cannot clear label for FORMAT %s!\n",
1596 if ((notrue) && (nofalse))
1729 return "undefined statement\n";
1732 return "statement with undefined intruction\n";
1744 string old = *all_comments;
1762 string comments = NULL;
1783 return &an_empty_comment;
1815 return &an_empty_comment;
1832 string the_comments)
1864 string the_comments)
1890 string the_comments)
1917 const char* the_comments) {
1937 #define ERROR_PREFIX "!ERROR: "
1938 #define BUFSIZE 1024
1944 va_list some_arguments;
1946 va_start(some_arguments, format);
1951 va_end(some_arguments);
2033 const char* label_name =
2129 debug(8,
"statement_to_label",
"stmt %s, pointed by = %s\n",
2168 *labeled_statement = s;
2175 *labeled_statement = c;
2197 bool returns =
true;
2247 debug(8,
"statement_does_return",
"stmt %s, does return= %d\n",
2256 bool returns =
false;
2262 returns = returns || (c==
exit);
2346 *format_inside_statement_has_been_found =
true;
2362 bool format_inside_statement_has_been_found =
false;
2367 return format_inside_statement_has_been_found;
2386 while((c=*cmt++)!=
'\0')
2572 pips_assert(
"Neither s nor s1 are declaration statements",
2595 #define PIPS_DECLARATION_COMMENT "PIPS generated variable\n"
2603 #define MAX_COMMENTERS 8
2618 pips_assert(
"not exceeding stack commenters stack limited size\n",
2667 bool basic_p =
false;
2680 add_p = comment_p && basic_p && qualifiers_p && storage_p;
2728 for(cl=sl; !
ENDP(cl);
POP(cl)) {
2757 pips_assert(
"The above loop was entered at most once", sl==cl);
2854 for(cl=sl; !
ENDP(cl) && !find;
POP(cl)) {
2870 pips_internal_error(
"statement s:%p (%d) must be in block block_statement:%p (%d) (not recursively but directly)\n",
2892 pips_assert(
"The above loop was entered at most once", sl==cl);
2973 for(cl=sl; !
ENDP(cl);
POP(cl)) {
3189 if(!(* p_undefined_p)) {
3199 pips_debug(9,
"checking statement %03td (%td,%td) with address %p:\n",
3206 return !(* p_undefined_p);
3215 bool undefined_p =
false;
3219 return !undefined_p;
3271 if(
ENDP(head)) head=tail=s2d;
3923 bool go_on_p =
true;
3949 bool go_on_p =
true;
3953 * control_effect_p =
true;
3963 * control_effect_p =
true;
3980 bool control_effect_p =
false;
3986 if(!control_effect_p) {
3994 if(!control_effect_p)
3998 return control_effect_p;
4005 bool go_on_p =
true;
4015 * control_effect_p =
true;
4024 bool control_effect_p =
false;
4026 if(!control_effect_p)
4029 return control_effect_p;
4119 ctx->found_p = true;
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
instruction make_instruction_loop(loop _field_)
evaluation make_evaluation_before(void)
call make_call(entity a1, list a2)
instruction make_instruction_forloop(forloop _field_)
whileloop make_whileloop(expression a1, statement a2, entity a3, evaluation a4)
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
instruction make_instruction_expression(expression _field_)
void free_extensions(extensions p)
void extend_persistant_statement_to_int(persistant_statement_to_int f, statement k, intptr_t v)
bool statement_consistent_p(statement p)
test make_test(expression a1, statement a2, statement a3)
bool range_consistent_p(range p)
bool forloop_consistent_p(forloop p)
extensions make_extensions(list a)
execution make_execution_sequential(void)
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
instruction make_instruction_sequence(sequence _field_)
instruction make_instruction_test(test _field_)
instruction make_instruction_call(call _field_)
void free_instruction(instruction p)
instruction make_instruction(enum instruction_utype tag, void *val)
reference copy_reference(reference p)
REFERENCE.
list gen_statement_cons(statement p, list l)
synchronization make_synchronization_none(void)
sequence make_sequence(list a)
persistant_statement_to_int make_persistant_statement_to_int(void)
extensions copy_extensions(extensions p)
EXTENSIONS.
instruction make_instruction_whileloop(whileloop _field_)
void free_statement(statement p)
forloop make_forloop(expression a1, expression a2, expression a3, statement a4)
evaluation make_evaluation_after(void)
bool test_consistent_p(test p)
range make_range(expression a1, expression a2, expression a3)
#define error(fun, msg)
NewGen interface with C3 type Psysteme for PIPS project.
struct _newgen_struct_entity_ * entity
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
static list blocks
lisp of loops
expression MakeCharacterConstantExpression(string s)
END_EOLE.
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
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....
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
statement make_statement_from_statement_list_or_empty_block(list l)
Build a statement sequence from a statement list.
statement make_block_statement(list body)
Make a block statement from a list of statement.
statement make_statement_from_statement_list(list l)
Build a statement sequence from a statement list.
statement instruction_to_statement(instruction instr)
Build a statement from a give instruction.
statement make_statement_from_statement_varargs_list(statement s,...)
Build a statement sequence from a statement NULL-terminated varargs list.
void copy_statement_attributes(statement from, statement to)
Copy all the attributes from one statement to another one.
statement make_empty_statement_with_declarations_and_comments(list d, string dt, string c)
Build an empty statement with declaration list, declaration text and comment.
statement make_empty_block_statement()
Build an empty statement (block/sequence)
void move_statement_attributes(statement from, statement to)
Move all the attributes from one statement to another one.
statement make_block_with_stmt_if_not_already(statement stmt)
Build a statement block from a statement if not already a statement block.
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
#define FORWARD_CONTROL_MAP(ctl, code, c, list)
Walk through all the controls forward-reachable from a given control node of an unstructured.
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_false2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
instruction make_assign_instruction(expression l, expression r)
bool instruction_assign_p(instruction i)
Test if an instruction is an assignment.
bool instruction_stop_p(instruction i)
Test if an instruction is a Fortran STOP.
bool assignment_block_p(instruction i)
Checks if an instruction block is a list of assignments, possibly followed by a continue.
bool exit_instruction_p(instruction i)
bool abort_instruction_p(instruction i)
bool instruction_format_p(instruction i)
Test if an instruction is a Fortran FORMAT.
bool native_instruction_p(instruction i, string op_name)
Test if an instruction is a native instruction of the language.
bool instruction_continue_p(instruction i)
Test if an instruction is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
bool return_instruction_p(instruction i)
Test if an instruction is a C or Fortran "return".
bool C_return_instruction_p(instruction i)
bool fortran_return_instruction_p(instruction i)
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
bool gen_once_p(list l)
FC: ARGH...O(n^2)!
#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.
void gen_free_list(list l)
free the spine of the list
list gen_last(list l)
Return the last element of a list.
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
void gen_substitute_chunk_by_list(list *pl, const void *o, list sl)
substitute item o by list sl in list *pl, which is modified as a side effect.
expression statement_expression(statement s)
Get the expression of a statement.
sequence statement_sequence(statement s)
Get the sequence of a statement sequence.
multitest statement_multitest(statement s)
Get the multitest of a statement.
statement effective_test_true(test t)
returns the effective true branch of a test by skipping a possible sequence of one element.
list statement_block(statement s)
Get the list of block statements of a statement sequence.
loop statement_loop(statement s)
Get the loop of a statement.
test statement_test(statement s)
Get the test of a statement.
call statement_call(statement s)
Get the call of a statement.
whileloop statement_whileloop(statement s)
Get the whileloop of a statement.
statement statement_goto(statement s)
Get the goto of a statement.
forloop statement_forloop(statement s)
Get the forloop of a statement.
unstructured statement_unstructured(statement s)
Get the unstructured of a statement.
bool empty_statement_or_labelless_continue_p(statement st)
Return true if the statement is an empty instruction block without label or a continue without label ...
bool statement_expression_p(statement s)
bool unlabelled_statement_p(statement st)
bool statement_goto_p(statement s)
bool statement_multitest_p(statement s)
bool statement_whileloop_p(statement s)
bool statement_test_p(statement s)
bool statement_call_p(statement s)
bool statement_forloop_p(statement s)
bool nop_statement_p(statement s)
bool empty_statement_or_continue_p(statement st)
Return true if the statement is an empty instruction block or a continue or a recursive combination o...
bool check_io_statement_p(statement s)
bool empty_statement_p(statement st)
Test if a statement is empty.
bool statement_loop_p(statement s)
bool empty_statement_or_continue_without_comment_p(statement st)
Return true if the statement is an empty instruction block or a continue without comments or without ...
bool statement_sequence_p(statement s)
Statement classes induced from instruction type.
bool statement_unstructured_p(statement s)
static bool look_for_exiting_intrinsic_calls(call c, bool *control_effect_p)
static bool declarations_count_element_references_to_v_p(statement st)
static bool count_loop_in(loop __attribute__((unused)) l)
static bool add_stat_called_in_inits(statement s, entities_t *funcs)
static bool declarations_count_references_to_v_p(statement st)
list gather_and_remove_all_format_statements(statement s)
Used to keep aside the FORMAT before many code transformation that could remove them either.
static char ** find_first_comment(statement s)
Find the first comment of a statement, if any.
statement apply_number_to_statement(hash_table nts, _int n)
static bool find_statements_with_pragma_walker(statement s, struct fswp *p)
bool format_statement_p(statement s)
Test if a statement is a Fortran FORMAT.
hash_table allocate_number_to_statement()
statement make_any_print_statement(string message)
Generate a print of a constant character string on stderr for C or on stdout for Fortran.
list statement_to_implicit_target_labels(statement s)
Look for labels appearing in END= or ERR= IO clauses and allocate a label list.
static bool find_statements_with_label_walker(statement s, struct fswl *p)
helper to find statement with a particular label as label should be unique, the function stops once a...
static bool cannot_be_empty(bool *statement_is_empty)
statement make_assign_statement(expression l, expression r)
statement add_initialization_information_to_declaration_statement(statement s, list iel)
The initialization expression list is integrated into the internal representation as an argument list...
int count_references_to_variable(statement s, entity v)
static bool first_reference_to_v_p(reference r)
static bool look_for_user_call(call c, bool *user_call_p)
static bool look_for_control_effects(call c, bool *control_effect_p)
entity statement_to_label(statement s)
See if statement s is labelled and can be reached by a GO TO.
bool comments_equal_p(string c1, string c2)
statement add_declaration_statement_at_beginning(statement s, entity e)
#define ERROR_PREFIX
as name indicate, a comment is added.
void append_statement_to_block_statement(statement b, statement s)
list statement_to_referenced_entities(statement s)
Get a list of all variables referenced recursively within a statement:
void insert_comments_to_statement(statement s, const char *the_comments)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
bool statement_contains_user_call_p(statement s)
statement update_statement_instruction(statement s, instruction i)
Replace the instruction in statement s by instruction i.
void put_a_comment_on_a_statement(statement s, string the_comments)
Similar to try_to_put_a_comment_on_a_statement() but insert a CONTINUE to put the comment on it if th...
int count_references_to_variable_element(statement s, entity v)
char ** find_first_statement_comment(statement s)
Find the first non-empty comment of a statement, if any returns a pointer to the comment if found,...
int count_static_references_to_variable(statement s, entity v)
statement make_print_statement(string message)
Make a Fortran print statement.
statement make_whileloop_statement(expression condition, statement body, int line_number, bool before)
Build a while loop statement.
static bool replace_statement_walker(statement s, struct replace_statement_context *ctx)
void put_formats_at_module_beginning(statement s)
Transfer all the FORMATs at the very beginning of a module:
statement makeloopbody(loop l, statement s_old, bool inner_p)
statement makeloopbody(l, s_old) make a statement for a loop body, using the fields of a previously e...
static void count_loop_out(loop __attribute__((unused)) l)
bool statement_substatement_walker(statement some, statement s)
void fix_block_statement_declarations(statement s)
s is assumed to be a block statement and its declarations field is assumed to be correct,...
statement make_loop_statement(entity i, expression low, expression up, expression inc, statement b)
Build a loop statement.
static string default_generated_variable_commenter(__attribute__((unused)) entity e)
bool all_statements_defined_p(statement s)
static bool add_statement_declarations(statement s, add_statement_declarations_t *ctxt)
Add the declarations of a statement to a list if not already here.
bool unstructured_does_return(unstructured u)
void append_comments_to_statement(statement s, string the_comments)
Append a comment string (if non empty) to the comments of a statement, if the c.
bool try_to_put_a_comment_on_a_statement(statement s, string the_comments)
Put a comment on a statement in a safe way.
statement make_expression_statement(expression e)
Build a statement from a given expression.
#define PIPS_DECLARATION_COMMENT
string statement_identification(statement s)
Like external_statement_identification(), but with internal information, the hexadecimal address of t...
statement make_stop_statement(string message)
This function returns a Fortran stop statement with an error message.
static bool add_loop_index_entity(loop l, entities_t *vars)
statement remove_declaration_statement(statement s, entity e)
Declarations are not only lists of entities, but also statement to carry the line number,...
static int current_line
Poor attempt at associating physical line numbers to statement.
list statements_to_declarations(list sl)
Returns the declarations contained in a list of statement.
bool declaration_statements_p(list sl)
Check that all statements contained in statement list sl are declaration statements.
static bool declarations_first_reference_to_v_p(statement st)
bool return_statement_p(statement s)
Test if a statement is a C or Fortran "return".
bool statement_may_have_control_effects_p(statement s)
void put_formats_at_module_end(statement s)
Transfer all the FORMATs at the very end of a module:
bool exit_statement_p(statement s)
list statement_to_called_user_entities(statement s)
Get a list of all user function called recursively within a statement:
int statement_to_comment_length(statement stmt)
Number of comment line directly attached to a statement.
string decls_text_dup(string dt)
Duplicate statement decls_text.
list statement_to_declarations(void *s)
Get a list of all variables declared recursively within a statement.
static void up_counter(statement s)
string generated_variable_comment(entity e)
string(* generated_variable_commenter)(entity)
commenters are function used to add comments to pips-created variables they are handled as a limited ...
list statement_to_labels(statement s)
Look for non-empty labels appearing directly or indirectly and allocate a label list.
list find_statements_with_pragma(statement s, const char *begin)
Get a list of statements with pragma begining with a prefix.
statement make_declaration_statement(entity v, int sn, string cs)
Make one declaration statement.
statement make_call_statement(string function_name, list args, entity l, string c)
This function is limited to intrinsics calls...
list instruction_to_declarations(instruction i)
Get a list of all variables declared recursively within an instruction.
static bool gather_all_comments_of_a_statement_filter(statement s, string *all_comments)
bool statement_with_pragma_p(statement s)
Test if a statement has some pragma.
bool write_statement_p(statement s)
static void update_number_to_statement(statement s)
bool figure_out_if_it_is_a_format(instruction i, bool *format_inside_statement_has_been_found)
void pop_generated_variable_commenter()
reference find_reference_to_variable(statement s, entity v)
bool stop_statement_p(statement s)
Test if a statement is a Fortran STOP.
void add_one_line_of_comment(statement s, string format,...)
string external_statement_identification(statement s)
Does work neither with undefined statements nor with defined statements with undefined instructions.
static bool add_stat_called_user_entities(call c, entities_t *funcs)
statement add_comment_and_line_number(statement s, string sc, int sn)
Since block cannot carry comments nor line numbers, they must be moved to an internal continue statem...
static reference first_reference_to_v
Return first reference found.
static statement generic_add_declaration_statement(statement s, entity e, bool before_p)
Add a new declaration statement.
bool fortran_return_statement_p(statement s)
Test if a statement is a Fortran "return".
list statement_to_direct_declarations(statement s)
Returns the declarations contained directly in a statement s.
statement make_C_print_statement(string message)
static list unstructured_to_direct_declarations(unstructured u)
bool continue_statement_p(statement s)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
static bool call_filter(call c, bool *statement_is_empty)
statement find_statement_from_label(statement s, entity label)
find a statement in s with entity label
statement make_declarations_statement(list idl, int sn, string cs)
Make a declaration(s) statement.
static generated_variable_commenter generated_variable_commenters[MAX_COMMENTERS]
void insert_statement(statement s, statement s1, bool before)
This is the normal entry point.
bool empty_code_list_p(list l)
persistant_statement_to_int statement_to_line_number(statement s)
string safe_statement_identification(statement s)
statement make_return_statement(entity module)
static bool add_declaration_to_declaration_statement_p(statement s, string c, entity nv)
Check if declaration of variable nv can be added to the declaration list of statement s.
bool empty_code_p(statement s)
statement.c
hash_table build_number_to_statement(hash_table nts, statement s)
bool assignment_statement_p(statement s)
Test if a statement is an assignment.
static size_t nb_commenters
static bool is_substatement
void insert_statement_no_matter_what(statement s, statement s1, bool before)
Break the IR consistency or, at the very least, do not insert new declarations at the usual place,...
list statement_pragmas(statement s)
get the list of pragma of a statement s
instruction make_simple_Fortran_io_instruction(bool is_read_p, expression f, list io_list)
Derived from the Fortran parser code.
statement add_declaration_statement_here(statement block_statement, statement s, entity e, bool before_p)
Add a new declaration statement (inspired by generic_add_declaration_statement)
static bool undefined_statement_found_p(statement s, bool *p_undefined_p)
static bool add_stat_referenced_entities(reference r, entities_t *vars)
statement make_exit_statement(int n, string errmess)
This function returns a statement ending with a C exit statement.
static int loop_depth
Estimate count of dynamic references.
static persistant_statement_to_int stmt_to_line
static set duplicate_numbers
To keep track of duplicate numbers.
static void generic_insert_statement(statement s, statement s1, bool before)
insert statement s1 before or after statement s
string comments_dup(string comment)
functions to generate statements
bool statement_possible_less_p(statement st1, statement st2)
static bool count_static_references_to_v_p(reference r)
Count static references.
bool statement_less_p(statement st1, statement st2)
static bool count_references_to_v_p(reference r)
statement make_continue_statement(entity l)
static bool statement_in_statement_walker(statement st, struct sb *sb)
bool forloop_statement_p(statement s)
static list internal_statement_to_direct_declarations(statement st)
No recursive descent.
string gather_all_comments_of_a_statement(statement s)
Gather all the comments recursively found in the given statement and return them in a strduped string...
extension get_extension_from_statement_with_pragma(statement s, const char *seed)
Get the extension of a statement with pragma beginning with a prefix.
bool C_return_statement_p(statement s)
Test if a statement is a C "return".
void fix_statement_attributes_if_sequence(statement s)
Apply fix_sequence_statement_attributes() on the statement only if it really a sequence.
list statements_to_direct_declarations(list sl)
Returns the declarations contained directly in the declaration statements of a list of statements.
list declaration_statement_to_initializations(statement s)
static hash_table number_to_statement
Mapping from statement number to statement.
bool statement_replace_in_root_statement(statement old_stat, statement new_stat, statement root_stat)
replace old_stat by new_stat in root_stat this pass does not free old_stat similar to replace_in_sequ...
int get_statement_depth(statement s, statement root)
computes the block-depth of a statement NOT INTENDED to generate entity name declared at particular b...
statement add_declaration_statement(statement s, entity e)
bool assignment_block_or_statement_p(statement s)
bool statement_in_statement_p(statement s, statement st)
statement clear_labels(statement s)
Get rid of all labels in controlized code before duplication.
bool empty_comments_p(const char *s)
bool statement_with_empty_comment_p(statement s)
Return true if the statement has an empty statement:
static bool find_implicit_goto(statement s, list *tl)
void clear_label(statement s)
statement normalize_statement(statement s)
Make (a bit more) sure that s is gen_defined_p in spite of poor decision for empty fields and that st...
statement find_statement_from_label_name(statement s, const char *module_name, const char *label_name)
statement make_test_statement(expression cond, statement truebody, statement falsebody)
static bool down_counter(statement s)
bool abort_statement_p(statement s)
void gather_and_remove_all_format_statements_rewrite(statement s, list *all_formats)
statement make_plain_continue_statement()
Make a simple continue statement to be used as a NOP or ";" in C.
static bool collect_labels(statement s, list *pll)
bool statement_may_contain_exiting_intrinsic_call_p(statement s)
static bool count_element_references_to_v_p(reference r)
This function checks reference to proper elements, not slices.
void push_generated_variable_commenter(string(*commenter)(entity))
statement add_label_to_statement(entity label, statement s, statement *labeled_statement)
Add a label to a statement.
statement st_make_nice_test(expression condition, list ltrue, list lfalse)
bool continue_statements_p(list sl)
Check that all statements contained in statement list sl are a continue statements.
bool format_inside_statement_p(statement s)
static bool add_ref_entities_in_init(statement s, entities_t *vars)
static int reference_count
statement make_forloop_statement(expression init, expression cond, expression inc, statement body)
void statement_replace_with_statement_list(statement as, statement rs, list sl)
Assume that statement rs appears in statement as and replaced it by a statement list.
bool statement_substatement_p(statement s, statement root)
search a statement inside a statement
bool statement_does_return(statement s)
Returns false is no syntactic control path exits s (i.e.
void fix_sequence_statement_attributes(statement s)
Since blocks are not represented in Fortran, they cannot carry a label.
bool statement_in_statements_p(statement s, list l)
static entity variable_searched
bool declaration_statement_p(statement s)
Had to be optimized according to Beatrice Creusillet.
statement searched_statement
void statement_remove_extensions(statement s)
That's all folks.
bool belong_to_statement(statement stmt, statement s, bool found_p)
return true if s is enclosed in stmt NL: What is the difference with statement_in_statement_p?
entity find_final_statement_label(statement s)
Find the label associated with the last statement executed within s.
entity key
used for the condition
string comment_sentinel(tag t)
Start a single line comment.
void statement_remove_useless_label(statement s, bool *changed)
remove the label of a statement if the statement is not unstructured.
statement st
statement matching condition
list statement_to_all_included_declarations
static string commenter(__attribute__((unused)) entity e)
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_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
string instruction_identification(instruction i)
Return a constant string representing symbolically the instruction type.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define user_error(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define RETURN_LABEL_NAME
#define LIST_DIRECTED_FORMAT_NAME
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
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,...
#define hash_table_undefined
Value of an undefined hash_table.
#define same_string_p(s1, s2)
#define SET_MAP(element, code, the_set)
bool set_belong_p(const set, const void *)
#define set_undefined_p(s)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
#define string_undefined_p(s)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
#define ENTITY_WRITE_P(e)
Fortran IO Management.
#define instruction_block_p(i)
#define READ_FUNCTION_NAME
#define ENTITY_ASSERT_SYSTEM_P(e)
include <assert.h>
#define ORDERING_NUMBER(o)
#define ORDERING_STATEMENT(o)
#define ENTITY_CLOSE_P(e)
#define statement_block_p(stat)
#define ENTITY_CONTINUE_P(e)
#define RETURN_FUNCTION_NAME
#define ENTITY_EXIT_SYSTEM_P(e)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define FPRINTF_FUNCTION_NAME
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define C_RETURN_FUNCTION_NAME
#define is_instruction_block
soft block->sequence transition
#define CONTINUE_FUNCTION_NAME
#define ENTITY_ABORT_SYSTEM_P(e)
#define WRITE_FUNCTION_NAME
#define ENTITY_C_RETURN_P(e)
#define STOP_FUNCTION_NAME
#define EXIT_FUNCTION_NAME
#define instruction_block(i)
#define make_statement_list(stats...)
easy list constructor
#define empty_comments
Empty comments (i.e.
#define ENTITY_RETURN_P(e)
#define NOT_OPERATOR_NAME
#define ENTITY_ASSERT_FAIL_SYSTEM_P(e)
bool entity_continue_p(entity f)
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local 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...
bool entity_return_label_p(entity e)
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool c_module_p(entity m)
Test if a module "m" is written in C.
bool entity_label_p(entity e)
entity entity_empty_label(void)
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
bool entity_field_p(entity e)
e is the field of a structure
static int init
Maximal value set for Fortran 77.
const char * module_local_name(entity e)
Returns the module local user name.
list entity_qualifiers(entity e)
return the qualifiers associated to entity e if it's a variable NIL otherwise
bool entity_empty_label_p(entity e)
bool io_entity_p(entity e)
Several implicit entities are declared to define the implicit effects of IO statements.
bool fortran_module_p(entity m)
Test if a module is in Fortran.
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
entity make_label(const char *module_name, const char *local_name)
const char * label_local_name(entity e)
END_EOLE.
bool expression_call_p(expression e)
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool user_call_p(call c)
Test if a call is a user call.
expression MakeNullaryCall(entity f)
Creates a call expression to a function with zero arguments.
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
bool empty_extensions_p(extensions es)
extensions empty_extensions(void)
extension.c
entity make_stderr_variable(void)
If the parser has not (yet) encountered "stderr", a PIPS transformation or instrumentation phase may ...
bool qualifiers_equal_p(list, list)
bool place_holder_variable_p(entity)
bool basic_equal_p(basic, basic)
size_t type_depth(type)
Number of steps to access the lowest leave of type t without dereferencing.
entity find_label_entity(const char *, const char *)
util.c
#define value_undefined_p(x)
#define syntax_reference_p(x)
#define instruction_sequence_p(x)
#define syntax_reference(x)
#define reference_undefined
#define extension_pragma_p(x)
#define instruction_loop_p(x)
#define extensions_undefined_p(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define value_intrinsic_p(x)
#define reference_undefined_p(x)
#define instruction_multitest_p(x)
#define instruction_loop(x)
#define statement_ordering(x)
#define instruction_multitest(x)
#define instruction_goto(x)
#define pragma_string_p(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define instruction_undefined_p(x)
#define instruction_domain
newgen_functional_domain_defined
#define call_domain
newgen_callees_domain_defined
#define basic_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define instruction_forloop_p(x)
#define instruction_undefined
#define statement_label(x)
#define extension_pragma(x)
#define EXTENSION(x)
EXTENSION.
#define entity_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
#define expression_undefined
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_expression
@ is_instruction_sequence
#define instruction_tag(x)
#define whileloop_label(x)
#define sequence_statements(x)
#define reference_indices(x)
#define statement_extensions(x)
#define instruction_sequence(x)
#define instruction_forloop(x)
#define unstructured_exit(x)
#define instruction_unstructured_p(x)
#define instruction_call_p(x)
#define instruction_expression(x)
#define test_condition(x)
#define instruction_whileloop(x)
#define unstructured_entry(x)
#define whileloop_body(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_whileloop_p(x)
#define persistant_statement_to_int_undefined
#define statement_decls_text(x)
#define instruction_call(x)
#define extensions_extension(x)
#define multitest_body(x)
#define instruction_test_p(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define statement_undefined_p(x)
#define statement_number(x)
#define value_expression_p(x)
#define instruction_goto_p(x)
#define expression_syntax(x)
#define value_expression(x)
#define instruction_unstructured(x)
#define statement_undefined
#define instruction_expression_p(x)
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
structure used by find_statements_with_label_walker
used to pass parameters to find_statements_with_comment_walker
instruction MakeSimpleIoInst2(int keyword, expression f, list io_list)