25 #include "pips_config.h"
43 #include "resources.h"
50 #define GET_TYPE(h, e) ((basic)hash_get(h, (char*)(e)))
51 #define PUT_TYPE(h, e, b) hash_put(h, (char*)(e), (char*)(b))
56 #define CONCAT_OPERATOR_NAME "//"
57 #define ENTITY_CONCAT_P(e) (entity_an_operator_p(e, CONCAT))
58 #define ENTITY_EXTERNAL_P(e) (value_code_p(entity_initial(e)))
59 #define ENTITY_INTRINSIC_P(e) (value_intrinsic_p(entity_initial(e)))
61 #define ENTITY_CONVERSION_P(e,name) \
62 (strcmp(entity_local_name(e), name##_GENERIC_CONVERSION_NAME)==0)
63 #define ENTITY_CONVERSION_CMPLX_P(e) ENTITY_CONVERSION_P(e, CMPLX)
64 #define ENTITY_CONVERSION_DCMPLX_P(e) ENTITY_CONVERSION_P(e, DCMPLX)
102 "invalid arg #%d to '%s', %s instead of %s!",
116 "Too few argument(s) to '%s' (%d<%d)!",
123 "Too many argument(s) to '%s' (%d>%d)!",
226 pips_debug(1,
"Call to %s; Its type is %s \n",
238 "Ignored %s value returned by '%s'",
268 "Test condition must be a logical expression!");
280 "While condition must be a logical expression!");
294 basic lower, upper, incr;
318 "Obsolescent non integer loop index '%s'"
319 " (R822 ISO/IEC 1539:1991 (E))",
327 "Index '%s' must be Integer, Real or Double!",
334 "Range of index '%s' must be Integer, Real or Double!",
375 "Range must be INT, REAL or DBLE!");
461 "%s parameter '%s' definition from incompatible type %s",
480 "\t%d errors found\n"
481 "\t%d conversions inserted\n"
482 "\t%d simplifications performed\n",
485 context->number_of_simplication);
488 "%d errors, %d convertions., %d simplifications\n",
492 context->number_of_simplication);
505 "!PIPS TYPER: %d errors, %d conversions, %d simplifications\n",
508 context->number_of_simplication);
533 context.number_of_conversion = 0;
534 context.number_of_simplication = 0;
551 debug_on(
"TYPE_CHECKER_DEBUG_LEVEL");
552 pips_debug(1,
"considering module %s\n", name);
void user_log(const char *format,...)
basic copy_basic(basic p)
BASIC.
basic make_basic_overloaded(void)
basic make_basic_int(intptr_t _field_)
struct paramStruct params
basic(* typing_function_t)(call, type_context_p)
void(* switch_name_function)(expression, type_context_p)
switch_name_function get_switch_name_function_for_intrinsic(const char *name)
typing_function_t get_typing_function_for_intrinsic(const char *name)
expression insert_cast(basic cast, basic from, expression exp, type_context_p)
Function in type_checker.c.
void type_loop_range(basic, range, type_context_p)
struct _newgen_struct_statement_ * statement
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
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_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define NIL
The empty list (nil in Lisp)
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 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.
void add_one_line_of_comment(statement, string,...)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_MAP(k, v, code, ht)
void * stack_head(const stack)
returns the item on top of stack s
void stack_push(void *, stack)
stack use
void stack_free(stack *)
type, bucket_size, policy
stack stack_make(int, int, int)
allocation
void * stack_pop(stack)
POPs one item from stack s.
#define string_undefined_p(s)
string basic_to_string(basic)
#define basic_compatible_p(b1, b2)
#define entity_constant_p(e)
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...
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_label_p(entity e)
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
bool entity_module_p(entity e)
bool basic_equal_p(basic, basic)
basic basic_of_call(call, bool, bool)
basic basic_of_call(call c): returns the basic of the result given by the call "c".
string type_to_string(const type)
type.c
#define test_domain
newgen_entity_domain_defined
#define expression_domain
newgen_execution_domain_defined
#define functional_result(x)
#define parameter_type(x)
#define syntax_reference(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define type_functional(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define range_increment(x)
#define instruction_domain
newgen_functional_domain_defined
#define basic_overloaded_p(x)
#define value_symbolic(x)
#define basic_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define reference_domain
newgen_range_domain_defined
#define value_symbolic_p(x)
#define functional_parameters(x)
#define PARAMETER(x)
PARAMETER.
#define reference_indices(x)
#define instruction_call_p(x)
#define type_varargs_p(x)
#define test_condition(x)
#define code_decls_text(x)
#define whileloop_domain
newgen_variable_domain_defined
#define instruction_call(x)
#define call_arguments(x)
#define whileloop_condition(x)
#define expression_syntax(x)
#define symbolic_expression(x)
#define variable_basic(x)
#define basic_logical_p(x)
#define entity_initial(x)
Value b1
booleen indiquant quel membre est en cours d'analyse
The structure used to build lists in NewGen.
context for type checking.
static void check_this_reference(reference r, type_context_p context)
#define ENTITY_EXTERNAL_P(e)
static void put_summary(string name, type_context_p context)
static void check_this_loop(loop l, type_context_p context)
static void type_this_entity_if_needed(entity, type_context_p)
static void type_this_expression(expression e, type_context_p context)
static void type_this_instruction(instruction i, type_context_p context)
bool type_checker(const string name)
#define GET_TYPE(h, e)
type of intrinsics stuff...
#define PUT_TYPE(h, e, b)
static basic type_this_call(expression exp, type_context_p context)
static void type_this_chunk(void *c, type_context_p context)
static void stmt_rwt(statement s, type_context_p context)
bool check_loop_range(range r, hash_table types)
type_checker.c
static void check_this_test(test t, type_context_p context)
static bool stmt_flt(statement s, type_context_p context)
static basic typing_arguments_of_user_function(call c, type_context_p context)
#define ENTITY_INTRINSIC_P(e)
static void check_this_whileloop(whileloop w, type_context_p context)
void typing_of_expressions(string name, statement s)
#define exp
Avoid some warnings from "gcc -Wshadow".