31 #ifndef GFC_2_PIPS_PRIVATE
32 #define GFC_2_PIPS_PRIVATE
53 int asprintf(
char **strp,
const char *fmt, ...);
59 #define gfc2pips_debug pips_debug
96 int strcmp_ (__const
char *__s1, __const
char *__s2);
100 int strncmp_ (__const
char *__s1, __const
char *__s2,
size_t __n);
104 int fcopy(
const char* old,
const char*
new );
147 list getSymbolBy(gfc_namespace* ns, gfc_symtree *st,
bool (*func)(gfc_namespace*, gfc_symtree *));
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
void gfc2pips_shift_comments(void)
We assign a gfc_code depending to a list of comments if any depending on the number of the statement.
bool gfc2pips_test_extern(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
list gfc2pips_dumpSELECT(gfc_code *c)
void gfc2pips_computeAdressesDynamic(void)
compute the addresses of the entities declared in DynamicArea
entity gfc2pips_code2get_label(gfc_code *c)
list gfc2pips_parameters(gfc_namespace *ns, gfc2pips_main_entity_type bloc_token)
expression gfc2pips_make_zero_for_symbol(gfc_symbol *sym)
int asprintf(char **strp, const char *fmt,...)
We have here to HACK GCC include that prevent use of these function.
void gfc2pips_computeAdressesStatic(void)
compute the addresses of the entities declared in StaticArea
list gfc2pips_args(gfc_namespace *ns)
Retrieve the list of names of every argument of the function, if any.
bool gfc2pips_get_incommon(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *__attribute__((__unused__)) st)
list gfc2pips_exprIO(char *s, gfc_expr *e, list l)
expression gfc2pips_expr2expression(gfc_expr *expr)
int gfc2pips_computeAdressesOfArea(entity _area)
compute the addresses of the entities declared in the given entity
void gfc2pips_getTypesDeclared(gfc_namespace *ns)
list gfc2pips_exprIO3(char *s, string e, list l)
list gen_union(list a, list b)
generate an union of unique elements taken from A and B
string gfc2pips_get_comment_of_code(gfc_code *c)
entity gfc2pips_int2label(int n)
dump an integer to a PIPS label entity
unsigned long gfc2pips_get_num_of_gfc_code(gfc_code *c)
char * gfc2pips_get_safe_name(const char *str)
gfc replace some functions by an homemade one, we check and return a copy of the original one if it i...
gfc2pips_main_entity_type
void gfc2pips_truncate_useless_zeroes(char *s)
expurgates a string representing a REAL, could be a pre-prettyprinter processing
entity gfc2pips_check_entity_doesnt_exists(char *s)
list * gfc2pips_list_of_all_modules
bool gfc2pips_check_already_done(locus l)
int fcopy(const char *old, const char *new)
copy the content of the first file to the second one
list gfc2pips_get_list_of_dimensions2(gfc_symbol *s)
build a list - if any - of dimension elements from the gfc_symbol given
void gfc2pips_generate_parameters_list(list parameters)
replace a list of entities by a list of parameters to those entities
type gfc2pips_symbol2type(gfc_symbol *s)
try to create the PIPS type that would be associated by the PIPS default parser
entity gfc2pips_real2entity(double r)
dump reals to PIPS entities
bool gfc2pips_comment_num_exists(unsigned long num)
void gfc2pips_replace_comments_num(unsigned long old, unsigned long new)
void gfc2pips_computeAdresses(void)
compute addresses of the stack, heap, dynamic and static areas
list getSymbolBy(gfc_namespace *ns, gfc_symtree *st, bool(*func)(gfc_namespace *, gfc_symtree *))
Look for a set of symbols filtered by a predicate function.
void gfc2pips_add_to_callees(entity e)
Add an entity to the list of callees.
instruction gfc2pips_code2instruction_(gfc_code *c)
this function create an atomic statement, no block of data
instruction gfc2pips_code2instruction(gfc_code *c, bool force_sequence)
Build an instruction sequence.
list gfc2pips_exprIO2(char *s, int e, list l)
char * strrcpy(char *dest, __const char *src)
same as strcpy, but begin by the end of the string allowing you to give twice the same string
list gfc2pips_get_extern_entities(gfc_namespace *ns)
build a list of externals entities
int strcmp_(__const char *__s1, __const char *__s2)
compare the strings in upper case mode
bool gfc2pips_test_variable2(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
char * gfc2pips_gfc_char_t2string_(gfc_char_t *c, int nb)
translate a string from a table of integers in gfc to one of chars in PIPS, escape all ' in the strin...
list gfc2pips_get_data_vars(gfc_namespace *ns)
return a list of elements needing a DATA statement
list gfc2pips_list_of_loops
list gfc2pips_get_list_of_dimensions(gfc_symtree *st)
build a list - if any - of dimension elements from the gfc_symtree given
void gfc2pips_set_last_comments_done(unsigned long nb)
void gfc2pips_push_comment(locus l, unsigned long nb, char s)
list gfc2pips_get_save(gfc_namespace *ns)
return a list of SAVE elements
entity gfc2pips_int_const2entity(int n)
translate an integer to a PIPS constant, assume n is positive (or it will not be handled properly)
void gfc2pips_namespace(gfc_namespace *ns)
Entry point for gfc2pips translation This will be called each time the parser encounter subroutine,...
entity gfc2pips_code2get_label4(gfc_code *c)
entity gfc2pips_check_entity_block_data_exists(char *s)
void gfc2pips_assign_gfc_code_to_last_comments(gfc_code *c)
void gfc2pips_assign_gfc_code_to_num_comments(gfc_code *c, unsigned long num)
void gfc2pips_initAreas(void)
void gfc2pips_assign_num_to_last_comments(unsigned long nb)
entity gfc2pips_symbol2top_entity(gfc_symbol *sym)
translate a gfc symbol to a top-level entity
instruction gfc2pips_code2instruction__TOP(gfc_namespace *ns, gfc_code *c)
Declaration of instructions.
list gfc2pips_arglist2arglist(gfc_actual_arglist *act)
expression gfc2pips_int2expression(int n)
translate a int to an expression
instruction gfc2pips_symbol2data_instruction(gfc_symbol *sym)
build a DATA statement, filling blanks with zeroes.
entity gfc2pips_code2get_label2(gfc_code *c)
entity gfc2pips_symbol2entity(gfc_symbol *sym)
translate a gfc symbol to a PIPS entity, check if it is a function, program, subroutine or else
gfc2pips_main_entity_type get_symbol_token(gfc_symbol *root_sym)
gfc_code * gfc2pips_get_last_loop(void)
char * gfc2pips_gfc_char_t2string(gfc_char_t *c, int nb)
translate a string from a table of integers in gfc to one of chars in PIPS, escape all ' in the strin...
expression gfc2pips_logical2expression(bool b)
translate a bool to an expression
bool gfc2pips_test_subroutine(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
bool gfc2pips_exprIsVariable(gfc_expr *expr)
gfc_symtree * gfc2pips_getSymtreeByName(const char *name, gfc_symtree *st)
list gfc2pips_mkRangeExpression(gfc_array_ref *ar)
bool gfc2pips_test_variable(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
expression gfc2pips_real2expression(double r)
translate a real to an expression
int gfc2pips_symbol2sizeArray(gfc_symbol *s)
calculate the total size of the array whatever the bounds are: A(-5,5)
entity gfc2pips_check_entity_module_exists(char *s)
list gfc2pips_array_ref2indices(gfc_array_ref *ar)
convert a list of indices from gfc to PIPS, assume there is no range (dump only the min range element...
list gfc2pips_vars(gfc_namespace *ns)
Extract every and each variable from a namespace.
list gfc_module_callees
Store the list of callees.
list get_use_entities_list(struct gfc_namespace *ns)
char * gfc2pips_gfc_char_t2string2(gfc_char_t *c)
translate the <nb> first elements of from a wide integer representation to a char representation
void gfc2pips_pop_not_done_comments(void)
void gfc2pips_computeAdressesHeap(void)
compute the addresses of the entities declared in StaticArea
bool gfc2pips_test_derived(gfc_namespace __attribute__((__unused__)) *ns, gfc_symtree *st)
expression gfc2pips_buildCaseTest(gfc_expr *tested_variable, gfc_case *cp)
dimension gfc2pips_int2dimension(int n)
create a <dimension> from the integer value given
int strncmp_(__const char *__s1, __const char *__s2, size_t __n)
compare the strings in upper case mode
void gfc2pips_push_last_code(gfc_code *c)
basic gfc2pips_getbasic(gfc_symbol *s)
gfc2pips_comments gfc2pips_pop_comment(void)
int gfc2pips_symbol2size(gfc_symbol *s)
return the size of an elementary element: REAL*16 A CHARACTER*17 B
list gfc2pips_list_of_declared_code
entity gfc2pips_expr2entity(gfc_expr *expr)
create an entity based on an expression, assume it is used only for incremented variables in loops
entity gfc2pips_check_entity_program_exists(char *s)
void gfc2pips_push_loop(gfc_code *c)
bool gfc2pips_test_data(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
list gfc2pips_reduce_repeated_values(list l)
look for repeated values (integers or real) in the list (list for DATA instructions) and transform th...
value gfc2pips_symbol2value(gfc_symbol *s)
entity gfc2pips_check_entity_exists(const char *s)
bool gfc2pips_there_is_a_range(gfc_array_ref *ar)
entity gfc2pips_logical2entity(bool b)
translate a boolean to a PIPS/fortran entity
char * strn2upper(char s[], size_t n)
put the n first elements of the given char table to upper case
char * str2upper(char s[])
put the given char table to upper case
bool gfc2pips_test_save(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
bool gfc2pips_test_dimensions(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *st)
entity gfc2pips_char2entity(char *p, char *s)
a little bit more elaborated FindOrCreateEntity
bool gfc2pips_get_commons(gfc_namespace *__attribute__((__unused__)) ns, gfc_symtree *__attribute__((__unused__)) st)
void gfc2pips_shiftAdressesOfArea(entity _area, int old_offset, int size, int max_offset, int shift)
int gfc2pips_expr2int(gfc_expr *expr)
entity gfc2pips_code2get_label3(gfc_code *c)
list gfc2pips_vars_(gfc_namespace *ns, list variables_p)
Convert the list of gfc symbols into a list of pips entities with storage, type, everything.
void gfc2pips_pop_loop(void)
#define src(name, suf)
HPFC by Fabien Coelho, May 1993 and later...
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
The structure used to build lists in NewGen.