2 #include "pips_config.h"
77 for (i=0; i<strlen(name); i++)
78 name[i]=toupper(name[i]);
266 current_block = step_blocks_head();
281 pips_debug(2,
"loop directive already closed\n");
297 int size = step_blocks_size();
298 sequence new_seq = step_blocks_pop();
327 pips_debug(1,
"begin directive_stmt = %p, type = %d, str = %s\n", directive_stmt,
type, s);
342 current_block = step_blocks_head();
357 size = step_blocks_size();
359 pips_debug(4,
"size = %d, head_length = %d\n", size, head_len);
388 sequence parent_block = step_blocks_nth(2);
399 else if(!step_blocks_empty_p())
401 sequence current_block = step_blocks_head();
460 if (step_blocks_empty_p())
462 pips_debug(2,
"empty step_blocks: nothing to do in the module body\n");
468 pips_debug(2,
"Analysing and handling pragmas\n");
503 sequence current_block = step_blocks_head();
504 pips_debug(2,
"ADD stmt to the current block\n");
510 pips_debug(2,
"NOT added to current step_blocks\n");
539 pips_debug(2,
"PUSH empty sequence on step_blocks\n");
554 size = step_blocks_size();
555 previous_block = step_blocks_nth(2);
564 sequence new_seq = step_blocks_pop();
583 make_step_blocks_stack();
591 free_step_blocks_stack();
596 debug_on(
"STEP_PARSER_DEBUG_LEVEL");
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
list gen_extension_cons(extension p, list l)
sequence make_sequence(list a)
void free_sequence(sequence p)
step_directive make_step_directive(intptr_t a1, statement a2, list a3)
step_clause make_step_clause_transformation(intptr_t _field_)
struct _newgen_struct_statement_ * statement
string compilation_unit_of_module(const char *)
The output is undefined if the module is referenced but not defined in the workspace,...
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
statement make_block_statement(list)
Make a block statement from a list of statement.
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
void move_statement_attributes(statement, statement)
Move all the attributes from one statement to another one.
void reset_current_module_entity(void)
Reset the current module entity.
const char * get_current_module_name(void)
Get the name of the current module.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
#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)
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)
#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
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
void gen_insert_after(const void *no, const void *o, list l)
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.
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
list statement_block(statement)
Get the list of block statements of a statement sequence.
bool empty_statement_or_labelless_continue_p(statement)
Return true if the statement is an empty instruction block without label or a continue without label ...
bool statement_forloop_p(statement)
bool statement_loop_p(statement)
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
#define full_name(dir, name)
#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 TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MODULE_SEP_STRING
string concatenate(const char *,...)
Return the concatenation of the given strings.
void * gen_find_tabulated(const char *, int)
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
bool ordering_to_statement_initialized_p()
Test if the ordering to statement is initialized.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define statement_block_p(stat)
#define empty_comments
Empty comments (i.e.
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool c_module_p(entity m)
Test if a module "m" is written in C.
code entity_code(entity e)
entity entity_empty_label(void)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
extensions empty_extensions(void)
extension.c
void add_pragma_str_to_statement(statement st, const char *s, bool copy_flag)
Add a string as a pragma to a statement.
#define pragma_string_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define statement_label(x)
#define extension_pragma(x)
#define EXTENSION(x)
EXTENSION.
#define entity_undefined_p(x)
#define sequence_statements(x)
#define statement_extensions(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define statement_comments(x)
#define statement_decls_text(x)
#define extensions_extension(x)
#define statement_undefined_p(x)
#define sequence_domain
newgen_reference_domain_defined
#define pragma_undefined_p(x)
#define sequence_undefined_p(x)
#define entity_domain
newgen_syntax_domain_defined
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define STEP_TRANSFORMATION_HYBRID
#define STEP_TRANSFORMATION_SEQ
#define STEP_DEBUG_STATEMENT(D, W, S)
#define STEP_TRANSFORMATION_OMP
#define STEP_DEFAULT_TRANSFORMATION_HYBRID_TXT
#define STEP_TRANSFORMATION_MPI
#define STEP_DEFAULT_TRANSFORMATION_MPI_TXT
#define STEP_DEFAULT_TRANSFORMATION_OMP_TXT
#define STEP_SENTINELLE
STEP sentinelle.
void step_directives_save()
bool step_directives_bound_p(statement stmt)
void step_directives_store(statement stmt, step_directive d)
void step_directives_print()
step_directive step_directives_load(statement stmt)
void step_directives_init(bool first_p)
static bool statement_filter(statement stmt)
static int current_transform
static void print_step_blocks()
DEFINE_LOCAL_STACK(step_blocks, sequence)
static bool sequence_filter(sequence __attribute__((unused)) seq)
static pragma current_pragma
void remove_old_pragma(void)
static step_directive get_current_step_directive(bool open)
void step_bison_parse(pragma pgm, statement stmt)
static step_directive new_step_directive(statement directive_stmt, int type, string s)
Functions used for gen_multi_recurse.
static void step_pragma_handle(statement stmt)
static void statement_rewrite(statement stmt)
void set_current_transform(int transform)
Functions called from the BISON parser.
static void step_directive_parser(statement body)
static void reset_step_transform()
static statement current_statement
static void sequence_rewrite(sequence seq)
entity entity_from_user_name(string name)
void step_comment2pragma_handle(statement stmt)
step_directive begin_omp_construct(int type, string s)
bool step_parser(const char *module_name)
void insert_optional_pragma(int type)
step_directive end_omp_construct(int type)
#define STEP_THREADPRIVATE
#define STEP_PARALLEL
Handled construction.
#define step_directive_undefined
#define step_directive_type(x)
#define step_directive_block(x)
#define STEP_CLAUSE(x)
STEP_CLAUSE.
#define step_directive_undefined_p(x)
The structure used to build lists in NewGen.