25 #include "pips_config.h"
61 #include "resources.h"
68 #define ABC_COUNT "ARRAY_BOUND_CHECK_COUNT"
108 retour = retour + temp;
143 retour = retour + temp;
160 string message =
" PRINT *,\'Number of bound checks:\', ARRAY_BOUND_CHECK_COUNT\n" ;
184 fprintf(stderr,
"Unstructured case: \n");
281 fprintf(stderr,
"\n Statement to be inserted before a test: ");
318 if (strstr(name,
"Bound violation") != NULL)
return true;
472 " INTEGER*8 ARRAY_BOUND_CHECK_COUNT\n"
473 " COMMON /ARRAY_BOUND_CHECK/ ARRAY_BOUND_CHECK_COUNT\n";
474 string new_decl_init =
475 " DATA ARRAY_BOUND_CHECK_COUNT /0/\n";
490 free(old_decl), old_decl = NULL;
499 debug_on(
"ARRAY_BOUND_CHECK_INSTRUMENTATION_DEBUG_LEVEL");
519 debug(1,
" Initial code array bound check instrumentation",
530 debug(1,
"PIPS code array bound check instrumentation ",
void user_log(const char *format,...)
persistant_statement_to_control make_persistant_statement_to_control(void)
basic make_basic_int(intptr_t _field_)
statement copy_statement(statement p)
STATEMENT.
reference make_reference(entity a1, list a2)
bool statement_consistent_p(statement p)
control apply_persistant_statement_to_control(persistant_statement_to_control f, statement k)
instruction make_instruction(enum instruction_utype tag, void *val)
bool bound_persistant_statement_to_control_p(persistant_statement_to_control f, statement k)
sequence make_sequence(list a)
control make_control(statement a1, list a2, list a3)
void extend_persistant_statement_to_control(persistant_statement_to_control f, statement k, control v)
void free_persistant_statement_to_control(persistant_statement_to_control p)
static statement module_statement
void const char const char const int
bool array_need_bound_check_p(entity e)
This function returns true, if the array needs bound checks false, otherwise.
static bool number_of_operators_flt(expression e, abc_number_of_operators_context_p context)
static int initial_code_abc_call(call cal)
static void initial_code_abc_statement_rwt(statement s, abc_instrumentation_context_p context)
struct abc_number_of_operators_context_t * abc_number_of_operators_context_p
bool array_bound_check_instrumentation(const char *module_name)
bool old_array_bound_check_instrumentation(const char *module_name)
static statement make_abc_count_statement(int n)
static void pop_uns(unstructured u, abc_instrumentation_context_p context)
static int number_of_logical_operators(expression e)
static bool abc_bound_violation_stop_statement_p(statement s)
statement array_bound_check_display()
array_bound_check_instrumentation.c
struct abc_instrumentation_context_t * abc_instrumentation_context_p
static bool push_uns(unstructured u, abc_instrumentation_context_p context)
static int initial_code_abc_reference(reference r)
static void pips_code_abc_statement(statement module_statement)
static int initial_code_abc_expression(expression e)
static void initial_code_abc_statement(statement module_statement)
static int number_of_scalar_variables
static void abc_instrumentation_insert_before_statement(statement s, statement s1, abc_instrumentation_context_p context)
static void pips_code_abc_statement_rwt(statement s, abc_instrumentation_context_p context)
static int number_of_array_variables
static bool store_mapping(control c, abc_instrumentation_context_p context)
struct _newgen_struct_statement_ * statement
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
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
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and 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.
#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.
bool statement_test_p(statement)
statement make_assign_statement(expression, expression)
bool return_statement_p(statement)
Test if a statement is a C or Fortran "return".
statement make_call_statement(string, list, entity, string)
This function is limited to intrinsics calls...
bool stop_statement_p(statement)
Test if a statement is a Fortran STOP.
void insert_statement(statement, statement, bool)
This is the normal entry point.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define message_assert(msg, ex)
string concatenate(const char *,...)
Return the concatenation of the given strings.
void * stack_head(const stack)
returns the item on top of stack s
int stack_size(const stack)
observers
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.
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.
void print_statement(statement)
Print a statement on stderr.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define PLUS_OPERATOR_NAME
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define binary_intrinsic_expression(name, e1, e2)
#define CONTINUE_FUNCTION_NAME
bool entity_in_list_p(entity ent, list ent_l)
look for ent in ent_l
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool local_entity_of_module_p(entity e, entity module)
This test shows that "e" has been declared in "module".
code entity_code(entity e)
bool entity_main_module_p(entity e)
expression reference_to_expression(reference r)
bool logical_operator_expression_p(expression e)
C xor is missing.
bool expression_call_p(expression e)
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression find_ith_argument(list args, int n)
bool array_reference_p(reference r)
predicates on references
bool expression_implied_do_p(e)
entity make_scalar_entity(const char *, const char *, basic)
entity make_scalar_entity(name, module_name, base)
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)
#define expression_domain
newgen_execution_domain_defined
#define unstructured_domain
newgen_type_domain_defined
#define syntax_reference(x)
#define reference_variable(x)
#define control_predecessors(x)
struct _newgen_struct_unstructured_ * unstructured
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define control_domain
newgen_controlmap_domain_defined
#define code_declarations(x)
#define CONTROL(x)
CONTROL.
#define EXPRESSION(x)
EXPRESSION.
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_sequence
#define instruction_tag(x)
#define reference_indices(x)
#define control_successors(x)
#define test_condition(x)
#define instruction_whileloop(x)
#define code_decls_text(x)
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define whileloop_condition(x)
#define expression_syntax(x)
#define type_variable_p(x)
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
context data structure for array_bound_check_instrumentation newgen recursion
persistant_statement_to_control map
The structure used to build lists in NewGen.