PIPS
instrumentation.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string int_to_dimension (int)
 Warning! Do not modify this file that is automatically generated! More...
 
bool array_need_bound_check_p (entity)
 This function returns true, if the array needs bound checks false, otherwise. More...
 
expression subscript_value (entity, list)
 
string print_variables (expression)
 
statement emit_message_and_stop (string)
 
bool array_bound_check_bottom_up (const char *)
 
string bool_to_bound (bool)
 array_bound_check_top_down.c More...
 
bool array_bound_check_top_down (const char *)
 
statement array_bound_check_display (void)
 array_bound_check_instrumentation.c More...
 
bool old_array_bound_check_instrumentation (const char *)
 
bool array_bound_check_instrumentation (const char *)
 
bool array_bound_check_interprocedural (const char *)
 array_bound_check_interprocedural.c More...
 
expression translate_to_module_frame (entity, entity, expression, call)
 alias_propagation.c More...
 
bool alias_propagation (char *)
 
expression simplify_relational_expression (expression)
 alias_check.c More...
 
bool included_call_chain_p (list, list)
 
void print_alias_association (alias_association)
 
void print_list_of_alias_associations (list)
 
bool functional_call_p (call)
 This function returns true if c is an user-defined function/subroutine. More...
 
bool alias_check (char *)
 
bool used_before_set (const char *)
 used_before_set.c More...
 
bool add_control_counters (const string)
 control_counters.c More...
 

Function Documentation

◆ add_control_counters()

bool add_control_counters ( const string  module_name)

control_counters.c

control_counters.c

Parameters
module_nameodule_name

Definition at line 137 of file control_counters.c.

138 {
139  // get resources from database
141  statement stat =
142  (statement) db_get_memory_resource(DBR_CODE, module_name, true);
143 
146 
147  // do the job
148  add_counters(module, stat);
149 
150  // reset unique identifier for each statement
151  module_reorder(stat);
152 
153  // update resource
154  DB_PUT_MEMORY_RESOURCE(DBR_CODE, module_name, stat);
155 
156  // cleanup
159  return true;
160 }
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
static void add_counters(entity module, statement root)
add control counter instrumentation assumes current module entity & statement are okay.
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
static char * module
Definition: pips.c:74
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
Definition: reorder.c:244
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479

References add_counters(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, module, module_name(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), and set_current_module_statement().

+ Here is the call graph for this function:

◆ alias_check()

bool alias_check ( char *  module_name)

File instrument.out is used to store alias checks and flags

We do not add the line "INCLUDE alias_flags.h" into code_decls_text because of repeated bug for module with ENTRY. 09/11/2001 : do not add INCLUDE any more, because there are modules that do not need this INCLUDE => use script: if a module is modified => add INCLUDE line fprintf(out, "AC: %s (%d,%d)\n",module_local_name(current_mod),0,1); fprintf(out," INCLUDE 'alias_flags.h'\n"); fprintf(out, "ACEND \n");

if the list of alias associations of module is NIL, do nothing

Compute the list of direct and indirect callees of current module

Get the proper and cumulated effects of the module, we have to take both kinds of effects because of their difference for an elementary statement: V(I) = I => cumulated effect : <may be written> V(*) => proper effect : <must be written> V(I) If a cumulated effect for elementary statements = proper effect => we need only cumulated effect

Looking for another formal variable in the list of alias associations that has same section and included call path. If this variable is checked dynamically with e1 => no need to continue

Looking for common variables in module or callee of modules to check for alias violation ...

For this moment, only for common variable of module ========> add for chain of callees

Check for write on common variables in callee, keep call path also => to insert test

formal parameter has a same section with other common variable

If u1 is defined (different to -1) and u1<l2, there is no alias violation The same for: l1 is defined (different to -1) and u2<l1

The common variable always have a good offset off2

Parameters
module_nameodule_name

Definition at line 1994 of file alias_check.c.

1995 {
1996  /* File instrument.out is used to store alias checks and flags*/
1997  string dir_name = db_get_current_workspace_directory();
1998  string instrument_file = strdup(concatenate(dir_name, "/instrument.out", NULL));
1999  free(dir_name), dir_name = NULL;
2000  out = safe_fopen(instrument_file, "a");
2003  /* We do not add the line "INCLUDE alias_flags.h" into code_decls_text because of
2004  repeated bug for module with ENTRY.
2005  09/11/2001 : do not add INCLUDE any more, because there are modules that do not
2006  need this INCLUDE => use script: if a module is modified => add INCLUDE line
2007  fprintf(out, "AC: %s (%d,%d)\n",module_local_name(current_mod),0,1);
2008  fprintf(out," INCLUDE 'alias_flags.h'\n");
2009  fprintf(out, "ACEND \n");*/
2010  debug_on("ALIAS_CHECK_DEBUG_LEVEL");
2011  ifdebug(1)
2012  fprintf(stderr, " \n Begin alias_check for %s \n", module_name);
2014  db_get_memory_resource(DBR_ALIAS_ASSOCIATIONS,module_name,true));
2015  /* if the list of alias associations of module is NIL, do nothing*/
2016  if (l_module_aliases != NIL)
2017  {
2018  /* Compute the list of direct and indirect callees of current module */
2019  // list l_callees = compute_all_callees(current_mod);
2020  string alias_flag_name = strdup(concatenate(TOP_LEVEL_MODULE_NAME,
2022  string alias_function_name = strdup(concatenate(TOP_LEVEL_MODULE_NAME,
2024  alias_flag = gen_find_tabulated(alias_flag_name,entity_domain);
2026  alias_flag = make_entity(alias_flag_name,
2030  alias_function = gen_find_tabulated(alias_function_name,entity_domain);
2034  ifdebug(2)
2035  {
2036  fprintf(stderr, " \n The list of alias associations for module %s is:\n", module_name);
2038  }
2041  /* Get the proper and cumulated effects of the module, we have to take both kinds of
2042  effects because of their difference for an elementary statement:
2043  V(I) = I => cumulated effect : <may be written> V(*)
2044  => proper effect : <must be written> V(I)
2045  If a cumulated effect for elementary statements = proper effect => we need only
2046  cumulated effect */
2048  db_get_memory_resource(DBR_CUMULATED_EFFECTS,module_name,true));
2050  db_get_memory_resource(DBR_PROPER_EFFECTS,module_name,true));
2052  while (!ENDP(l_module_aliases))
2053  {
2056  entity sec1 = alias_association_section(aa1);
2057  list path1 = alias_association_call_chain(aa1);
2059  int l1 = alias_association_lower_offset(aa1);
2060  int u1 = alias_association_upper_offset(aa1);
2062 
2063  /* Looking for another formal variable in the list of alias
2064  associations that has same section and included call path.
2065  If this variable is checked dynamically with e1 => no need
2066  to continue */
2067 
2068  MAP(ALIAS_ASSOCIATION, aa2,
2069  {
2071  entity sec2 = alias_association_section(aa2);
2072  list path2 = alias_association_call_chain(aa2);
2073  if (!same_entity_p(e1,e2) && same_entity_p(sec1,sec2) &&
2074  !dynamic_checked_p(e1,e2)&& included_call_chain_p(path1,path2))
2075  {
2076  int l2 = alias_association_lower_offset(aa2);
2077  int u2 = alias_association_upper_offset(aa2);
2078  /*
2079  Special cases : no alias u1 < l2, u2 <l1, u1< o1, u2 < o1,
2080  o2 + s2 < l1, o1 + s1 < l2
2081  So easiest case: If u1,l2 are defined (different to -1) and u1<l2,
2082  there is no alias violation
2083  The same for: u2,l1 are defined (different to -1) and u2<l1*/
2084  if (((u1==-1)||(u1>=l2))&&((u2==-1)||(u2>=l1)))
2085  {
2087  ifdebug(2)
2088  fprintf(stderr, "\nFound two may be aliased formal parameters: %s, %s. Let's check !\n",
2089  entity_name(e1),entity_name(e2));
2090  if (gen_length(path1) < gen_length(path2))
2091  alias_check_two_variables(e1,e2,off1,off2,path2);
2092  else
2093  alias_check_two_variables(e1,e2,off1,off2,path1);
2094  }
2095  }
2096  },
2097  l_module_aliases);
2098 
2099  /* Looking for common variables in module or callee of modules
2100  to check for alias violation ...*/
2101 
2102  /* For this moment, only for common variable of module
2103  ========> add for chain of callees
2104 
2105  Check for write on common variables in callee, keep call path also
2106  => to insert test*/
2107 
2108  MAP(ENTITY, e2,
2109  {
2110  if (variable_in_common_p(e2))
2111  {
2112  ram ra = storage_ram(entity_storage(e2));
2113  entity sec2 = ram_section(ra);
2114  if (!dynamic_checked_p(e1,e2) && same_entity_p(sec1,sec2))
2115  {
2116  /* formal parameter has a same section with other common variable*/
2117  int l2 = ram_offset(ra);
2118  int u2 = l2;
2119  if (array_entity_p(e2))
2120  {
2121  int tmp;
2122  if (SizeOfArray(e2,&tmp))
2124  else
2125  user_log("Varying size of common variable");
2126  }
2127  /* If u1 is defined (different to -1) and u1<l2, there is no alias violation
2128  The same for: l1 is defined (different to -1) and u2<l1*/
2129  if (((u1==-1)||(u1>=l2))&&(u2>=l1))
2130  {
2131  expression off2 = int_to_expression(l2);
2132  /* The common variable always have a good offset off2 */
2133  ifdebug(2)
2134  fprintf(stderr,"\n Found may be aliased formal and common variable :%s, %s. Let's check ! \n",
2135  entity_name(e1), entity_name(e2));
2136  alias_check_two_variables(e1,e2,off1,off2,path1);
2137  }
2138  }
2139  }
2140  },
2142  }
2143  l_dynamic_check = NIL;
2150  // free(alias_flag_name), alias_flag_name = NULL;
2151  // free(alias_function_name), alias_function_name = NULL;
2152  }
2153  else
2154  user_log("\n No alias for this module \n");
2155 
2156  safe_fclose(out,instrument_file);
2157  free(instrument_file), instrument_file= NULL;
2159  pips_debug(1, "end\n");
2160  debug_off();
2163  return true;
2164 }
void user_log(const char *format,...)
Definition: message.c:234
language copy_language(language p)
LANGUAGE.
Definition: ri.c:1202
variable make_variable(basic a1, list a2, list a3)
Definition: ri.c:2895
basic make_basic_logical(intptr_t _field_)
Definition: ri.c:164
type make_type(enum type_utype tag, void *val)
Definition: ri.c:2706
static FILE * out
Definition: alias_check.c:128
bool alias_check(char *module_name)
Definition: alias_check.c:1994
static void initialize_dynamic_check_list()
Definition: alias_check.c:175
static void display_alias_check_statistics()
Definition: alias_check.c:167
static bool dynamic_checked_p(entity e1, entity e2)
Definition: alias_check.c:209
bool included_call_chain_p(list l1, list l2)
Definition: alias_check.c:246
static entity alias_flag
Definition: alias_check.c:129
#define ALIAS_FLAG
Definition: alias_check.c:104
static entity alias_function
Definition: alias_check.c:130
static int number_of_processed_modules
Definition: alias_check.c:136
static statement module_statement
Definition: alias_check.c:125
#define ALIAS_FUNCTION
Definition: alias_check.c:105
static void alias_check_two_variables(entity e1, entity e2, expression off1, expression off2, list path)
Definition: alias_check.c:1918
static list l_module_aliases
Definition: alias_check.c:124
void print_list_of_alias_associations(list l)
Definition: alias_check.c:324
static list l_dynamic_check
This list tells us if two variables have been checked dynamically or not.
Definition: alias_check.c:132
static entity current_mod
Definition: alias_check.c:120
#define alias_associations_list(x)
Definition: alias_private.h:86
#define alias_association_lower_offset(x)
#define alias_association_upper_offset(x)
#define alias_association_section(x)
#define alias_association_variable(x)
#define ALIAS_ASSOCIATION(x)
ALIAS_ASSOCIATION.
Definition: alias_private.h:90
#define alias_association_call_chain(x)
#define alias_association_offset(x)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
if(!(yy_init))
Definition: genread_lex.c:1029
void free(void *)
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
char end
Definition: gtk_status.c:82
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define debug_off()
Definition: misc-local.h:160
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
#define true
Definition: newgen_types.h:81
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...
Definition: ordering.c:172
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
#define make_entity(n, t, s, i)
#define module_language(e)
implemented as a macro to allow lhs
bool array_entity_p(entity e)
Definition: entity.c:793
bool same_entity_p(entity e1, entity e2)
predicates on entities
Definition: entity.c:1321
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
code entity_code(entity e)
Definition: entity.c:1098
entity make_empty_subroutine(const char *name, language l)
Definition: entity.c:268
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
Definition: size.c:87
bool variable_in_common_p(entity)
true if v is in a common.
Definition: variable.c:1570
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
Definition: size.c:297
#define value_undefined
Definition: ri.h:3016
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
#define code_declarations(x)
Definition: ri.h:784
#define ram_section(x)
Definition: ri.h:2249
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define entity_name(x)
Definition: ri.h:2790
#define storage_ram(x)
Definition: ri.h:2521
@ is_type_variable
Definition: ri.h:2900
#define entity_type(x)
Definition: ri.h:2792
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define variable_basic(x)
Definition: ri.h:3120
#define statement_undefined
Definition: ri.h:2419
#define ram_offset(x)
Definition: ri.h:2251
#define storage_undefined
Definition: ri.h:2476
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
else
Definition: set.c:239
return(s1)
#define ifdebug(n)
Definition: sg.c:47
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References ALIAS_ASSOCIATION, alias_association_call_chain, alias_association_lower_offset, alias_association_offset, alias_association_section, alias_association_upper_offset, alias_association_variable, alias_associations_list, alias_check_two_variables(), ALIAS_FLAG, alias_flag, ALIAS_FUNCTION, alias_function, array_entity_p(), CAR, CDR, code_declarations, concatenate(), copy_language(), current_mod, db_get_current_workspace_directory(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, display_alias_check_statistics(), dynamic_checked_p(), ENDP, ENTITY, entity_code(), entity_domain, entity_name, entity_storage, entity_type, entity_undefined, entity_undefined_p, fprintf(), free(), gen_find_tabulated(), gen_length(), ifdebug, included_call_chain_p(), initialize_dynamic_check_list(), int_to_expression(), is_type_variable, l_dynamic_check, l_module_aliases, local_name_to_top_level_entity(), make_basic_logical(), make_empty_subroutine(), make_entity, make_type(), make_variable(), MAP, module_language, module_name(), MODULE_SEP_STRING, module_statement, NIL, number_of_processed_modules, out, pips_debug, print_list_of_alias_associations(), ram_offset, ram_section, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_ordering_to_statement(), reset_proper_rw_effects(), safe_fclose(), safe_fopen(), same_entity_p(), set_cumulated_rw_effects(), set_current_module_entity(), set_ordering_to_statement(), set_proper_rw_effects(), SizeOfArray(), SizeOfElements(), statement_undefined, storage_ram, storage_undefined, strdup(), TOP_LEVEL_MODULE_NAME, type_variable, user_log(), value_undefined, variable_basic, and variable_in_common_p().

+ Here is the call graph for this function:

◆ alias_propagation()

bool alias_propagation ( char *  module_name)

No alias for main program

If the current module is never called by the main program => don't need to compute aliases for this module

search for formal parameters in the declaration list

if there is no formal parameter, do nothing

Take the list of callers, if there is no caller, do nothing

The module has no caller => don't need to compute aliases for this module

save to resource

Parameters
module_nameodule_name

Definition at line 903 of file alias_propagation.c.

904 {
905  list l_aliases = NIL;
908  // number_of_alias_associations = 0;
910  debug_on("ALIAS_PROPAGATION_DEBUG_LEVEL");
911  pips_debug(1,"\nBegin alias propagation for module %s \n", module_name);
912  /* No alias for main program*/
914  {
915  if (get_bool_property("ALIAS_CHECKING_USING_MAIN_PROGRAM") &&
917  /* If the current module is never called by the main program =>
918  don't need to compute aliases for this module*/
919  pips_user_warning("Module %s is not called by the main program \n",module_name);
920  else
921  {
923  list l_formals = NIL;
924  /* search for formal parameters in the declaration list */
925  MAP(ENTITY, e,
926  {
927  if (formal_parameter_p(e))
928  l_formals = gen_nconc(l_formals,CONS(ENTITY,e,NIL));
929  },l_decls);
930  /* if there is no formal parameter, do nothing */
931  if (l_formals != NIL)
932  {
933  /* Take the list of callers, if there is no caller, do nothing */
934  callees callers = (callees) db_get_memory_resource(DBR_CALLERS,module_name,true);
935  list l_callers = callees_callees(callers);
936  if (l_callers != NIL)
937  {
938  ifdebug(2)
939  {
940  fprintf(stderr,"The list of formal parameters:");
941  print_entities(l_formals);
942  fprintf(stderr,"\nThe list of callers: ");
944  (void) fprintf(stderr, "%s, ", caller_name);
945  }, l_callers);
946  (void) fprintf(stderr, "\n");
947  }
948  l_aliases = alias_propagation_callers(l_callers);
949  }
950  else
951  /* The module has no caller => don't need to compute aliases for this module*/
952  pips_user_warning("\n Module %s has no caller \n",module_name );
953  }
954  }
955  }
956  /* save to resource */
957  DB_PUT_MEMORY_RESOURCE(DBR_ALIAS_ASSOCIATIONS,module_name,make_alias_associations(l_aliases));
961  debug_off();
962  return true;
963 }
alias_associations make_alias_associations(list a)
Definition: alias_private.c:52
static void display_alias_propagation_statistics()
Special alias section counter.
static int number_of_processed_modules
static list alias_propagation_callers(list l_callers)
static entity current_mod
Define a static stack and related functions to remember the current statement.
static const char * caller_name
bool module_is_called_by_main_program_p(entity mod)
Definition: callgraph.c:103
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define STRING(x)
Definition: genC.h:87
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define pips_user_warning
Definition: misc-local.h:146
bool entity_main_module_p(entity e)
Definition: entity.c:700
void print_entities(list l)
Definition: entity.c:167
bool formal_parameter_p(entity)
Definition: variable.c:1489
struct _newgen_struct_callees_ * callees
Definition: ri.h:55
#define callees_callees(x)
Definition: ri.h:675

References alias_propagation_callers(), callees_callees, caller_name, code_declarations, CONS, current_mod, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, display_alias_propagation_statistics(), ENTITY, entity_code(), entity_main_module_p(), entity_undefined, formal_parameter_p(), fprintf(), gen_nconc(), get_bool_property(), ifdebug, local_name_to_top_level_entity(), make_alias_associations(), MAP, module_is_called_by_main_program_p(), module_name(), NIL, number_of_processed_modules, pips_debug, pips_user_warning, print_entities(), reset_current_module_entity(), set_current_module_entity(), and STRING.

+ Here is the call graph for this function:

◆ array_bound_check_bottom_up()

bool array_bound_check_bottom_up ( const char *  module_name)

Begin the dynamic array bound checking phase. Get the code from dbm (true resource)

Reorder the module, because the bound checks have been added

Parameters
module_nameodule_name

Definition at line 1093 of file array_bound_check_bottom_up.c.

1094 {
1097  /* Begin the dynamic array bound checking phase.
1098  * Get the code from dbm (true resource) */
1102  debug_on("ARRAY_BOUND_CHECK_BOTTOM_UP_DEBUG_LEVEL");
1103  ifdebug(1)
1104  {
1105  debug(1, "Array bound check","Begin for %s\n", module_name);
1106  pips_assert("Statement is consistent ...", statement_consistent_p(module_statement));
1107  }
1111  /* Reorder the module, because the bound checks have been added */
1113  ifdebug(1)
1114  {
1115  pips_assert("Statement is consistent ...", statement_consistent_p(module_statement));
1116  debug(1, "array bound check","End for %s\n", module_name);
1117  }
1118  debug_off();
1123  return true;
1124 }
bool statement_consistent_p(statement p)
Definition: ri.c:2195
static void initialize_bottom_up_abc_statistics()
static void display_bottom_up_abc_statistics()
static void bottom_up_abc_statement(statement module_statement)
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189

References bottom_up_abc_statement(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug(), debug_off, debug_on, display_bottom_up_abc_statistics(), ifdebug, initialize_bottom_up_abc_statistics(), local_name_to_top_level_entity(), module_name(), module_reorder(), module_statement, pips_assert, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), and statement_consistent_p().

+ Here is the call graph for this function:

◆ array_bound_check_display()

statement array_bound_check_display ( void  )

array_bound_check_instrumentation.c

Attention : no strdup => newgen error

Definition at line 158 of file array_bound_check_instrumentation.c.

159 {
160  string message = " PRINT *,\'Number of bound checks:\', ARRAY_BOUND_CHECK_COUNT\n" ;
161  /* Attention : no strdup => newgen error */
162  // statement retour = make_call_statement(CONTINUE_FUNCTION_NAME,
163  // NIL,entity_undefined,message);
166 }
statement make_call_statement(string, list, entity, string)
This function is limited to intrinsics calls...
Definition: statement.c:1274
#define CONTINUE_FUNCTION_NAME

References CONTINUE_FUNCTION_NAME, entity_undefined, make_call_statement(), NIL, and strdup().

Referenced by initial_code_abc_statement_rwt(), and pips_code_abc_statement_rwt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_bound_check_instrumentation()

bool array_bound_check_instrumentation ( const char *  module_name)

ser_log("*\n%d variable in %s *\n",gen_length(l),entity_name(sec)); number_of_variables = number_of_variables + gen_length(l);

Eliminate 4 special variables : MAIN000:DYNAMIC, MAIN000:STATIC,MAIN000:HEAP, MAIN000:STACK

Parameters
module_nameodule_name

Definition at line 557 of file array_bound_check_instrumentation.c.

558 {
561  MAP(ENTITY,ent,
562  {
563  if (!formal_parameter_p(ent))
564  {
565  if (variable_in_common_p(ent))
566  {
568  if (!entity_in_list_p(sec,l_commons))
569  {
570  area a = type_area(entity_type(sec));
571  list l = area_layout(a);
572  /*user_log("*\n%d variable in %s *\n",gen_length(l),entity_name(sec));
573  number_of_variables = number_of_variables + gen_length(l);*/
574  MAP(ENTITY, e,
575  {
576  type t = entity_type(e);
577  if (type_variable_p(t))
578  {
579  if (entity_scalar_p(e))
580  {
581  user_log("*\nCommon and scalar variable %s *\n",entity_name(e));
583  }
584  else
585  {
586  user_log("*\nCommon and array variable %s *\n",entity_name(e));
588  }
589  }
590  },l);
592  }
593  }
594  else
595  {
596  if (local_entity_of_module_p(ent,mod))
597  {
598  type t = entity_type(ent);
599  user_log("*\nLocal variable %s of type %d *\n",entity_name(ent),type_tag(t));
600  if (type_variable_p(t))
601  {
602  if (entity_scalar_p(ent))
603  {
604  user_log("*\nLocal and scalar variable %s *\n",entity_name(ent));
606  }
607  else
608  {
609  user_log("*\nLocal and array variable %s *\n",entity_name(ent));
611  }
612  }
613  }
614  }
615  }
616  },d);
617  /* Eliminate 4 special variables : MAIN000:*DYNAMIC*, MAIN000:*STATIC*,MAIN000:*HEAP*, MAIN000:*STACK* **/
618  user_log("*\nNumber of scalar variables :%d *\n", number_of_scalar_variables);
619  user_log("*\nNumber of array variables :%d *\n", number_of_array_variables);
620  return true;
621 }
static list l_commons
static int number_of_scalar_variables
static int number_of_array_variables
bool entity_in_list_p(entity ent, list ent_l)
look for ent in ent_l
Definition: entity.c:2221
bool local_entity_of_module_p(entity e, entity module)
This test shows that "e" has been declared in "module".
Definition: entity.c:1069
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define type_tag(x)
Definition: ri.h:2940
#define area_layout(x)
Definition: ri.h:546
#define value_code(x)
Definition: ri.h:3067
#define type_area(x)
Definition: ri.h:2946
#define type_variable_p(x)
Definition: ri.h:2947
#define entity_initial(x)
Definition: ri.h:2796

References area_layout, code_declarations, CONS, ENTITY, entity_in_list_p(), entity_initial, entity_name, entity_scalar_p(), entity_storage, entity_type, formal_parameter_p(), gen_nconc(), l_commons, local_entity_of_module_p(), local_name_to_top_level_entity(), MAP, module_name(), NIL, number_of_array_variables, number_of_scalar_variables, ram_section, storage_ram, type_area, type_tag, type_variable_p, user_log(), value_code, and variable_in_common_p().

+ Here is the call graph for this function:

◆ array_bound_check_interprocedural()

bool array_bound_check_interprocedural ( const char *  module_name)

array_bound_check_interprocedural.c

s bound checks are added

Parameters
module_nameodule_name

Definition at line 749 of file array_bound_check_interprocedural.c.

750 {
755  db_get_memory_resource(DBR_PRECONDITIONS,module_name,true));
757  debug_on("ARRAY_BOUND_CHECK_INTERPROCEDURAL_DEBUG_LEVEL");
758  ifdebug(1)
759  {
760  debug(1, "Interprocedural array bound check","Begin for %s\n", module_name);
761  pips_assert("Statement is consistent ...", statement_consistent_p(module_statement));
762  }
766  user_log("* The total number of added tests is %d *\n",
768  user_log("* The total number of bound violation is %d *\n",
770  module_reorder(module_statement); /*as bound checks are added*/
771  ifdebug(1)
772  {
773  pips_assert("Statement is consistent ...", statement_consistent_p(module_statement));
774  debug(1, "Interprocedural array bound check","End for %s\n", module_name);
775  }
776  debug_off();
781  return true;
782 }
static void display_interprocedural_abc_statistics()
static int total_number_of_bound_violations
static void initialize_interprocedural_abc_statistics()
static void interprocedural_abc_statement(statement module_statement)
static int total_number_of_added_tests
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)

References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug(), debug_off, debug_on, display_interprocedural_abc_statistics(), ifdebug, initialize_interprocedural_abc_statistics(), interprocedural_abc_statement(), local_name_to_top_level_entity(), module_name(), module_reorder(), module_statement, pips_assert, reset_current_module_entity(), reset_ordering_to_statement(), reset_precondition_map(), set_current_module_entity(), set_ordering_to_statement(), set_precondition_map(), statement_consistent_p(), total_number_of_added_tests, total_number_of_bound_violations, and user_log().

+ Here is the call graph for this function:

◆ array_bound_check_top_down()

bool array_bound_check_top_down ( const char *  module_name)

set and get the current properties concerning regions

Get the code of the module.

Get the READ and WRITE regions of the module

Reorder the module, because the bound checks have been added

Parameters
module_nameodule_name

Definition at line 1129 of file array_bound_check_top_down.c.

1130 {
1134  "MUST_REGIONS"))
1135  pips_user_warning("\n MUST REGIONS not selected - "
1136  "\n Do not expect wonderful results\n");
1137  /* set and get the current properties concerning regions */
1138  set_bool_property("MUST_REGIONS", true);
1139  set_bool_property("EXACT_REGIONS", true);
1141  /* Get the code of the module. */
1143  module_name,
1144  true);
1147  /* Get the READ and WRITE regions of the module */
1149  db_get_memory_resource(DBR_REGIONS, module_name, true));
1151  db_get_memory_resource(DBR_PROPER_EFFECTS,
1152  module_name,true));
1153  debug_on("ARRAY_BOUND_CHECK_TOP_DOWN_DEBUG_LEVEL");
1154  pips_debug(1, " Region based ABC, Begin for %s\n", module_name);
1155  pips_assert("Statement is consistent ...",
1160  /* Reorder the module, because the bound checks have been added */
1162  pips_debug(1, "end\n");
1163  debug_off();
1169  reset_rw_effects();
1170  return true;
1171 }
static void display_top_down_abc_statistics()
static void top_down_abc_statement(statement module_statement)
static void initialize_top_down_abc_statistics()
void get_regions_properties(void)
void set_rw_effects(statement_effects)
void reset_rw_effects(void)
#define rule_phase(x)
Definition: makefile.h:244
#define same_string_p(s1, s2)
rule find_rule_by_resource(const char *rname)
This function returns the active rule to produce resource rname.
Definition: pipsmake.c:694
void set_bool_property(const char *, bool)

References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, display_top_down_abc_statistics(), find_rule_by_resource(), get_regions_properties(), initialize_top_down_abc_statistics(), local_name_to_top_level_entity(), module_name(), module_reorder(), module_statement, pips_assert, pips_debug, pips_user_warning, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_rw_effects(), reset_rw_effects(), rule_phase, same_string_p, set_bool_property(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_rw_effects(), set_rw_effects(), statement_consistent_p(), and top_down_abc_statement().

+ Here is the call graph for this function:

◆ array_need_bound_check_p()

bool array_need_bound_check_p ( entity  e)

This function returns true, if the array needs bound checks false, otherwise.

If the arrays are not created by user, for example the arrays of Logical Units : LUNS, END_LUNS, ERR_LUNS, ... in the IO_EFFECTS_PACKAGE_NAME, we don't have to check array references for those arrays. Maybe we have to add other kinds of arrays, not only those in IO_EFFECTS

Definition at line 196 of file array_bound_check_bottom_up.c.

197 {
198  const char* s = entity_module_name(e);
199  if (strcmp(s,IO_EFFECTS_PACKAGE_NAME)==0)
200  return false;
201  return true;
202 }
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092

References entity_module_name(), and IO_EFFECTS_PACKAGE_NAME.

Referenced by bottom_up_abc_reference(), bottom_up_abc_reference_implied_do(), initial_code_abc_reference(), and top_down_abc_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bool_to_bound()

string bool_to_bound ( bool  b)

array_bound_check_top_down.c

Definition at line 115 of file array_bound_check_top_down.c.

116 {
117  if (b)
118  return ", lower bound, ";
119  return ", upper bound, ";
120 }

Referenced by make_bottom_up_abc_tests(), and top_down_abc_array().

+ Here is the caller graph for this function:

◆ emit_message_and_stop()

statement emit_message_and_stop ( string  stop_message)

Must be the C version

Parameters
stop_messagetop_message

Definition at line 837 of file array_bound_check_bottom_up.c.

838 {
840 
842  //return make_stop_statement(message);
843  smt = make_stop_statement(stop_message);
844  }
845  else {
846  /* Must be the C version */
847  smt = make_exit_statement(1, stop_message);
848  }
849  return smt;
850 }
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
statement make_stop_statement(string)
This function returns a Fortran stop statement with an error message.
Definition: statement.c:908
statement make_exit_statement(int, string)
This function returns a statement ending with a C exit statement.
Definition: statement.c:926
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799

References fortran_module_p(), get_current_module_entity(), make_exit_statement(), make_stop_statement(), and statement_undefined.

Referenced by make_bottom_up_abc_tests(), and make_c_stop_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ functional_call_p()

bool functional_call_p ( call  c)

This function returns true if c is an user-defined function/subroutine.

Definition at line 506 of file alias_check.c.

507 {
508  entity fun = call_function(c);
509  return entity_module_p(fun);
510 }
bool entity_module_p(entity e)
Definition: entity.c:683
#define call_function(x)
Definition: ri.h:709

References call_function, and entity_module_p().

Referenced by variable_is_written_by_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ included_call_chain_p()

bool included_call_chain_p ( list  l1,
list  l2 
)
Parameters
l11
l22

Definition at line 246 of file alias_check.c.

247 {
248  while (!ENDP(l1) && !ENDP(l2))
249  {
250  call_site cs1 = CALL_SITE(CAR(l1));
251  call_site cs2 = CALL_SITE(CAR(l2));
252  if (!same_call_site_p(cs1,cs2)) return false;
253  l1 = CDR(l1);
254  l2 = CDR(l2);
255  }
256  return true;
257 }
static bool same_call_site_p(call_site cs1, call_site cs2)
Definition: alias_check.c:228
#define CALL_SITE(x)
CALL_SITE.

References CALL_SITE, CAR, CDR, ENDP, and same_call_site_p().

Referenced by alias_check(), same_section_formal_variable_in_list_p(), and tail_call_path_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int_to_dimension()

string int_to_dimension ( int  i)

Warning! Do not modify this file that is automatically generated!

Modify src/Libs/instrumentation/instrumentation-local.h instead, to add your own modifications. header file built by cproto instrumentation-local.h cproto-generated files array_bound_check_bottom_up.c

Definition at line 162 of file array_bound_check_bottom_up.c.

163 {
164  switch(i)
165  {
166  case 0 :
167  return "wrt common size";
168  case 1 :
169  return "1st dimension";
170  case 2 :
171  return "2nd dimension";
172  case 3 :
173  return "3rd dimension";
174  case 4 :
175  return "4th dimension";
176  case 5 :
177  return "5th dimension";
178  case 6 :
179  return "6th dimension";
180  case 7 :
181  return "7th dimension";
182  default:
183  return "Over 7!!!";
184  }
185 }

Referenced by make_bottom_up_abc_tests(), and top_down_abc_array().

+ Here is the caller graph for this function:

◆ old_array_bound_check_instrumentation()

bool old_array_bound_check_instrumentation ( const char *  module_name)

add COMMON ARRAY_BOUND_CHECK_COUNT to the declaration if main program : DATA ARRAY_BOUND_CHECK_COUNT 0

Begin the array bound check instrumentation phase. Get the code from dbm (true resource)

Before running the array_bound_check phase, for the implied-DO expression (in statement READ, WRITE of Fortran), we will create new Pips' loops before the READ/WRITE statement, it means that instead of checking array references for implied-DO statement (which is not true if we do it like other statements), we will check array references in new loops added

Reorder the module, because new loops have been added

Reorder the module, because new statements have been added

Parameters
module_nameodule_name

Definition at line 466 of file array_bound_check_instrumentation.c.

467 {
469  /* add COMMON ARRAY_BOUND_CHECK_COUNT to the declaration
470  if main program : DATA ARRAY_BOUND_CHECK_COUNT 0*/
471  string new_decl =
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";
476  string old_decl;
477  basic b = make_basic_int(8);
481  old_decl = code_decls_text(entity_code(mod_ent));
482  // user_log("Old declaration = %s\n", code_decls_text(entity_code(mod_ent)));
484  // MAIN PROGRAM
486  = strdup(concatenate(old_decl, new_decl, new_decl_init,NULL));
487  else
489  = strdup(concatenate(old_decl, new_decl, NULL));
490  free(old_decl), old_decl = NULL;
491  // user_log("New declaration = %s\n", code_decls_text(entity_code(mod_ent)));
492  // fprintf(stderr, "NEW = %s\n", code_decls_text(entity_code(mod_ent)));
493  /* Begin the array bound check instrumentation phase.
494  * Get the code from dbm (true resource) */
496  db_get_memory_resource(DBR_CODE, module_name, true);
499  debug_on("ARRAY_BOUND_CHECK_INSTRUMENTATION_DEBUG_LEVEL");
500  if (get_bool_property("INITIAL_CODE_ARRAY_BOUND_CHECK_INSTRUMENTATION"))
501  {
502  // instrument the initial code
503  // Rewrite Implied_DO code
504 
505  /* Before running the array_bound_check phase,
506  * for the implied-DO expression (in statement
507  * READ, WRITE of Fortran), we will create new Pips' loops
508  * before the READ/WRITE statement,
509  * it means that instead of checking array references
510  * for implied-DO statement (which is not
511  * true if we do it like other statements), we will check
512  * array references in new loops added*/
513 
514  // rewrite_implied_do(module_statement);
515  /* Reorder the module, because new loops have been added */
516  // module_reorder(module_statement);
517  ifdebug(1)
518  {
519  debug(1, " Initial code array bound check instrumentation",
520  "Begin for %s\n", module_name);
521  pips_assert("Statement is consistent ...",
523  }
525  }
526  if (get_bool_property("PIPS_CODE_ARRAY_BOUND_CHECK_INSTRUMENTATION"))
527  {
528  ifdebug(1)
529  {
530  debug(1, "PIPS code array bound check instrumentation ",
531  "Begin for %s\n", module_name);
532  pips_assert("Statement is consistent ...",
534  }
535 
537  }
538  /* Reorder the module, because new statements have been added */
540  ifdebug(1)
541  {
542  pips_assert("Statement is consistent ...",
544  debug(1, "Array bound check instrumentation","End for %s\n", module_name);
545  }
546  debug_off();
551  return true;
552 }
basic make_basic_int(intptr_t _field_)
Definition: ri.c:158
static entity abccount
static void pips_code_abc_statement(statement module_statement)
static entity mod_ent
static void initial_code_abc_statement(statement module_statement)
entity make_scalar_entity(const char *, const char *, basic)
entity make_scalar_entity(name, module_name, base)
Definition: variable.c:331
#define code_decls_text(x)
Definition: ri.h:786

References ABC_COUNT, abccount, code_decls_text, concatenate(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug(), debug_off, debug_on, entity_code(), entity_main_module_p(), free(), get_bool_property(), get_current_module_entity(), ifdebug, initial_code_abc_statement(), local_name_to_top_level_entity(), make_basic_int(), make_scalar_entity(), mod_ent, module_name(), module_reorder(), module_statement, pips_assert, pips_code_abc_statement(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), statement_consistent_p(), and strdup().

+ Here is the call graph for this function:

◆ print_alias_association()

void print_alias_association ( alias_association  aa)
Parameters
aaa

Definition at line 301 of file alias_check.c.

302 {
307  int l = alias_association_lower_offset(aa);
308  int u = alias_association_upper_offset(aa);
309  fprintf(stderr,"\n Alias association :");
310  fprintf(stderr,"\n Formal variable %s with",entity_name(e));
311  fprintf(stderr, "\n section :%s", entity_name(sec));
312  fprintf(stderr, "\n offset :");
314  fprintf(stderr, "lower offset :%d, upper offset: %d \n",l,u);
315  fprintf(stderr, "call path :%s \n", print_call_path(path));
316 }
static string print_call_path(list path)
This function prints the call path , including names of caller functions and orderings of call sites ...
Definition: alias_check.c:277
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
Definition: expression.c:58
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References alias_association_call_chain, alias_association_lower_offset, alias_association_offset, alias_association_section, alias_association_upper_offset, alias_association_variable, entity_name, exp, fprintf(), print_call_path(), and print_expression().

Referenced by formal_variable_add_aliases(), print_list_of_alias_associations(), ram_variable_add_aliases(), and same_or_equivalence_argument_add_aliases().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_list_of_alias_associations()

void print_list_of_alias_associations ( list  l)

Definition at line 324 of file alias_check.c.

325 {
326  MAP(ALIAS_ASSOCIATION, aa,{
328  },l);
329 }
void print_alias_association(alias_association aa)
Definition: alias_check.c:301

References ALIAS_ASSOCIATION, MAP, and print_alias_association().

Referenced by alias_check().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_variables()

string print_variables ( expression  e)

Definition at line 804 of file array_bound_check_bottom_up.c.

805 {
806  syntax s = expression_syntax(e);
807  tag t = syntax_tag(s);
808  string retour = "";
809  switch (t){
810  case is_syntax_range:
811  break;
812  case is_syntax_call:
813  {
814  call c = syntax_call(s);
815  list args = call_arguments(c);
817  {
818  retour = strdup(concatenate(retour,print_variables(exp),NULL));
819  },args);
820  break;
821  }
822  case is_syntax_reference:
823  {
825  retour = strdup(concatenate(retour,", \', ",reference_to_string(ref)," =\',",
826  reference_to_string(ref),NULL));
827  break;
828  }
829  default:
830  {
831  pips_internal_error("Unexpected expression tag %d ", t );
832  break;
833  }
834  }
835  return retour;
836 }
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
string print_variables(expression e)
#define pips_internal_error
Definition: misc-local.h:149
int tag
TAG.
Definition: newgen_types.h:92
string reference_to_string(reference r)
Definition: expression.c:87
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_tag(x)
Definition: ri.h:2727
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_reference
Definition: ri.h:2691
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define syntax_call(x)
Definition: ri.h:2736
#define call_arguments(x)
Definition: ri.h:711
#define expression_syntax(x)
Definition: ri.h:1247

References call_arguments, concatenate(), exp, EXPRESSION, expression_syntax, is_syntax_call, is_syntax_range, is_syntax_reference, MAP, pips_internal_error, ref, reference_to_string(), strdup(), syntax_call, syntax_reference, and syntax_tag.

Referenced by make_bottom_up_abc_tests(), and make_interprocedural_abc_tests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ simplify_relational_expression()

expression simplify_relational_expression ( expression  e)

alias_check.c

If e is a relational expression

Definition at line 139 of file alias_check.c.

140 {
142  {
143  /* If e is a relational expression*/
145  expression e1 = EXPRESSION(CAR(args));
146  expression e2 = EXPRESSION(CAR(CDR(args)));
148  {
152  {
154  Pvecteur v1 = normalized_linear(n1);
155  Pvecteur v2 = normalized_linear(n2);
156  Pvecteur v = vect_substract(v1,v2);
157  expression new_exp;
158  vect_normalize(v);
159  new_exp = Pvecteur_to_expression(v);
161  }
162  }
163  }
164  return e;
165 }
#define NORMALIZE_EXPRESSION(e)
#define binary_intrinsic_expression(name, e1, e2)
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...
Definition: entity.c:453
expression Pvecteur_to_expression(Pvecteur vect)
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
Definition: expression.c:1825
bool relational_expression_p(expression e)
Definition: expression.c:587
#define normalized_linear_p(x)
Definition: ri.h:1779
#define expression_undefined_p(x)
Definition: ri.h:1224
#define normalized_linear(x)
Definition: ri.h:1781
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...
Definition: binaires.c:75
void vect_normalize(Pvecteur v)
void vect_normalize(Pvecteur v): division de tous les coefficients de v par leur pgcd; "normalisation...
Definition: unaires.c:59

References binary_intrinsic_expression, call_arguments, call_function, CAR, CDR, entity_local_name(), EXPRESSION, expression_syntax, expression_undefined_p, int_to_expression(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, Pvecteur_to_expression(), relational_expression_p(), syntax_call, vect_normalize(), and vect_substract().

Referenced by alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_and_scalar_variable_in_module_flt(), alias_check_array_variable_in_caller_flt(), alias_check_array_variable_in_module_flt(), alias_check_scalar_and_array_variables_in_caller(), alias_check_scalar_and_array_variables_in_module(), alias_check_two_scalar_variables_in_caller(), and alias_check_two_scalar_variables_in_module().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subscript_value()

expression subscript_value ( entity  arr,
list  l_inds 
)
Parameters
arrrr
l_inds_inds

Definition at line 276 of file array_bound_check_bottom_up.c.

277 {
278  expression retour = int_to_expression(1);
279  if (!ENDP(l_inds))
280  {
281  variable var = type_variable(entity_type(arr));
283  list l_dims = variable_dimensions(var);
284  int num_dim = gen_length(l_inds),i;
285  for (i=1; i<= num_dim; i++)
286  {
287  dimension dim_i = find_ith_dimension(l_dims,i);
288  expression lower_i = dimension_lower(dim_i);
289  expression sub_i = find_ith_argument(l_inds,i);
290  expression upper_i = dimension_upper(dim_i);
291  expression size_i;
292  if ( expression_constant_p(lower_i) && (expression_to_int(lower_i)==1))
293  size_i = copy_expression(upper_i);
294  else
295  {
296  size_i = binary_intrinsic_expression(MINUS_OPERATOR_NAME,upper_i,lower_i);
299  }
300  if (!same_expression_p(sub_i,lower_i))
301  {
303  sub_i,lower_i);
304  expression elem_i;
305  if (expression_undefined_p(prod))
306  elem_i = copy_expression(sub_low_i);
307  else
309  sub_low_i,prod);
311  retour, elem_i);
312  }
313  if (expression_undefined_p(prod))
314  prod = copy_expression(size_i);
315  else
317  prod,size_i);
318  }
319  }
320  ifdebug(4)
321  {
322  pips_debug(4,"\nSubscript value:");
323  print_expression(retour);
324  }
325  return retour;
326 }
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
int expression_to_int(expression exp)
================================================================
Definition: expression.c:2205
expression find_ith_argument(list args, int n)
Definition: expression.c:1147
bool same_expression_p(expression e1, expression e2)
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a
Definition: expression.c:1426
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
Definition: type.c:5621
#define dimension_lower(x)
Definition: ri.h:980
#define expression_undefined
Definition: ri.h:1223
#define dimension_upper(x)
Definition: ri.h:982
#define variable_dimensions(x)
Definition: ri.h:3122

References binary_intrinsic_expression, copy_expression(), dimension_lower, dimension_upper, ENDP, entity_type, expression_constant_p(), expression_to_int(), expression_undefined, expression_undefined_p, find_ith_argument(), find_ith_dimension(), gen_length(), ifdebug, int_to_expression(), MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, pips_debug, PLUS_OPERATOR_NAME, print_expression(), same_expression_p(), type_variable, and variable_dimensions.

Referenced by abc_with_allocation_size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ translate_to_module_frame()

expression translate_to_module_frame ( entity  mod1,
entity  mod2,
expression  e1,
call  c 
)

alias_propagation.c

alias_propagation.c

Common variable in mod1 => return corresponding common variable e2 in mod2 1.2. Special case : e1 is a formal parameter in mod1, mod2 is caller of mod1 => take corresponding actual argument e2 in call c 1.3. From the association information, if we have e1 = e2 where e2 is constant or contains variables of the mod2 => return e2 2.If e1 is a call : 2.1. Storage rom : numerical constant or symbolic value (PARAMETER) => return e1 2.2. Recursive : e1 = ex1 * ey1 ex2 = translate_to_module_frame(mod1,mod2,ex1,c) ey2 = translate_to_module_frame(mod1,mod2,ey1,c)
=> return e2=ex2*ey2 3.If e1 is a range : error

Return expression_undefined if we can not translate

Check if the common variable is also declared in the mod2 or not We can use ram_shared which contains a list of aliased variables with en but it does not work ????
Another way : looking for a variable in the declaration of the mod2 that has the same offset in the same common block

ATTENTION : enti may be an array, such as A(2): COMMON C1,C2,C3,C4,C5 COMMON C1,A(2,2) we must return A(1,1), not A

Special case : e1 is a formal parameter in mod1, mod2 is caller of mod1 miss a check : mod2 = caller of mod1 => can be wrong !!!

Use the association of the call site: Take only the equalities. Project all variables belonging to mod1 , except the current variable e1 there are 2 cases :

  1. The projection is not exact , there are over flows Return the SC_UNDEFINED => what to do, like before ?
  2. The result is exact, three small cases: 2.1 The system is always false sc_empty => unreachable code ? 2.2 The system is always true sc_rn => we have nothing ? 2.3 The system is parametric =>

Look for equality that contain e1 Delete e1 from the vector Check if the remaining of the vectors contains only constant (TCTS) or variables of mod2 => return

Attention : here the transformer binding_context is consistent but not the system ps_tmp. I do not understand why ? fprintf(stderr, "consistent psystem ps_tmp before"); pips_assert("consistent psystem ps_tmp", sc_consistent_p(ps_tmp));

Take only the equations of the system

he coefficient of e is 1 or -1. Check if the remaining vector contains only constant or variavbles of mod2

Numerical constant or symbolic value (PARAMETER)

e1 is a call, not a constant Recursive : with the arguments of the call As our generated expression e1 is a call with operators : +,-,* only, we treat only these cases

Parameters
mod1od1
mod2od2
e11

Definition at line 202 of file alias_propagation.c.

203 {
204  if (!expression_undefined_p(e1)) {
205  syntax syn = expression_syntax(e1);
206  tag t = syntax_tag(syn);
207  switch(t){
208  case is_syntax_reference:
209  {
212  normalized ne;
213  if (variable_in_common_p(en))
214  {
215  /* Check if the common variable is also declared in the mod2 or not
216  * We can use ram_shared which contains a list of aliased variables with en
217  * but it does not work ????
218  * Another way : looking for a variable in the declaration of the mod2
219  * that has the same offset in the same common block */
220  list l_decls = code_declarations(entity_code(mod2));
221  MAP(ENTITY, enti,{
222  if (same_scalar_location_p(en,enti))
223  {
224  pips_debug(4,"\nThe common variable %s is translated\n",entity_local_name(en));
225  if (array_entity_p(enti))
226  {
227  /* ATTENTION : enti may be an array, such as A(2):
228  COMMON C1,C2,C3,C4,C5
229  COMMON C1,A(2,2)
230  we must return A(1,1), not A */
231  variable varenti = type_variable(entity_type(enti));
232  int len = gen_length(variable_dimensions(varenti));
233  list l_inds = make_list_of_constant(1,len);
234  reference refer = make_reference(enti,l_inds);
235  return reference_to_expression(refer);
236  }
237  return entity_to_expression(enti);
238  }
239  },l_decls);
240  // return the common variable although it is not declared in the module !!!!!!
241  // return entity_to_expression(en);
242  }
244  {
246  entity fun = call_function(c);
247  if (same_entity_p(fun,mod1))
248  {
249  /* Special case : e1 is a formal parameter in mod1, mod2 is caller of mod1
250  miss a check : mod2 = caller of mod1 => can be wrong !!!*/
251  int off = formal_offset(fo);
252  list l_args = call_arguments(c);
253  pips_debug(4,"\nThe formal parameter %s is translated to the caller's frame\n",
254  entity_local_name(en));
255  return find_ith_argument(l_args,off);
256  }
257  }
258  /* Use the association of the call site:
259  Take only the equalities.
260  Project all variables belonging to mod1 , except the current variable e1
261  there are 2 cases :
262  1. The projection is not exact , there are over flows
263  Return the SC_UNDEFINED => what to do, like before ?
264  2. The result is exact, three small cases:
265  2.1 The system is always false sc_empty => unreachable code ?
266  2.2 The system is always true sc_rn => we have nothing ?
267  2.3 The system is parametric =>
268 
269  Look for equality that contain e1
270  Delete e1 from the vector
271  Check if the remaining of the vectors contains only constant (TCTS)
272  or variables of mod2 => return*/
273  if (expression_equal_integer_p(e1,0)) return e1;
275  ne = NORMALIZE_EXPRESSION(e1);
276  if (normalized_linear_p(ne))
277  {
278  Pvecteur ve = normalized_linear(ne);
279  Variable vare = var_of(ve);
281  Psysteme ps_tmp = predicate_system(transformer_relation(binding_context));
282  Pbase b_tmp = ps_tmp->base;
283  /* Attention : here the transformer binding_context is consistent
284  but not the system ps_tmp. I do not understand why ?
285  fprintf(stderr, "consistent psystem ps_tmp before");
286  pips_assert("consistent psystem ps_tmp", sc_consistent_p(ps_tmp));*/
287  if (base_contains_variable_p(b_tmp,vare))
288  {
289  Psysteme ps = sc_dup(ps_tmp);
290  Pbase b = ps->base;
291  Pvecteur pv_var = VECTEUR_NUL;
292  for(; !VECTEUR_NUL_P(b); b = b->succ)
293  {
294  Variable var = vecteur_var(b);
295  if ((strcmp(module_local_name(mod1),entity_module_name((entity)var))==0)
296  && (var!=vare))
297  vect_add_elem(&pv_var, var, VALUE_ONE);
298  }
300  ps->nb_ineq = 0;
301  ps = sc_system_projection_along_variables(ps, pv_var);
302  vect_rm(pv_var);
303  if (ps != SC_UNDEFINED)
304  {
305  // the projection is exact
306  Pcontrainte egal, egal1;
307  for (egal = ps->egalites; egal != NULL; egal = egal1)
308  {
309  /* Take only the equations of the system */
310  Pvecteur vec = egal->vecteur;
311  if (vect_contains_variable_p(vec,vare))
312  {
313  Value vale = vect_coeff(vare,vec);
314  Pvecteur newv = VECTEUR_UNDEFINED;
315  if (value_one_p(vale) || value_mone_p(vale))
316  newv = vect_del_var(vec,vare);
317  if (value_one_p(vale))
318  vect_chg_sgn(newv);
319  if (!VECTEUR_UNDEFINED_P(newv))
320  {
321  /*the coefficient of e is 1 or -1.
322  Check if the remaining vector contains only constant
323  or variavbles of mod2*/
324  Pvecteur v;
325  bool check = true;
326  for (v = newv; (v !=NULL) && (check); v = v->succ)
327  {
328  Variable var = v->var;
329  if ((var != TCST) &&
330  (strcmp(module_local_name(mod2),entity_module_name((entity)var))!=0))
331  check = false;
332  }
333  if (check)
334  {
335  pips_debug(4,"\nThe variable %s is translated by using binding information\n",
336  entity_local_name(en));
337  return Pvecteur_to_expression(newv);
338  }
339  vect_rm(newv);
340  }
341  }
342  egal1 = egal->succ;
343  }
344  }
345  sc_rm(ps);
346  }
347  }
348  break;
349  }
350  case is_syntax_call:
351  {
352  call ca = syntax_call(syn);
353  entity fun = call_function(ca);
354  list l_args = call_arguments(ca);
355  if (l_args==NIL)
356  {
357  /* Numerical constant or symbolic value (PARAMETER) */
358  ifdebug(4)
359  {
360  pips_debug(4,"\nNumerical constant or symbolic value is translated\n");
361  print_expression(e1);
362  }
363  return e1;
364  }
365  /* e1 is a call, not a constant
366  Recursive : with the arguments of the call
367  As our generated expression e1 is a call with operators : +,-,* only,
368  we treat only these cases */
369  if (gen_length(l_args)==1)
370  {
371  expression ex1 = EXPRESSION(CAR(l_args));
372  expression ex2 = translate_to_module_frame(mod1, mod2,ex1,c);
373  if (!expression_undefined_p(ex2))
374  return MakeUnaryCall(fun,ex2);
375  }
376  if (gen_length(l_args)==2)
377  {
378  expression ex1 = EXPRESSION(CAR(l_args));
379  expression ey1 = EXPRESSION(CAR(CDR(l_args)));
380  expression ex2 = translate_to_module_frame(mod1,mod2,ex1,c);
381  expression ey2 = translate_to_module_frame(mod1,mod2,ey1,c);
383  return MakeBinaryCall(fun,ex2,ey2);
384  }
385  break;
386  }
387  default:
388  pips_internal_error("Abnormal cases ");
389  break;
390  }}
391  return expression_undefined;
392 }
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
expression translate_to_module_frame(entity mod1, entity mod2, expression e1, call c)
This function translates an expression e1 from the frame of module 1 to the frame of module 2 1....
#define value_mone_p(val)
#define value_one_p(val)
int Value
#define VALUE_ONE
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
Definition: base.c:136
transformer transformer_identity()
Allocate an identity transformer.
Definition: basic.c:110
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Definition: alloc.c:226
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
expression reference_to_expression(reference r)
Definition: expression.c:196
void clean_all_normalized(expression e)
Definition: expression.c:4102
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
list make_list_of_constant(int val, int number)
of expression
Definition: expression.c:3369
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
bool expression_equal_integer_p(expression exp, int i)
================================================================
Definition: expression.c:1977
bool variable_is_a_module_formal_parameter_p(entity, entity)
Definition: variable.c:1547
bool same_scalar_location_p(entity, entity)
FI: transferred from semantics (should be used for effect translation as well)
Definition: variable.c:1992
#define formal_offset(x)
Definition: ri.h:1408
#define reference_variable(x)
Definition: ri.h:2326
#define storage_formal(x)
Definition: ri.h:2524
#define transformer_relation(x)
Definition: ri.h:2873
#define predicate_system(x)
Definition: ri.h:2069
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Definition: sc_alloc.c:277
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
Definition: scalaires.c:151
Pvecteur vecteur
struct Scontrainte * succ
Pcontrainte inegalites
Definition: sc-local.h:71
Pcontrainte egalites
Definition: sc-local.h:70
Pbase base
Definition: sc-local.h:75
int nb_ineq
Definition: sc-local.h:73
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
transformer formal_and_actual_parameters_association(call c, transformer pre)
formal_and_actual_parameters_association(call c, transformer pre): Add equalities between actual and ...
Definition: transformer.c:2542
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define vecteur_var(v)
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
#define VECTEUR_NUL_P(v)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define var_of(varval)
#define VECTEUR_UNDEFINED_P(v)
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
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...
Definition: unaires.c:72
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Definition: unaires.c:206
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228
bool vect_contains_variable_p(Pvecteur v, Variable var)
bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable o...
Definition: unaires.c:415

References array_entity_p(), Ssysteme::base, base_contains_variable_p(), call_arguments, call_function, CAR, CDR, clean_all_normalized(), code_declarations, contraintes_free(), Ssysteme::egalites, ENTITY, entity_code(), entity_local_name(), entity_module_name(), entity_storage, entity_to_expression(), entity_type, EXPRESSION, expression_equal_integer_p(), expression_syntax, expression_undefined, expression_undefined_p, find_ith_argument(), formal_and_actual_parameters_association(), formal_offset, gen_length(), ifdebug, Ssysteme::inegalites, is_syntax_call, is_syntax_reference, make_list_of_constant(), make_reference(), MakeBinaryCall(), MakeUnaryCall(), MAP, module_local_name(), Ssysteme::nb_ineq, NIL, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_debug, pips_internal_error, predicate_system, print_expression(), Pvecteur_to_expression(), ref, reference_to_expression(), reference_variable, same_entity_p(), same_scalar_location_p(), sc_dup(), sc_rm(), storage_formal, Scontrainte::succ, Svecteur::succ, syntax_call, syntax_reference, syntax_tag, TCST, transformer_identity(), transformer_relation, type_variable, value_mone_p, VALUE_ONE, value_one_p, Svecteur::var, var_of, variable_dimensions, variable_in_common_p(), variable_is_a_module_formal_parameter_p(), vect_add_elem(), vect_chg_sgn(), vect_coeff(), vect_contains_variable_p(), vect_del_var(), vect_rm(), Scontrainte::vecteur, VECTEUR_NUL, VECTEUR_NUL_P, VECTEUR_UNDEFINED, VECTEUR_UNDEFINED_P, and vecteur_var.

Referenced by alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_variable_in_caller_flt(), alias_check_scalar_and_array_variables_in_caller(), alias_check_two_array_variables_in_caller(), formal_variable_add_aliases(), interprocedural_abc_arrays(), ram_variable_add_aliases(), and same_or_equivalence_argument_add_aliases().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ used_before_set()

bool used_before_set ( const char *  module_name)

used_before_set.c

File instrument.out is used to store ubs checks

Set and get the current properties concerning regions

Get the code of the module

Get IN regions of the module

File xxx.database/Src/initialization.f contains all the initializations of global variables

Common variable in main program

Local variable in main program, but attention, IN regions contain also static variables of other modules !!!

Formal or common variable

Local variable

save to resource

Parameters
module_nameodule_name

Definition at line 1046 of file used_before_set.c.

1047 {
1048  list l_in_regions = NIL;
1049  ubs module_ubs;
1050  string user_file = db_get_memory_resource(DBR_USER_FILE,module_name,true);
1051  string base_name = pips_basename(user_file, NULL);
1052  /* File instrument.out is used to store ubs checks*/
1053  string dir_name = db_get_current_workspace_directory();
1054  string instrument_file = strdup(concatenate(dir_name, "/instrument.out", NULL));
1055  out = safe_fopen(instrument_file, "a");
1057  "/",base_name,NULL));
1059  if (!same_string_p(rule_phase(find_rule_by_resource("REGIONS")),"MUST_REGIONS"))
1060  pips_user_warning("\nMUST REGIONS not selected - " "Do not expect wonderful results\n");
1061  /* Set and get the current properties concerning regions */
1062  set_bool_property("MUST_REGIONS", true);
1063  set_bool_property("EXACT_REGIONS", true);
1067  /* Get the code of the module */
1070  /* Get IN regions of the module */
1072  regions_init();
1074  debug_on("USED_BEFORE_SET_DEBUG_LEVEL");
1076  ifdebug(2)
1077  {
1078  pips_debug(2,"List of IN regions of module %s:",module_name);
1079  print_inout_regions(l_in_regions);
1080  }
1081  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_name);
1082  fprintf(out," EXTERNAL ir_isnan,id_isnan\n");
1083  fprintf(out," LOGICAL*4 ir_isnan,id_isnan\n");
1084  fprintf(out,"%s\n",PREFIX2);
1086  {
1087  /* File xxx.database/Src/initialization.f contains all the initializations of
1088  global variables */
1089  initialization_file = strdup(concatenate(dir_name, "/Src/initialization.f", NULL));
1091  MAP(REGION,reg,
1092  {
1093  entity ent = region_entity(reg);
1094  if (strcmp(entity_module_name(ent),IO_EFFECTS_PACKAGE_NAME)!=0)
1095  {
1096  if (variable_in_common_p(ent))
1097  /* Common variable in main program */
1099  else
1100  {
1101  /* Local variable in main program, but attention,
1102  IN regions contain also static variables of other modules !!!*/
1105  }
1106  }
1107  },l_in_regions);
1110  }
1111  else
1112  {
1113  callees callers = (callees) db_get_memory_resource(DBR_CALLERS,module_name,true);
1114  list l_callers = callees_callees(callers);
1115  MAP(REGION,reg,
1116  {
1117  entity ent = region_entity(reg);
1118  if (strcmp(entity_module_name(ent),IO_EFFECTS_PACKAGE_NAME)!=0)
1119  {
1121  /* Formal or common variable */
1122  verify_formal_and_common_variables(ent,l_callers);
1123  else
1124  {
1125  /* Local variable */
1128  }
1129  }
1130  },l_in_regions);
1131  }
1132  module_ubs = make_ubs(l_ubs_checks);
1133  // message_assert("module ubs is consistent",ubs_consistent_p(module_ubs));
1134  /* save to resource */
1135  DB_PUT_MEMORY_RESOURCE(DBR_UBS,module_name,copy_ubs(module_ubs));
1137  debug_off();
1138  safe_fclose(out,instrument_file);
1139  free(instrument_file), instrument_file = NULL;
1140  free(dir_name), dir_name = NULL;
1143  regions_end();
1144  reset_in_effects();
1147  return true;
1148 }
ubs copy_ubs(ubs p)
UBS.
Definition: ubs_private.c:58
ubs make_ubs(list a)
Definition: ubs_private.c:94
#define region_entity(reg)
#define REGION
void regions_end(void)
void regions_init(void)
void print_inout_regions(list)
void set_in_effects(statement_effects)
void reset_in_effects(void)
list load_statement_in_regions(statement)
char * pips_basename(char *fullpath, char *suffix)
Definition: file.c:822
static FILE * user_file
These functions implements the writing of objects.
Definition: genClib.c:1485
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
Definition: lowlevel.c:150
#define WORKSPACE_SRC_SPACE
Definition: pipsdbm-local.h:32
static FILE * out
static string initialization_file
static FILE * out2
static list l_ubs_checks
#define PREFIX1
This analysis checks if the program uses a variable or an array element which has not been assigned a...
static string file_name
static void display_used_before_set_statistics()
static void verify_formal_and_common_variables(entity ent, list l_callers)
static int number_of_processed_modules
static statement module_statement
#define PREFIX2
static entity current_mod
static void initialize_and_verify_local_variable(entity ent, region reg)
static void initialize_and_verify_common_variable(entity ent, region reg)

References callees_callees, concatenate(), copy_ubs(), current_mod, db_get_current_workspace_directory(), db_get_directory_name_for_module(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, display_used_before_set_statistics(), entity_main_module_p(), entity_module_name(), entity_undefined, file_name, find_rule_by_resource(), formal_parameter_p(), fprintf(), free(), get_regions_properties(), ifdebug, initialization_file, initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), IO_EFFECTS_PACKAGE_NAME, l_ubs_checks, load_statement_in_regions(), local_name_to_top_level_entity(), make_ubs(), MAP, module_name(), module_statement, NIL, number_of_processed_modules, out, out2, pips_basename(), pips_debug, pips_user_warning, PREFIX1, PREFIX2, print_inout_regions(), REGION, region_entity, regions_end(), regions_init(), reset_current_module_entity(), reset_current_module_statement(), reset_in_effects(), reset_ordering_to_statement(), rule_phase, safe_fclose(), safe_fopen(), same_string_p, set_bool_property(), set_current_module_entity(), set_current_module_statement(), set_in_effects(), set_ordering_to_statement(), strdup(), user_file, variable_in_common_p(), verify_formal_and_common_variables(), and WORKSPACE_SRC_SPACE.

+ Here is the call graph for this function: