10 #include "pips_config.h"
20 #define STEP_GENERATED_SUFFIX_F ".step_generated.f"
21 #define STEP_GENERATED_SUFFIX_C ".step_generated.c"
36 string begin_txt, end_txt;
42 if(!is_block_construct)
153 int transformation_type = -1;
164 pips_debug(2,
"end transformation_type : %d\n", transformation_type);
166 return transformation_type;
179 *transformation_txt =
strdup(
"MPI");
182 *transformation_txt =
strdup(
"HYBRID");
186 *transformation_txt =
strdup(
"");
198 string previous_name, new_module_name;
202 previous_name =
STRING(
CAR(*last_module_name));
210 *last_module_name =
CONS(
STRING, new_module_name, *last_module_name);
211 pips_debug(1,
"new_module %p : %s\n", new_module, new_module_name);
219 int transformation_type;
238 free(transformation_txt);
249 string new_module_name;
257 new_module_name =
STRING(
CAR(*last_module_name));
258 pips_debug(1,
"stack_name current name = %s\n", new_module_name);
278 POP(*last_module_name);
313 string init_subroutine_name;
358 string source_file, fsource_file;
365 pips_debug(1,
"Copie from: %s\n", fsource_file);
371 pips_debug(1,
"\tAdd prototype for STEP generated modules\n");
395 debug_on(
"STEP_COMPILE_DEBUG_LEVEL");
401 string init_name, finit_name;
void free_statement_effects(statement_effects p)
void free_extension(extension p)
language copy_language(language p)
LANGUAGE.
void free_statement(statement p)
void free_step_directive(step_directive p)
step_directive make_step_directive(intptr_t a1, statement a2, list a3)
gen_array_t db_get_module_list_initial_order(void)
#define RT_STEP_init_fortran_order
#define RT_STEP_init_c_order
bool step_analysed_module_p(const char *module_name)
size_t gen_array_nitems(const gen_array_t a)
void * gen_array_item(const gen_array_t a, size_t i)
struct _newgen_struct_statement_ * statement
statement call_STEP_subroutine2(string name,...)
string compilation_unit_of_module(const char *)
The output is undefined if the module is referenced but not defined in the workspace,...
void set_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
void reset_rw_effects(void)
struct _newgen_struct_statement_effects_ * statement_effects
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
const char * module_name(const char *s)
Return the module part of an entity name.
void safe_copy(char *source, char *target)
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
statement make_block_statement(list)
Make a block statement from a list of statement.
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
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
entity get_current_module_entity(void)
Get the entity of the current module.
#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)
#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.
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_FILE_RESOURCE
Put a file resource into the current workspace database.
list statement_block(statement)
Get the list of block statements of a statement sequence.
bool empty_statement_or_continue_p(statement)
Return true if the statement is an empty instruction block or a continue or a recursive combination o...
void insert_statement(statement, statement, bool)
This is the normal entry point.
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
string db_build_file_resource_name(const char *rname, const char *oname, const char *suffix)
returns an allocated file name for a file resource.
#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
void safe_system(string)
system.c
static statement init_stmt
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
#define string_undefined_p(s)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
string db_get_current_workspace_directory(void)
text text_named_module(entity, entity, statement)
void fprint_statement(FILE *, statement)
Print statement "s" on file descriptor "fd".
statement last_statement(statement)
A simplified version of find_last_statement() located in prettyprint.c and designed to be used within...
void set_bool_property(const char *, bool)
static const char * prefix
#define statement_block_p(stat)
#define module_language(e)
implemented as a macro to allow lhs
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity make_empty_subroutine(const char *name, language l)
bool entity_main_module_p(entity e)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
string build_new_top_level_module_name(const char *prefix, bool prevent_suffix)
Get a new name for a module built from a prefix.
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 extension_pragma(x)
#define EXTENSION(x)
EXTENSION.
#define statement_extensions(x)
#define statement_declarations(x)
#define extensions_extension(x)
#define statement_undefined_p(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
struct _newgen_struct_transformation_ * transformation
statement compile_omp(statement stmt, step_directive d)
compile.c
statement compile_mpi(statement stmt, string new_module_name, step_directive drt, int transformation)
void step_compile_generated_module(const char *module_name, string finit_name)
generated source: no analyse and no compilation necessary.
#define STEP_GENERATED_SUFFIX_F
Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier.
#define STEP_GENERATED_SUFFIX_C
static int get_directive_transformation_type(step_directive drt)
static entity create_new_module_entity(list *last_module_name, string directive_txt, string transformation_txt)
static int get_directive_transformation(step_directive drt, string *transformation_txt)
void step_compile_analysed_module(const char *module_name, string finit_name)
void add_omp_guard(statement *block)
static bool compile_filter(statement stmt, list *last_module_name)
static void get_module_name_directive_suffix(step_directive drt, string *directive_txt)
static statement remove_STEP_pragma(statement stmt)
bool step_compile(const char *module_name)
static void compile_rewrite(statement stmt, list *last_module_name)
#define STEP_TRANSFORMATION_HYBRID
#define STEP_TRANSFORMATION_SEQ
#define STEP_TRANSFORMATION_OMP
#define STEP_TRANSFORMATION_MPI
#define STEP_SENTINELLE
STEP sentinelle.
bool step_directives_bound_p(statement stmt)
bool step_directive_to_strings(step_directive d, bool is_fortran, string *begin_txt, string *end_txt)
void step_directives_reset()
void step_directive_print(step_directive d)
step_directive step_directives_load(statement stmt)
void step_directives_init(bool first_p)
#define STEP_PARALLEL
Handled construction.
#define step_clause_transformation_p(x)
#define step_directive_type(x)
#define step_directive_clauses(x)
#define step_clause_transformation(x)
#define STEP_CLAUSE(x)
STEP_CLAUSE.
The structure used to build lists in NewGen.
void print_text(FILE *fd, text t)