25 #include "pips_config.h"
39 #include "resources.h"
149 #define PREFIX1 "$UBS_CHECK"
150 #define PREFIX2 "$UBS_CHECK_END"
170 user_log(
"\n Number of uninitialized scalar variables : %d",
172 user_log(
"\n Number of uninitialized array variables : %d",
174 user_log(
"\n Number of may uninitialized scalar variables : %d",
176 user_log(
"\n Number of may uninitialized array variables : %d",
178 user_log(
"\n Number of added verifications : %d",
180 user_log(
"\n Number of processed modules : %d\n",
227 if (a1 == a2)
return true;
267 return sc_system_projection_along_variables(ps, pv_var);
285 user_log(
"\nInitialize floating number with more than 8 bytes ?");
291 user_log(
"\nInitialize overloaded ?");
302 user_log(
"\nInitialize complex number with more than 16 bytes ?");
463 fprintf(stderr,
"\nGenerated statement:");
467 free(print_message), print_message = NULL;
468 free(stop_message), stop_message = NULL;
496 Psysteme row_echelon = SC_UNDEFINED, condition = SC_UNDEFINED;
536 fprintf(stderr,
"\nGenerated statement:");
540 free(print_message), print_message = NULL;
541 free(stop_message), stop_message = NULL;
562 fprintf(stderr,
"\nCall to other module\n");
587 fprintf(stderr,
"\nFound at %d-th argument:",i);
611 fprintf(stderr,
"\nMAY IN region of elementary statement\n");
625 fprintf(stderr,
"\nVerify expression\n");
639 fprintf(stderr,
"\nInsert a VERIFY function before a reference\n");
670 pips_debug(3,
"Verify the current statement:");
672 fprintf(stderr,
"with list of IN regions:");
695 fprintf(stderr,
"\nMUST IN region, variable in module scope\n");
714 fprintf(stderr,
"\nMAY IN region or common variable not in current module scope\n");
867 fprintf(stderr,
"\nList of entities in the common declaration");
923 user_log(
"\nCommon array variable %s is fully initialized by BLOCKDATA???\n",
931 pips_debug(2,
"MUST IN at module statement\n");
972 fprintf(
out,
" CALL INITIALIZE_%s\n",area_name);
973 fprintf(
out2,
" SUBROUTINE INITIALIZE_%s\n",area_name);
1021 pips_debug(2,
"MUST IN at module statement\n");
1033 pips_debug(2,
"MAY IN at module statement\n");
1054 string instrument_file =
strdup(
concatenate(dir_name,
"/instrument.out", NULL));
1057 "/",base_name,NULL));
1060 pips_user_warning(
"\nMUST REGIONS not selected - " "Do not expect wonderful results\n");
1074 debug_on(
"USED_BEFORE_SET_DEBUG_LEVEL");
1082 fprintf(
out,
" EXTERNAL ir_isnan,id_isnan\n");
1083 fprintf(
out,
" LOGICAL*4 ir_isnan,id_isnan\n");
1139 free(instrument_file), instrument_file = NULL;
1140 free(dir_name), dir_name = NULL;
void user_log(const char *format,...)
reference make_reference(entity a1, list a2)
test make_test(expression a1, statement a2, statement a3)
ubs_check make_ubs_check(entity a1, entity a2)
struct _newgen_struct_entity_ * entity
static reference ref
Current stmt (an integer)
static const char * caller_name
struct _newgen_struct_statement_ * statement
entity make_constant_entity(string name, tag bt, size_t size)
For historical reason, call the Fortran version.
bool integer_constant_p(entity ent, int *int_p)
Returns the double value associated to a PIPS constant.
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
statement systeme_to_loop_nest(Psysteme, list, statement, entity)
sc is used to generate the loop nest bounds for variables vars.
statement generate_optional_if(Psysteme, statement)
statement generate_optional_if(sc, stat)
#define region_entity(reg)
#define region_system(reg)
#define region_empty_p(reg)
#define region
simulation of the type region
#define region_approximation(reg)
list phi_entities_list(int, int)
void get_regions_properties(void)
Psysteme entity_declaration_sc(entity)
void print_inout_regions(list)
void set_in_effects(statement_effects)
void reset_in_effects(void)
list load_statement_in_regions(statement)
#define approximation_exact_p(x)
const char * module_name(const char *s)
Return the module part of an entity name.
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
char * pips_basename(char *fullpath, char *suffix)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_recurse(start, domain_number, flt, rwt)
static FILE * user_file
These functions implements the writing of objects.
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
statement make_block_statement(list)
Make a block statement from a list of statement.
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
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#define ENDP(l)
Test if a list is empty.
#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)
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
#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 MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
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.
call statement_call(statement)
Get the call of a statement.
statement make_assign_statement(expression, expression)
statement make_print_statement(string)
Make a Fortran print statement.
statement make_stop_statement(string)
This function returns a Fortran stop statement with an error message.
void insert_statement(statement, statement, bool)
This is the normal entry point.
struct _newgen_struct_entities_ * entities
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_internal_error
#define BLANK_COMMON_LOCAL_NAME
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
bool EvalNormalized(normalized n, int *pv)
#define WORKSPACE_SRC_SPACE
string db_get_current_workspace_directory(void)
rule find_rule_by_resource(const char *rname)
This function returns the active rule to produce resource rname.
void print_expressions(list le)
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
string expression_to_string(expression e)
list Words_Expression(expression obj)
of string
void fprint_statement(FILE *, statement)
Print statement "s" on file descriptor "fd".
void print_statement(statement)
Print a statement on stderr.
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
void set_bool_property(const char *, bool)
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
#define ORDERING_NUMBER(o)
#define ORDERING_STATEMENT(o)
#define NORMALIZE_EXPRESSION(e)
#define test_to_statement(t)
#define eq_expression(e1, e2)
#define DIVIDE_OPERATOR_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_in_list_p(entity ent, list ent_l)
look for ent in ent_l
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool entity_main_module_p(entity e)
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
const char * module_local_name(entity e)
Returns the module local user name.
void print_entities(list l)
bool entity_blockdata_p(entity e)
bool entity_module_p(entity e)
const char * entity_module_name(entity e)
See comments about module_name().
Pbase entity_list_to_base(list l)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
list common_members_of_module(entity common, entity module, bool only_primary)
returns the list of entity to appear in the common declaration.
expression reference_to_expression(reference r)
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...
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
list expression_to_reference_list(expression e, list lr)
conversion of an expression into a list of references; references are appended to list lr as they are...
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
bool variable_in_common_p(entity)
true if v is in a common.
bool formal_parameter_p(entity)
bool variable_static_p(entity)
true if v appears in a SAVE statement, or in a DATA statement, or is declared static i C.
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
struct _newgen_struct_callees_ * callees
#define REFERENCE(x)
REFERENCE.
#define syntax_reference(x)
#define callees_callees(x)
#define reference_variable(x)
#define statement_ordering(x)
#define dimension_lower(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define storage_formal(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_sequence
#define instruction_tag(x)
#define dimension_upper(x)
#define reference_indices(x)
#define test_condition(x)
#define instruction_whileloop(x)
#define variable_dimensions(x)
#define statement_instruction(x)
#define call_arguments(x)
#define instruction_test(x)
#define whileloop_condition(x)
#define expression_syntax(x)
#define type_variable_p(x)
#define statement_undefined
#define entity_initial(x)
bool sc_rn_p(Psysteme sc)
bool sc_rn_p(Psysteme sc): check if the set associated to sc is the whole space, rn
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void algorithm_row_echelon(Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration)
see comments above.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define CHAIN_SWORD(l, s)
string words_to_string(cons *lw)
#define UBS_CHECK(x)
newgen_ubs_domain_defined
#define ubs_check_module(x)
#define ubs_check_variable(x)
static bool initialized_by_equivalent_variable_p(entity ent)
static expression make_test_condition(expression exp, entity ent)
This function makes a test like X.EQ.100000 or id_nan(A(PHI1)) or ir_nan(A(I,B(J))
static list words_numerical_dimension(dimension obj)
This function prints a common variable with its numerical size, because we do not want to generate th...
static void verify_array_variable(entity ent, region reg)
This function generates code that verifies if all array elements in the array region are initialized ...
static string initialization_file
static int number_of_uninitialized_scalar_variables
static int number_of_added_verifications
static void insert_initialization(entity ent)
static Psysteme remove_temporal_variables_from_system(Psysteme ps)
static void verify_array_element(entity ent, expression exp)
static int number_of_may_uninitialized_scalar_variables
#define PREFIX1
This analysis checks if the program uses a variable or an array element which has not been assigned a...
static void verify_used_before_set_call(call c, statement s)
static string print_list_of_expressions(list l)
static list entities_to_expressions2(list l_ent)
static void verify_scalar_variable(entity ent)
static entity current_entity
static void display_used_before_set_statistics()
static list l_initialized_commons
static string print_list_of_entities(list l)
static void initialize_scalar_variable(entity ent)
This function generates an assignment that initializes the scalar variable.
static void verify_formal_and_common_variables(entity ent, list l_callers)
static int number_of_processed_modules
static void insert_common_declaration(entity ent, entity sec)
static statement module_statement
static int number_of_uninitialized_array_variables
static bool common_variable_in_module_scope_p(entity ent, entity mod)
static void verify_used_before_set_statement()
static void initialize_array_variable(entity ent)
This function generates code that initializes every array element in the array region to a special va...
static void verify_used_before_set_expression(expression exp, statement s)
static expression make_special_value(entity ent)
static int number_of_may_uninitialized_array_variables
static entity current_mod
static void initialize_and_verify_local_variable(entity ent, region reg)
static list words_common_variable(entity e)
static void initialize_and_verify_common_variable(entity ent, region reg)
static bool verify_used_before_set_statement_flt(statement s)
bool used_before_set(const char *module_name)
used_before_set.c
#define exp
Avoid some warnings from "gcc -Wshadow".
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...