25 #include "pips_config.h"
113 "Non constant substring lower bound in equivalence chain\n");
118 "in an EQUIVALENCE statement. Maybe an array declaration "
119 "should be moved up ahead of the EQUIVALENCE\n",
121 ParserError(
"MakeEquivAtom",
"function call in equivalence chain\n");
134 ParserError(
"MakeEquivAtom",
"Formal parameter in equivalence chain\n");
150 ParserError(
"MakeEquivAtom",
"Functional variable (?) in equivalence chain.\n");
158 ParserError(
"MakeEquivAtom",
"Adjustable array in equivalence chain\n");
164 pips_debug(8,
"Offset %d for reference to %s\n",
230 pips_debug(8,
"No equivalences to process, end\n");
240 pips_debug(8,
"Initial equivalence chains\n");
252 pips_debug(8,
"Intermediate equivalence chains\n");
257 pips_debug(8,
"Resulting equivalence chains\n");
272 cons *pcl, *pcf, *pct;
307 for (pc1 = opc1; pc1 !=
NIL; pc1 =
CDR(pc1))
308 for (pc2 = opc2; pc2 !=
NIL; pc2 =
CDR(pc2))
328 for (pc1 = opc1; pc1 !=
NIL; pc1 =
CDR(pc1)) {
329 for (pc2 = opc2; pc2 !=
NIL; pc2 =
CDR(pc2)) {
339 if (pc1 ==
NIL || pc2 ==
NIL)
340 FatalError(
"MergeTwoChains",
"empty intersection\n");
345 pctemp = opc2; opc2 = opc1; opc1 = pctemp;
371 (void)
fprintf(stderr,
"Empty list of equivalence chains\n");
394 (void)
fprintf(stderr,
"(%s,%td) ; ",
407 bool is_in_p =
false;
424 bool is_in_p =
false;
505 cons *pcc, *pca, *pcv;
569 "Incompatible default area %s and "
570 "area %s requested by equivalence for %s\n",
574 "incompatible areas\n");
579 FatalError(
"ComputeAddresses",
"non ram storage\n");
598 if ((adr = ac+o) < 0) {
599 user_warning(
"ComputeAddresses",
"Offset %d for %s in common /%s/.\n",
602 "Attempt to extend common backwards. "
603 "Have you checked the code with a Fortran compiler?\n");
635 "Two conflicting offsets for %s: %d and %d\n",
637 ParserError(
"ComputeAddresses",
"incompatible addresses\n");
736 " in stack because it has already been allocated in %s\n",
738 ParserError(__FUNCTION__,
"Storage cannot be redefined to stack");
763 pips_debug(2,
"Process left-over dynamic variables\n");
772 pips_debug(2,
"Add dynamic non-aliased variable %s\n",
789 pips_debug(2,
"Add static non-aliased variable %s\n",
799 "Ignore heap variable %s because its address cannot be computed\n",
808 "Ignore stack variable %s because its address cannot be computed\n",
817 if(!
ENDP(dynamic_aliases)) {
822 pips_debug(2,
"There are dynamic aliased variables:");
826 pips_assert(
"aliased dynamic variables imply standard dynamic variables",
829 (void)
gen_nconc(dynamics, dynamic_aliases);
833 if(!
ENDP(static_aliases)) {
838 pips_debug(2,
"There are static aliased variables:");
842 pips_assert(
"aliased static variables imply standard static variables",
845 (void)
gen_nconc(statics, static_aliases);
864 pips_debug(8,
"No equivalence to process. End\n");
872 pips_debug(8,
"Process an equivalence chain:\n");
904 "\tCheck initalization consistency for %s\n",
913 "ANSI extension: overlapping initializations\n");
void free_equivalences(equivalences p)
atom make_atom(entity a1, intptr_t a2)
equivalences make_equivalences(list a)
storage make_storage(enum storage_utype tag, void *val)
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
bool value_defined_p(value p)
bool entity_is_argument_p(entity e, cons *args)
cons * arguments_add_entity(cons *a, entity e)
entity DynamicArea
These global variables are declared in ri-util/util.c.
int SafeSizeOfArray(entity a)
This function should not be used outside of the syntax library because it depends on ParserError().
void update_common_to_size(entity a, size_t new_size)
int OffsetOfReference(reference r)
This function computes the numerical offset of a variable element from the begining of the variable.
size_t common_to_size(entity a)
atom MakeEquivAtom(syntax s)
this function creates an atom of an equivalence chain.
static equivalences TempoEquivSet
external variables used by functions from equivalence.c
void SaveChains()
Initialize the shared fields of aliased variables.
void StoreEquivChain(chain c)
This function is called when an equivalence chain has been completely parsed.
void PrintChains(equivalences e)
two debugging functions, just in case ...
cons * MergeTwoChains(cons *opc1, cons *opc2)
this function merges two equivalence chains whose intersection is not empty, ie.
bool entity_in_equivalence_chain_p(entity e, chain c)
static equivalences FinalEquivSet
int ChainIntersection(cons *opc1, cons *opc2)
this function returns true if the there is a variable that occurs in both atom lists.
bool entity_in_equivalence_chains_p(entity e)
void SetChains()
initialize chains before each call to the parser
void ResetChains()
undefine chains between two successives calls to parser
char vcid_syntax_equivalence[]
Support and resolve equivalence chains.
void ComputeEquivalences()
This function merges all the equivalence chains to take into account equivalences due to transitivity...
int AddOrMergeChain(chain ct)
this function adds a chain ct to the set of equivalences.
void ComputeAddresses()
This function computes an address for every variable.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
entity get_current_module_entity(void)
Get the entity of the current module.
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_once(const void *vo, list l)
Prepend an item to a list only if it is not already in the list.
list gen_copy_seq(list l)
Copy a list structure.
#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)
bool gen_eq(const void *obj1, const void *obj2)
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
#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
#define user_warning(fn,...)
void print_arguments(list args)
#define equivalences_undefined
#define ATOM(x)
newgen_equivalences_domain_defined
#define equivalences_undefined_p(x)
#define equivalences_chains(x)
#define SUBSTRING_FUNCTION_NAME
#define UNKNOWN_RAM_OFFSET
int current_offset_of_area(entity a, entity v)
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
const char * module_local_name(entity e)
Returns the module local user name.
code EntityCode(entity e)
this function checks that e has an initial value code.
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
int expression_to_int(expression exp)
================================================================
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
bool array_with_numerical_bounds_p(entity)
bool array_with_numerical_bounds_p(entity a) input : an array entity output : true if all bounds of a...
bool variable_entities_may_conflict_p(entity, entity)
bool formal_parameter_p(entity)
#define syntax_reference_p(x)
#define storage_formal_p(x)
#define syntax_reference(x)
#define reference_undefined
#define reference_variable(x)
#define value_unknown_p(x)
#define entity_storage(x)
#define code_declarations(x)
#define EXPRESSION(x)
EXPRESSION.
#define call_arguments(x)
#define expression_syntax(x)
#define type_variable_p(x)
#define storage_undefined_p(x)
#define storage_undefined
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
bool ParserError(const char *f, const char *m)