PIPS
|
#include "gfc2pips-private.h"
#include "c_parser_private.h"
#include "misc.h"
#include "text-util.h"
#include <stdio.h>
Go to the source code of this file.
Functions | |
list | gen_union (list a, list b) |
generate an union of unique elements taken from A and B More... | |
void | gfc2pips_add_to_callees (entity e) |
Add an entity to the list of callees. More... | |
char * | str2upper (char s[]) |
Here are few utility functions to handle splitted files and do comparisons with case insensitive. More... | |
char * | strn2upper (char s[], size_t n) |
replace lower case char by upper case ones More... | |
char * | strrcpy (char *dest, __const char *src) |
copy a string from the last char (to allow copy on itself) More... | |
int | strcmp_ (__const char *__s1, __const char *__s2) |
insensitive case comparison More... | |
int | strncmp_ (__const char *__s1, __const char *__s2, size_t __n) |
insensitive case n-comparison More... | |
int | fcopy (const char *old, const char *new) |
copy the file called *old to the file called *new More... | |
void | gfc2pips_truncate_useless_zeroes (char *s) |
expurgates a string representing a REAL, could be a pre-prettyprinter processing More... | |
void | load_entities () |
void | save_entities () |
void | pips_init () |
void | gfc2pips_get_use_st (void) |
list | get_use_entities_list (struct gfc_namespace *ns) |
gfc_code * | gfc2pips_get_last_loop (void) |
void | gfc2pips_push_loop (gfc_code *c) |
void | gfc2pips_pop_loop (void) |
Variables | |
list | gfc_module_callees = NULL |
FIXME: should be generated... More... | |
list | gfc2pips_list_of_declared_code = NULL |
list | gfc2pips_list_of_loops = NULL |
hash_table | ns2use = NULL |
void gfc2pips_get_use_st( void ); More... | |
int fcopy | ( | const char * | old, |
const char * | new | ||
) |
copy the file called *old to the file called *new
copy the content of the first file to the second one
Definition at line 143 of file gfc2pips-util.c.
Referenced by gfc2pips_namespace().
generate an union of unique elements taken from A and B
Definition at line 47 of file gfc2pips-util.c.
References CAR, CHUNK, gen_cons(), gen_in_list_p(), and POP.
Referenced by gfc2pips_namespace().
list get_use_entities_list | ( | struct gfc_namespace * | ns | ) |
Create an entity
Definition at line 316 of file gfc2pips-util.c.
References asprintf, CONS, CurrentPackage, ENTITY, entity_initial, entity_name, entity_storage, entity_type, F95_USE_LOCAL_NAME, FindOrCreateEntity(), FOREACH, hash_get(), HASH_UNDEFINED_VALUE, make_storage_rom(), make_type_unknown(), make_value_unknown(), malloc(), and ns2use.
Referenced by gfc2pips_namespace().
void gfc2pips_add_to_callees | ( | entity | e | ) |
Add an entity to the list of callees.
Definition at line 67 of file gfc2pips-util.c.
References CONS, CurrentPackage, entity_local_name(), gfc2pips_debug, gfc_module_callees, intrinsic_entity_p(), and strcmp_().
Referenced by gfc2pips_code2instruction_(), and gfc2pips_get_extern_entities().
gfc_code* gfc2pips_get_last_loop | ( | void | ) |
Definition at line 348 of file gfc2pips-util.c.
References cons::car, gen_chunk::e, and gfc2pips_list_of_loops.
Referenced by gfc2pips_code2instruction(), and gfc2pips_code2instruction_().
void gfc2pips_get_use_st | ( | void | ) |
Definition at line 278 of file gfc2pips-util.c.
References CONS, hash_get(), hash_pointer, hash_put(), hash_table_make(), HASH_UNDEFINED_VALUE, NIL, ns2use, and strdup().
void gfc2pips_pop_loop | ( | void | ) |
Definition at line 356 of file gfc2pips-util.c.
References gfc2pips_list_of_loops, and POP.
Referenced by gfc2pips_code2instruction_().
void gfc2pips_push_loop | ( | gfc_code * | c | ) |
Definition at line 353 of file gfc2pips-util.c.
References gen_cons(), and gfc2pips_list_of_loops.
Referenced by gfc2pips_code2instruction_().
void gfc2pips_truncate_useless_zeroes | ( | char * | s | ) |
expurgates a string representing a REAL, could be a pre-prettyprinter processing
1.0000000000e+00 becomes 1. 1234.5670000e+18 becomes 1234.567e+18
f(*s=='.'){ s='\0'; s–; gfc2pips_debug(9,"final dot retrieved\n"); }
Definition at line 172 of file gfc2pips-util.c.
References gfc2pips_debug, and start.
Referenced by gfc2pips_real2entity().
void load_entities | ( | ) |
Definition at line 225 of file gfc2pips-util.c.
References entity_domain, gen_read_tabulated(), gfc_option, pips_assert, safe_fclose(), and safe_fopen().
Referenced by pips_init().
void pips_init | ( | ) |
get NewGen data type description
Definition at line 240 of file gfc2pips-util.c.
References c_parser_private_spec, gen_init_external(), gen_read_spec(), load_entities(), parser_private_spec, PVECTEUR_NEWGEN_EXTERNAL, ri_spec, set_pips_meta_informations(), text_spec, vect_gen_allocated_memory(), vect_gen_copy_tree(), vect_gen_free(), vect_gen_read(), and vect_gen_write().
Referenced by gfc2pips_namespace().
void save_entities | ( | ) |
Definition at line 233 of file gfc2pips-util.c.
References entity_domain, gen_write_tabulated(), gfc_option, safe_fclose(), and safe_fopen().
Referenced by gfc2pips_namespace().
char* str2upper | ( | char | s[] | ) |
Here are few utility functions to handle splitted files and do comparisons with case insensitive.
put the given char table to upper case
replace lower case char by upper case ones
Definition at line 83 of file gfc2pips-util.c.
Referenced by gfc2pips_char2entity(), gfc2pips_check_entity_block_data_exists(), gfc2pips_check_entity_doesnt_exists(), gfc2pips_check_entity_exists(), gfc2pips_check_entity_module_exists(), gfc2pips_check_entity_program_exists(), gfc2pips_expr2entity(), gfc2pips_expr2expression(), gfc2pips_getbasic(), gfc2pips_symbol2entity(), gfc2pips_symbol2top_entity(), gfc2pips_vars_(), strcmp_(), and strncmp_().
int strcmp_ | ( | __const char * | __s1, |
__const char * | __s2 | ||
) |
insensitive case comparison
compare the strings in upper case mode
Definition at line 119 of file gfc2pips-util.c.
References free(), ret, str2upper(), and strdup().
Referenced by __attribute__(), gfc2pips_add_to_callees(), and gfc2pips_namespace().
char* strn2upper | ( | char | s[], |
size_t | n | ||
) |
replace lower case char by upper case ones
put the n first elements of the given char table to upper case
Definition at line 100 of file gfc2pips-util.c.
insensitive case n-comparison
compare the strings in upper case mode
Definition at line 131 of file gfc2pips-util.c.
References free(), ret, str2upper(), and strdup().
Referenced by gfc2pips_get_safe_name().
char* strrcpy | ( | char * | dest, |
__const char * | src | ||
) |
copy a string from the last char (to allow copy on itself)
same as strcpy, but begin by the end of the string allowing you to give twice the same string
Definition at line 110 of file gfc2pips-util.c.
References src.
Referenced by gfc2pips_push_comment().
list gfc2pips_list_of_declared_code = NULL |
Definition at line 41 of file gfc2pips-util.c.
Referenced by gfc2pips_code2instruction__TOP(), gfc2pips_push_last_code(), and gfc2pips_shift_comments().
list gfc2pips_list_of_loops = NULL |
Definition at line 42 of file gfc2pips-util.c.
Referenced by gfc2pips_get_last_loop(), gfc2pips_pop_loop(), and gfc2pips_push_loop().
list gfc_module_callees = NULL |
FIXME: should be generated...
Store the list of callees.
Definition at line 40 of file gfc2pips-util.c.
Referenced by gfc2pips_add_to_callees(), and gfc2pips_namespace().
hash_table ns2use = NULL |
void gfc2pips_get_use_st( void );
This function is called by the GFC parser when encountering a USE statement. It'll produce an entry in "ns2use" hashtable
Definition at line 277 of file gfc2pips-util.c.
Referenced by get_use_entities_list(), and gfc2pips_get_use_st().