PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "misc.h"
#include "pipsdbm.h"
#include "resources.h"
#include "properties.h"
#include "bootstrap.h"
Go to the source code of this file.
Macros | |
#define | GET_TYPE(h, e) ((basic)hash_get(h, (char*)(e))) |
type of intrinsics stuff... More... | |
#define | PUT_TYPE(h, e, b) hash_put(h, (char*)(e), (char*)(b)) |
#define | CONCAT_OPERATOR_NAME "//" |
ENTITY It should be added in file "ri-util.h". More... | |
#define | ENTITY_CONCAT_P(e) (entity_an_operator_p(e, CONCAT)) |
#define | ENTITY_EXTERNAL_P(e) (value_code_p(entity_initial(e))) |
#define | ENTITY_INTRINSIC_P(e) (value_intrinsic_p(entity_initial(e))) |
#define | ENTITY_CONVERSION_P(e, name) (strcmp(entity_local_name(e), name##_GENERIC_CONVERSION_NAME)==0) |
#define | ENTITY_CONVERSION_CMPLX_P(e) ENTITY_CONVERSION_P(e, CMPLX) |
#define | ENTITY_CONVERSION_DCMPLX_P(e) ENTITY_CONVERSION_P(e, DCMPLX) |
#define CONCAT_OPERATOR_NAME "//" |
ENTITY It should be added in file "ri-util.h".
Definition at line 56 of file type_checker.c.
#define ENTITY_CONCAT_P | ( | e | ) | (entity_an_operator_p(e, CONCAT)) |
Definition at line 57 of file type_checker.c.
#define ENTITY_CONVERSION_CMPLX_P | ( | e | ) | ENTITY_CONVERSION_P(e, CMPLX) |
Definition at line 63 of file type_checker.c.
#define ENTITY_CONVERSION_DCMPLX_P | ( | e | ) | ENTITY_CONVERSION_P(e, DCMPLX) |
Definition at line 64 of file type_checker.c.
#define ENTITY_CONVERSION_P | ( | e, | |
name | |||
) | (strcmp(entity_local_name(e), name##_GENERIC_CONVERSION_NAME)==0) |
Definition at line 61 of file type_checker.c.
#define ENTITY_EXTERNAL_P | ( | e | ) | (value_code_p(entity_initial(e))) |
Definition at line 58 of file type_checker.c.
#define ENTITY_INTRINSIC_P | ( | e | ) | (value_intrinsic_p(entity_initial(e))) |
Definition at line 59 of file type_checker.c.
type of intrinsics stuff...
Working with hash_table of basic
Definition at line 50 of file type_checker.c.
#define PUT_TYPE | ( | h, | |
e, | |||
b | |||
) | hash_put(h, (char*)(e), (char*)(b)) |
Definition at line 51 of file type_checker.c.
bool check_loop_range | ( | range | r, |
hash_table | types | ||
) |
types | ypes |
Definition at line 292 of file type_checker.c.
Referenced by check_this_loop(), and type_this_expression().
|
static |
ok for F77, but not in F90?
Definition at line 310 of file type_checker.c.
References add_one_line_of_comment(), basic_float_p, basic_int_p, check_loop_range(), entity_basic(), entity_local_name(), loop_index, loop_range, stack_head(), context::stats, and type_loop_range().
Referenced by type_this_chunk().
|
static |
cast expressions to INT if not already an int... ?
??? maybe should update context->types ???
and simplifies!
Definition at line 391 of file type_checker.c.
References basic_int_p, EXPRESSION, free_basic(), GET_TYPE, insert_cast(), make_basic_int(), MAP, and reference_indices.
Referenced by type_this_chunk().
|
static |
Definition at line 262 of file type_checker.c.
References add_one_line_of_comment(), basic_logical_p, GET_TYPE, stack_head(), context::stats, and test_condition.
Referenced by type_this_chunk().
|
static |
Definition at line 274 of file type_checker.c.
References add_one_line_of_comment(), basic_logical_p, GET_TYPE, stack_head(), context::stats, and whileloop_condition.
Referenced by type_this_chunk().
|
static |
Definition at line 477 of file type_checker.c.
References asprintf, buf, code_decls_text, concatenate(), entity_initial, entity_module_p(), free(), get_bool_property(), local_name_to_top_level_entity(), module, pips_assert, pips_user_warning, strdup(), string_undefined_p, user_log(), and value_code.
Referenced by typing_of_expressions().
|
static |
Definition at line 410 of file type_checker.c.
References stack_push(), and context::stats.
Referenced by type_this_chunk().
|
static |
Definition at line 417 of file type_checker.c.
References pips_assert, stack_head(), stack_pop(), and context::stats.
Referenced by type_this_chunk().
Used to check the language
name | ame |
Definition at line 548 of file type_checker.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, module_name_to_entity(), pips_debug, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), and typing_of_expressions().
|
static |
Labels
Constants
User-defined functions
All intrinsics
Typing intrinsics
Simplification
lazy type entity contents...
Definition at line 148 of file type_checker.c.
References basic_of_call(), basic_to_string(), basic_undefined, call_function, copy_basic(), entity_constant_p, ENTITY_EXTERNAL_P, entity_initial, ENTITY_INTRINSIC_P, entity_label_p(), entity_local_name(), entity_name, entity_type, exp, expression_syntax, get_switch_name_function_for_intrinsic(), GET_TYPE, get_typing_function_for_intrinsic(), make_basic_overloaded(), pips_debug, symbolic_expression, syntax_call, type_this_entity_if_needed(), type_to_string(), typing_arguments_of_user_function(), value_symbolic, and value_symbolic_p.
Referenced by type_this_expression().
|
static |
Definition at line 423 of file type_checker.c.
References check_this_loop(), check_this_reference(), check_this_test(), check_this_whileloop(), expression_domain, gen_context_multi_recurse(), gen_true(), instruction_domain, loop_domain, reference_domain, statement_domain, stmt_flt(), stmt_rwt(), test_domain, type_this_expression(), type_this_instruction(), and whileloop_domain.
Referenced by type_this_entity_if_needed(), and typing_of_expressions().
|
static |
??? TODO: type->variable->dimensions->dimension->expression
type as "e = s"
Definition at line 437 of file type_checker.c.
References add_one_line_of_comment(), b1, b2, basic_compatible_p, basic_equal_p(), basic_to_string(), copy_basic(), entity_basic(), entity_initial, entity_local_name(), GET_TYPE, hash_defined_p(), insert_cast(), PUT_TYPE, stack_head(), context::stats, symbolic_expression, type_this_chunk(), value_symbolic, and value_symbolic_p.
Referenced by type_this_call().
|
static |
Specify the basic of the expression e
PDSon: For the range alone (not in loop), I only check lower, upper and step, they must be all INT, REAL or DBLE
Push the basic in hash table "types"
Definition at line 349 of file type_checker.c.
References add_one_line_of_comment(), basic_to_string(), basic_undefined, basic_undefined_p, check_loop_range(), copy_basic(), entity_basic(), entity_name, expression_syntax, is_syntax_call, is_syntax_range, is_syntax_reference, pips_debug, pips_internal_error, PUT_TYPE, reference_variable, stack_head(), context::stats, syntax_range, syntax_reference, syntax_tag, and type_this_call().
Referenced by type_this_chunk().
|
static |
type check a SUBROUTINE call.
Count the number of errors
Typing intrinsics: Assignment, control statement, IO statement
Definition at line 217 of file type_checker.c.
References add_one_line_of_comment(), b1, basic_overloaded_p, basic_to_string(), call_function, ENTITY_EXTERNAL_P, entity_local_name(), entity_name, entity_type, free_basic(), get_typing_function_for_intrinsic(), instruction_call, instruction_call_p, pips_debug, stack_head(), context::stats, type_to_string(), and typing_arguments_of_user_function().
Referenced by type_this_chunk().
|
static |
Here, parameter is always a variable
Subroutine
Function
Definition at line 75 of file type_checker.c.
References add_one_line_of_comment(), b1, basic_equal_p(), basic_to_string(), call_arguments, call_function, CAR, CDR, copy_basic(), entity_local_name(), entity_name, entity_type, EXPRESSION, functional_parameters, functional_result, gen_last(), gen_length(), GET_TYPE, make_basic_overloaded(), NIL, PARAMETER, parameter_type, params, pips_debug, stack_head(), context::stats, type_functional, type_varargs_p, type_variable, type_void_p, and variable_basic.
Referenced by type_this_call(), and type_this_instruction().
Bottom-up typing
Summary
Type checking ...
name | ame |
Definition at line 526 of file type_checker.c.
References free_basic(), HASH_MAP, hash_pointer, hash_table_free(), hash_table_make(), put_summary(), stack_free(), stack_make(), statement_domain, context::stats, and type_this_chunk().
Referenced by type_checker().