25 #include "pips_config.h"
38 #define FATAL(msg,value) {(void) fprintf(stderr,msg,value); exit(1); }
43 #define param_ref_p(P) \
44 (mode_reference_p(parameter_mode(P)))
46 #define arg_const_p(arg) \
47 (syntax_call_p(expression_syntax(arg)) && \
48 value_constant_p(entity_initial(call_function( \
49 syntax_call(expression_syntax(arg))))))
51 #define call_constant_p(C) \
52 (value_constant_p(entity_initial(call_function(C))))
55 #define effect_may_or_must_p(my_effect) \
56 ((approximation_may_p(effect_approximation(my_effect))) || \
57 (approximation_exact_p(effect_approximation(my_effect))) )
59 #define effect_to_name(the_effect)\
60 entity_name(reference_variable(effect_any_reference(the_effect)))
62 #define entity_is_a_common_p(Ent) \
63 (type_area_p(entity_type(Ent)))
65 #define special_common(Ent) \
66 ((!strcmp(entity_local_name(Ent),DYNAMIC_AREA_LOCAL_NAME)) || \
67 (!strcmp(entity_local_name(Ent),STATIC_AREA_LOCAL_NAME)) )
109 "warning, function used as a procedure : %s\n",
238 "too %s arguments (%d) in call to %s (%d)\n",
239 ((na > nt) ?
"many" :
"few"),
262 list ca = la, ct = lt;
264 for (i = 1; i <= len; i++) {
315 "may be incompatible basic type, %dth arg in call to %s\n",
319 "incompatible basic type, %dth arg in call to %s, %s>%s\n",
343 if (!(ok_de && ok_dp))
352 "incompatible dim, %dth arg in call to %s, (%d<%d)\n",
377 if (!(okexp && okpar))
405 int len_ind =
gen_length(the_indices), len_dim;
414 if (len_dim < len_ind) {
416 "too many indices (%d>%d) in reference to %s\n",
421 if (len_dim > len_ind) {
423 "too few indices (%d<%d) in reference to %s\n",
431 for (i = 1; i <= len; i++) {
435 "the %dth index may not be a mere integer\n", i);
440 "the %dth index is not a mere integer\n", i);
442 the_indices =
CDR(the_indices);
479 pips_debug(7,
"summary effects list for %s (%p)\n",
482 for (i = 1; i <= len; i++) {
505 list sefl = sefs_list;
506 bool encountered =
false;
517 while ((sefl != NULL) && (!encountered))
528 "modified reference to a constant, %dth argument in call to %s\n",
531 return (!encountered);
548 while (ldecl != NULL) {
554 "common : %s, in module %s\n",
559 while (llayout != NULL) {
561 fprintf(stdout,
"variable %s at offset %td\n",
564 llayout =
CDR(llayout);
617 *sup = (*inf) + (nb_of_elements * len_unit) - 1;
639 while (ldecl != NULL)
664 llayout = llayout_init;
666 pips_debug(4,
"checking common %s of module %s\n",
670 while (!
ENDP(llayout))
673 common_beginning_offset = -1,
674 common_ending_offset = -1,
675 other_beginning_offset = -1,
676 other_ending_offset = -1;
680 lothers = llayout_init;
682 llayout =
CDR(llayout);
689 &common_beginning_offset,
690 &common_ending_offset))
693 while (lothers != NULL)
697 lothers =
CDR(lothers);
703 "%s used twice in common %s\n",
710 &other_beginning_offset,
711 &other_ending_offset))
716 common_beginning_offset,
717 common_ending_offset,
719 other_beginning_offset,
720 other_ending_offset);
747 if ((sup1 < inf2) || (sup2 < inf1))
765 "overlap of incompatible variables (%s, %s) in common %s\n",
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
static reference ref
Current stmt (an integer)
bdt base
Current expression.
#define effect_write_p(eff)
list effects_to_list(effects)
const char * module_name(const char *s)
Return the module part of an entity name.
void flint_message(char *fun, char *fmt,...)
void flint_message_2(char *fun, char *fmt,...)
Same as flint_message but without the function name
bool find_bd_type_variable(type, basic *, list *)
bool find_bd_parameter(parameter, basic *, list *)
bool control_type_in_expression(enum basic_utype, int, expression)
bool find_bd_expression(expression, basic *, list *)
bool number_of_elements(list, intptr_t *)
flint_utils.c
bool check_overlap_in_common(entity the_common, entity e1, int inf1, int sup1, entity e2, int inf2, int sup2)
#define effect_may_or_must_p(my_effect)
The following define may be replaced by #define ...
bool check_call_args_number(list la, list lt, call c)
bool check_call_mode_consistency(list la, list lt, entity the_fnct)
bool check_call_basic_and_dim(expression exp, parameter param, call c, int i)
bool check_call_types_compatibility(list la, list lt, call c)
bool check_call_basic(basic be, basic bp, call c, int i)
bool check_call_one_mode(expression exp, parameter param, entity the_fnct, list sefs_list, int i)
This function checks that a reference to a constant in a call may not be modified,...
bool check_call_dim(list de, list dp, call c, int i)
loose version
bool look_at_the_commons(entity module)
void check_one_common(entity local, entity module)
#define BOOL_UNDEF
some defines usefull to clean the code
#define effect_to_name(the_effect)
#define call_constant_p(C)
#define special_common(Ent)
#define entity_is_a_common_p(Ent)
bool check_procedure(call c)
extern char *current_module_name; unused and modified
bool position_in_the_area(entity the_var, intptr_t *inf, intptr_t *sup)
void check_the_reference(reference ref)
bool check_the_call(call c)
bool check_call_one_type(expression exp, parameter param, call c, int i)
bool check_call_intrinsic(list la, list __attribute__((unused)) lt, call c)
bool check_commons(entity module)
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
size_t gen_length(const list l)
#define CAR(pcons)
Get the value of the first element of a list.
list gen_last(list l)
Return the last element of a list.
#define CDR(pcons)
Get the list less its first element.
#define list_undefined
Undefined list definition :-)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_internal_error
string basic_to_string(basic)
#define ENTITY_ASSIGN_P(e)
#define call_intrinsic_p(C)
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...
const char * module_local_name(entity e)
Returns the module local user name.
entity find_ith_formal_parameter(entity the_fnct, int rank)
This function gives back the ith formal parameter, which is found in the declarations of a call or a ...
const char * entity_module_name(entity e)
See comments about module_name().
#define type_functional_p(x)
#define functional_result(x)
#define basic_complex_p(x)
#define parameter_type(x)
#define reference_variable(x)
#define type_functional(x)
#define entity_storage(x)
#define code_declarations(x)
#define basic_overloaded_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define functional_parameters(x)
#define PARAMETER(x)
PARAMETER.
#define reference_indices(x)
#define type_varargs_p(x)
#define call_arguments(x)
#define basic_logical_p(x)
#define entity_initial(x)
Value b1
booleen indiquant quel membre est en cours d'analyse
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".