25 #include "pips_config.h"
75 #define STATIC_ENTITY_CACHE_SIZE 128
438 sn =
"undefined object, entity assumed";
440 sn =
"not an entity";
455 const char* null_name =
"null";
514 char valid[12] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
BLOCK_SEP_CHAR,
'\0'};
515 bool is_block_scope =
false;
517 bool is_number =
false;
519 pips_debug(10,
"Potential block scope string = \"%s\"\n", s);
521 if(strspn(s, valid) == strlen(s)) {
522 for(cs=s; *cs!=
'\0'; cs++) {
523 if(is_number && isdigit(*cs))
527 else if(!is_number && isdigit(*cs))
530 is_block_scope =
false;
534 is_block_scope = !is_number;
537 pips_debug(10,
"String = \"%s\" is %sa block scope string\n", s, is_block_scope?
"":
"not ");
539 return is_block_scope;
555 pips_debug(9,
"entity name = \"%s\", without scope: \"%s\"\n",
573 pips_debug(8,
"local name = \"%s\", scope: \"%s\"\n",
612 bool conflict_p =
false;
799 bool return_val =
false;
860 bool field_p =
false;
862 if(*eln!=
'\'' && *eln!=
'"') {
895 (void) strcpy(pos-usnl+1, usn);
898 pips_debug(8,
"struct entity name is \"\%s\"\n", sn);
1021 bool same_p =
false;
1075 debug(6,
"local_entity_of_module_p",
1245 string std_file_name;
1246 static string std_file_target_suffix =
"";
1249 else std_file_name =
"stderr";
1252 asprintf(&target_name,
"__%s__%s", std_file_name, std_file_target_suffix);
1331 null_1 = (*pe1==(
entity)NULL),
1332 null_2 = (*pe2==(
entity)NULL);
1334 if (null_1 || null_2)
1340 return(null_1-null_2);
1432 #define PREFIXES_SIZE 5
1459 string sep = strchr(cun,
FILE_SEP);
1491 "Please feed pips with its definition and source\n",name);
1746 int cumulated_offset = 0;
1776 if (cumulated_offset==
offset || !only_primary)
1781 cumulated_offset+=size;
1816 value common_value =
1857 #define declaration_formal_p(E) storage_formal_p(entity_storage(E))
1858 #define entity_to_offset(E) formal_offset(storage_formal(entity_storage(E)))
1868 while (ldecl != NULL)
1890 string s, next_comma = (
char*) 1;
1891 for (s = names; s && *s && next_comma;)
1893 next_comma = strchr(s,
',');
1894 if (next_comma) *next_comma =
'\0';
1897 if (next_comma) *next_comma =
',';
1908 bool is_typedef =
false;
1926 bool is_member =
false;
1945 bool is_dummy = (pn==
dummy);
2035 desc =
"storage_undefined";
2081 pips_debug(8,
"Dummy identifier changed from \"\%s\" to \"\%s\"\n",
2260 bool found_p =
false;
2267 pips_debug(8,
"entity \"%s\" is used to declare entity \"%s\"\n",
2291 bool found_p =
false;
2302 pips_debug(8,
"entity \"%s\" is used to declare entity \"%s\"\n",
2342 string global_new_name,
2343 bool systematically_add_suffix,
2344 bool move_initialization_p)
2350 if (systematically_add_suffix) {
2464 string global_new_name,
2465 bool move_initialization_p)
2470 move_initialization_p);
2496 string global_new_name,
2497 bool move_initialization_p)
2502 move_initialization_p);
2543 return thread_safe_p;
2576 return abstract_state_p;
2582 bool success_p =
true;
2597 const char * one_neutral []= {
2605 for(
int i=0;one_neutral[i];i++)
2608 const char * plus_inf_neutral[] = {
2614 for(
int i=0;plus_inf_neutral[i];i++)
2620 const char * minus_inf_neutral[] = {
2624 for(
int i=0;minus_inf_neutral[i];i++)
2630 const char * zero_neutral [] ={
2642 for(
int i=0;zero_neutral[i];i++)
2664 bool commut_p =
false;
2752 pips_debug(8,
"Member \"\%s\" not found in enum \"\%s\"\n",
2756 pips_debug(8,
"Member \"\%s\" found in enum \"\%s\"\n",
2801 bool fortran_p =
false;
2983 bool (*chunk_filter)(
void*),
bool (*entity_filter)(
entity))
2988 referenced_entities,
3028 set_union(referenced_entities,referenced_entities,tmp);
3041 return referenced_entities;
3126 pips_debug(4,
"Looked if variable %s is local to function %s, result is %d\n",
3145 pips_debug(8,
"entity %s to be made after %s\n",
3190 for( ; l !=
NIL; l =
CDR(l))
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
dummy make_dummy_identifier(entity _field_)
functional make_functional(list a1, type a2)
value make_value_unknown(void)
expression make_expression(syntax a1, normalized a2)
value make_value_code(code _field_)
language make_language_fortran(void)
storage make_storage_rom(void)
value make_value_constant(constant _field_)
type copy_type(type p)
TYPE.
storage make_storage(enum storage_utype tag, void *val)
basic make_basic_int(intptr_t _field_)
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
type make_type_functional(functional _field_)
type make_type_void(list _field_)
expression copy_expression(expression p)
EXPRESSION.
value make_value(enum value_utype tag, void *val)
language copy_language(language p)
LANGUAGE.
entity check_entity(entity p)
type make_type_area(area _field_)
qualifier make_qualifier_register(void)
variable make_variable(basic a1, list a2, list a3)
value copy_value(value p)
VALUE.
area make_area(intptr_t a1, list a2)
code make_code(list a1, string a2, sequence a3, list a4, language a5)
void free_storage(storage p)
language make_language_c(void)
type make_type_unknown(void)
storage copy_storage(storage p)
STORAGE.
constant make_constant_litteral(void)
syntax make_syntax(enum syntax_utype tag, void *val)
sequence make_sequence(list a)
bool entity_consistent_p(entity p)
type make_type(enum type_utype tag, void *val)
range make_range(expression a1, expression a2, expression a3)
struct _newgen_struct_entity_ * entity
void const char const char const int
entity DynamicArea
These global variables are declared in ri-util/util.c.
int dummy
A dummy file, to prevent empty libraries from breaking builds.
bool static_module_name_p(const char *name)
Check if the given name is a static module name.
bool main_module_global_name_p(const char *name)
Argument "name" is a global name.
bool return_label_p(const char *s)
const char * global_name_to_user_name(const char *global_name)
functions on strings for entity names
bool empty_label_p(const char *s)
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
const char * local_name(const char *s)
Does not take care of block scopes and returns a pointer.
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_chunk_undefined_p(c)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
static char * package
The package name in which functions will be defined.
const char * get_current_module_name(void)
Get the name of the current module.
statement get_current_module_statement(void)
Get the current module statement.
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
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
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.
list gen_nreverse(list cp)
reverse a list in place
int gen_position(const void *item, const list l)
Element ranks are strictly positive as for first, second, and so on.
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
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.
void gen_free_list(list l)
free the spine of the list
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
void * gen_find_eq(const void *item, const list seq)
#define list_undefined
Undefined list definition :-)
void gen_sort_list(list l, gen_cmp_func_t compare)
Sorts a list of gen_chunks in place, to avoid allocations...
#define full_name(dir, name)
#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
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define DUMMY_STRUCT_PREFIX
#define STRUCT_PREFIX_CHAR
#define DYNAMIC_AREA_LOCAL_NAME
#define MODULE_SEP
special characters to build entity names of various kinds
#define DUMMY_ENUM_PREFIX
For enum and struct and union without names (see c_syntax/cyacc.y)
#define UNION_PREFIX_CHAR
#define DUMMY_PARAMETER_PREFIX
For dmmmy parameters in functions declarations.
#define EMPTY_LABEL_NAME
Its value is "@", the label prefix followed by nothing.
#define TYPEDEF_PREFIX_CHAR
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define DUMMY_UNION_PREFIX
#define STACK_AREA_LOCAL_NAME
#define POINTER_DUMMY_TARGETS_AREA_LOCAL_NAME
#define STATIC_AREA_LOCAL_NAME
#define MODULE_SEP_STRING
#define HEAP_AREA_LOCAL_NAME
#define F95_USE_LOCAL_NAME
constant names
#define BLOCK_SEP_STRING
Scope separator.
string gen_strndup(string, size_t)
string.c
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
list set_to_list(const set)
create a list from a set the set is not freed
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
set set_add_elements(set, const set, const void *e,...)
#define set_undefined_p(s)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
int(* gen_cmp_func_t)(const void *, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
int f2(int off1, int off2, int w, int n, float r[n], float a[n], float b[n])
static const char * prefix
#define GETS_FUNCTION_NAME
#define BITWISE_OR_OPERATOR_NAME
#define VFPRINTF_FUNCTION_NAME
#define MAX_OPERATOR_NAME
#define ENTITY_PLUS_UPDATE_P(e)
#define ENTITY_MODULO_UPDATE_P(e)
#define IO_EFFECTS_PTR_NAME
To express C IO intrinsics effects.
#define RAND_GEN_EFFECTS_NAME
variable name for random unit
#define BITWISE_XOR_OPERATOR_NAME
#define RAND_EFFECTS_PACKAGE_NAME
package name for random routines
#define SCANF_FUNCTION_NAME
#define TIME_EFFECTS_PACKAGE_NAME
package name for time routines
#define READ_FUNCTION_NAME
#define ENDFILE_FUNCTION_NAME
#define BITWISE_OR_UPDATE_OPERATOR_NAME
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
#define BUFFERIN_FUNCTION_NAME
#define ENTITY_BITWISE_AND_UPDATE_P(e)
#define SSCANF_FUNCTION_NAME
#define C_MODULO_OPERATOR_NAME
#define MINUS_OPERATOR_NAME
#define DIVIDE_UPDATE_OPERATOR_NAME
#define ISOC99_SSCANF_USER_FUNCTION_NAME
#define PLUS_OPERATOR_NAME
#define ENTITY_MULTIPLY_P(e)
#define IO_EFFECTS_ARRAY_NAME
array of Logical UNits; it is more or less handled as the current file pointer; in C,...
#define INSTANCE_OF(type, value)
polymorhism thanks to newgen !
#define make_entity(n, t, s, i)
#define FOPEN_FUNCTION_NAME
#define MEMMOVE_EFFECTS_PACKAGE_NAME
package name for memmove routines
#define BACKSPACE_FUNCTION_NAME
#define ISOC99_SSCANF_FUNCTION_NAME
#define LEFT_SHIFT_UPDATE_OPERATOR_NAME
#define ISOC99_SCANF_FUNCTION_NAME
#define VFSCANF_FUNCTION_NAME
#define UNKNOWN_RAM_OFFSET
#define REWIND_FUNCTION_NAME
#define FPRINTF_FUNCTION_NAME
#define MULTIPLY_UPDATE_OPERATOR_NAME
#define OPEN_FUNCTION_NAME
#define MALLOC_EFFECTS_NAME
variable name for heap effects
#define ENTITY_RIGHT_SHIFT_UPDATE_P(e)
#define LEFT_SHIFT_OPERATOR_NAME
#define ENTITY_BITWISE_OR_UPDATE_P(e)
#define entity_declarations(e)
MISC: newgen shorthands.
#define GENERATED_LABEL_MODULE_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define MINUS_UPDATE_OPERATOR_NAME
#define ENTITY_PLUS_C_P(e)
#define CONTINUE_FUNCTION_NAME
#define SNPRINTF_FUNCTION_NAME
#define MEMMOVE_EFFECTS_NAME
variable name for memmove unit
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
#define IO_EOF_ARRAY_NAME
array of end of file codes
#define MALLOC_EFFECTS_PACKAGE_NAME
package name for malloc routines (could be libc package)
#define module_language(e)
implemented as a macro to allow lhs
#define DIVIDE_OPERATOR_NAME
#define WRITE_FUNCTION_NAME
#define CLOSE_FUNCTION_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define ENTITY_MULTIPLY_UPDATE_P(e)
#define UNARY_PLUS_OPERATOR_NAME
#define ENTITY_DIVIDE_UPDATE_P(e)
#define RIGHT_SHIFT_UPDATE_OPERATOR_NAME
#define IO_ERROR_ARRAY_NAME
array of error codes for LUNs
#define ENTITY_BITWISE_XOR_UPDATE_P(e)
#define PLUS_UPDATE_OPERATOR_NAME
#define FORMAT_FUNCTION_NAME
#define ENTITY_MINUS_UPDATE_P(e)
#define MINUS_C_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
#define BITWISE_AND_UPDATE_OPERATOR_NAME
#define ENTITY_LEFT_SHIFT_UPDATE_P(e)
#define BITWISE_AND_OPERATOR_NAME
#define TIME_EFFECTS_VARIABLE_NAME
variable holding time effects
#define entity_constant_p(e)
#define RIGHT_SHIFT_OPERATOR_NAME
#define INQUIRE_FUNCTION_NAME
#define PUTS_FUNCTION_NAME
#define ISOC99_SCANF_USER_FUNCTION_NAME
#define PRINTF_FUNCTION_NAME
include<stdio.h>
@ ENTITY_POINTER_DUMMY_TARGETS_AREA
#define PLUS_C_OPERATOR_NAME
#define FCLOSE_FUNCTION_NAME
#define MIN_OPERATOR_NAME
bool entity_area_p(entity e)
bool stack_area_p(entity aire)
bool heap_area_p(entity aire)
bool formal_area_p(entity aire)
bool entity_special_area_p(entity e)
bool entity_not_constant_or_intrinsic_p(entity e)
Default entity filter for get_referenced_entities()
static entity io_error_luns_ent
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool entity_continue_p(entity f)
bool entity_enum_member_p(entity e)
bool entity_list_p(list el)
Checks that el only contains entity.
bool io_intrinsic_p(entity e)
rue is a statement s is an io intrinsic
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
static bool std_static_entities_initialized_p
variables to store entities from standard includes
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...
bool do_get_declared_entities(statement s, set declared_entities)
Helper for get_declared_entities() Add all locally declared entity to the set given in argument.
bool commutative_call_p(call c)
Test if we are allowed to commute operations.
bool entity_return_label_p(entity e)
char * new_label_local_name(entity module)
bool malloc_effect_entity_p(entity e)
entity FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
static void do_get_referenced_entities_on_loop(loop l, get_referenced_entities_t *p)
helper looking in a loop for referenced entities
bool entity_in_list_p(entity ent, list ent_l)
look for ent in ent_l
entity entity_field_to_entity_struct(entity f)
int compare_entities(const entity *pe1, const entity *pe2)
Comparison function for qsort.
bool entity_struct_p(entity e)
Is entity e the entity corresponding to a struct declaration?
void set_std_static_entities()
beware: cannot be called on creating the database
bool dummy_parameter_entity_p(entity p)
is p a dummy parameter?
bool assumed_size_array_p(entity e)
bool rand_effects_entity_p(entity e)
bool label_string_defined_in_current_module_p(string ls)
void reset_static_entities()
static void do_get_referenced_entities_on_statement(statement s, get_referenced_entities_t *p)
helper looking in a statement declaration for referenced entities
bool entity_register_p(entity e)
bool entity_formal_p(entity p)
is p a formal parameter?
bool entity_array_p(entity e)
Is e a variable with an array type?
bool string_block_scope_p(string s)
bool intrinsic_entity_p(entity e)
bool array_entity_p(entity e)
entity make_entity_copy_with_new_name_and_suffix(entity e, string global_new_name, bool move_initialization_p)
Create a copy of an entity, with (almost) identical type, storage and initial value if move_initializ...
static bool label_defined_in_statement
void update_dummy_parameter(parameter p, entity ep)
bool stdout_entity_p(entity e)
bool entity_f95use_p(entity e)
bool explicit_extern_entity_p(entity module, entity e)
string empty_scope()
Functions used to manage the block scoping in conjunction with ContextStack and yco ntext.
entity update_operator_to_regular_operator(entity op)
Returns the binary operator associated to a C update operator such as +=.
bool same_entity_p(entity e1, entity e2)
predicates on entities
list string_to_entity_list(string module, string names)
of entity
void print_entity_set(set s)
bool io_luns_entity_p(entity e)
string entity_global_name(entity e)
Used instead of the macro to pass as formal argument.
char * AddPackageToName(string p, string n)
This function concatenate a package name and a local name to produce a global entity name.
bool entity_local_variable_p(entity var, entity module)
Check if a variable "var" is local to a module "module".
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool entity_subroutine_p(entity e)
bool symbolic_entity_p(entity e)
static entity rand_gen_ent
effects package entities
bool local_entity_of_module_p(entity e, entity module)
This test shows that "e" has been declared in "module".
bool label_defined_in_statement_p(entity l, statement s)
bool entities_p(list el)
Make sure that an list is an homogeneous list of entities.
bool std_file_entity_p(entity e)
bool parameter_passing_mode_p(entity f, int tag)
Returns true when f has no parameters.
static entity malloc_effect_ent
entity make_empty_program(const char *name, language l)
bool c_module_p(entity m)
Test if a module "m" is written in C.
bool pointer_type_array_p(entity e)
static entity time_effect_ent
static entity continue_ent
continue statement
bool string_struct_scope_p(string s)
same kind of testing required for union as well
code entity_code(entity e)
bool entity_label_p(entity e)
bool intrinsic_name_p(const char *local_name)
bool arithmetic_intrinsic_p(entity e)
true if e is an arithmetic instrinsic
entity FindOrCreateTopLevelEntity(const char *name)
Return a top-level entity.
entity AddEntityToModule(entity e, entity module)
!!! caution, it may not be a module, but a common...
set get_referenced_entities_filtered(void *elem, bool(*chunk_filter)(void *), bool(*entity_filter)(entity))
Same as get_referenced_entities, but will only consider entities that fulfills entity_filter and will...
entity make_empty_blockdata(const char *name, language l)
void set_internal_static_entities()
beware: cannot be called on creating the database
entity entity_to_module_entity(entity e)
Find the enclosing module of an entity.
bool same_struct_entity_p(const entity e0, const entity e1)
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity make_empty_subroutine(const char *name, language l)
static void do_get_referenced_entities_on_reference(reference r, get_referenced_entities_t *p)
helper looking in a reference r for referenced entities
static set arithmetic_functions_set
bool extern_entity_p(entity module, entity e)
static size_t static_entity_size
bool entity_main_module_p(entity e)
string storage_to_string(storage s)
list entities_to_expressions(list l_ent)
build a list of expressions from a list of entities
entity FindEntityFromUserName(const char *package, const char *name)
bool unnormalized_array_p(entity e)
const char * entity_name_or_TCST(entity e)
Return a name valid for sorting variables in vectors and constraint systems.
bool entity_function_p(entity e)
string entity_name_without_scope(entity e)
allocates a new string
bool entity_enum_p(entity e)
bool typedef_entity_p(entity e)
static void do_get_referenced_entities_on_list(list l, get_referenced_entities_t *p)
helper looking in a list for referenced entities
bool effects_package_entity_p(entity e)
checks if an entity is an IO_EFFECTS_PACKAGE_NAME, a MALLOC_EFFECTS_NAME or a RAND_EFFECTS_PACKAGE_NA...
entity entity_empty_label(void)
entity make_new_common(string name, entity mod)
This function creates a common for a given name in a given module.
list concat_new_entities(list l1, list l2)
returns l1 after elements of l2 but not of l1 have been appended to l1.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
entity make_entity_copy(entity e)
Create a copy of an entity, with (almost) identical type, storage and initial value if move_initializ...
bool entity_field_p(entity e)
e is the field of a structure
string local_name_to_scope(const char *ln)
allocates a new string
entity make_empty_module(const char *full_name, type r, language l)
The source language is not specified.
expression entity_ith_bounds(entity e, int i)
FIND_MODULE returns entity.
static int init
Maximal value set for Fortran 77.
entity make_loop_label(int __attribute__((unused)) desired_number, entity module)
static entity entity_field_to_entity(entity f, char prefix)
f is a field of a structure: what is its structure?
void register_static_entity(entity *e)
add given entity to the set of entities that must reset upon workspace deletion practically,...
static void do_get_referenced_entities_on_area(area a, get_referenced_entities_t *p)
helper looking in an area for referenced entities
bool empty_scope_p(string s)
void sort_list_of_entities(list l)
sorted in place.
const char * module_local_name(entity e)
Returns the module local user name.
void reset_internal_static_entities()
void print_entities(list l)
void add_thread_safe_variable(entity v)
static entity * static_entity_cache[STATIC_ENTITY_CACHE_SIZE]
bool label_name_conflict_with_labels(const char *n, list ll)
list entity_qualifiers(entity e)
return the qualifiers associated to entity e if it's a variable NIL otherwise
bool label_string_defined_in_statement_p(string ls, statement s)
static void do_get_referenced_entities_on_ram(ram r, get_referenced_entities_t *p)
helper looking in a ram for referenced entities
bool entity_blockdata_p(entity e)
bool entity_empty_label_p(entity e)
code EntityCode(entity e)
this function checks that e has an initial value code.
bool io_entity_p(entity e)
Several implicit entities are declared to define the implicit effects of IO statements.
bool entity_enum_variable_p(entity e)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
bool parameter_passing_by_reference_p(entity f)
bool entity_basic_p(entity e, enum basic_utype basictag)
return true if the basic associated with entity e matchs the passed tag
set get_declared_entities(void *elem)
retrieves the set of entities declared in elem
entity operator_neutral_element(entity op)
static list abstract_state_entities
FI: hidden variables added to take into account the side effects in the libc.
bool entity_module_p(entity e)
entity get_stderr_entity()
bool type_used_in_type_declarations_p(entity e, list ldecl)
check if e is used to declare one of the entities in entity list ldecl
bool entity_f95module_p(entity e)
bool entity_used_in_declarations_p(entity e, list ldecl)
check if e is used to declare one of the entities in entity list ldecl
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
#define declaration_formal_p(E)
entity find_enum_of_member(entity m)
string safe_entity_name(entity e)
predicates and functions for entities
bool entity_equivalence_p(entity e)
checks if an entity is an equivalent
entity CreateEntity(const char *package_name, const char *local_name)
BEGIN_EOLE.
#define PREFIXES_SIZE
this function maps a local name, for instance P, to the corresponding TOP-LEVEL entity,...
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
bool same_entity_name_p(entity e1, entity e2)
compare entity names
entity std_file_entity_to_pointed_file_entity(entity e)
Dummy standard files targets.
entity make_new_label(entity module)
This function returns a new label.
entity get_continue_entity()
true if continue.
bool entity_in_formal_area_p(entity e)
Formal parameters do not use the standard ram storage.
static void make_uniq_reference_list(reference r, deux_listes *l)
bool parameter_passing_by_value_p(entity f)
void fprint_entity_list(FILE *fp, list l)
void fprint_entity_list(FILE *fp,list l): prints a list of entities on file fp.
static entity stdin_ent
stdio files entities
void reset_label_counter()
static entity memmove_effect_ent
bool stderr_entity_p(entity e)
static entity label_searched_in_statement
bool derived_entity_p(entity e)
bool abstract_state_variable_p(entity v)
entity make_new_integer_scalar_common_variable(string name, entity mod, entity com)
This function creates a common variable in a given common in a given module.
entity module_name_to_runtime_entity(const char *name)
similar to module_name_to_entity but generates a warning and a stub if the entity is not found
void add_abstract_state_variable(entity v)
entity find_ith_formal_parameter(entity the_fnct, int rank)
This function gives back the ith formal parameter, which is found in the declarations of a call or a ...
const char * module_resource_name(entity e)
Returns a pointer towards the resource name.
const char * entity_module_name(entity e)
See comments about module_name().
bool entity_variable_length_array_p(entity e)
bool entity_common_p(entity e)
bool thread_safe_variable_p(entity v)
static bool internal_static_entities_initialized_p
Functions closely related to the entity class, constructors, predicates,...
bool time_effect_entity_p(entity e)
entity entity_field_to_entity_union(entity f)
bool entity_pointer_p(entity e)
entity entity_field_to_entity_struct_or_union(entity f)
static list thread_safe_entities
FI: it is assumed that thread safe entities are invariant with respect to workspaces.
bool lexicographic_order_p(entity var1, entity var2)
true if var1 <= var2
static entity generic_make_entity_copy_with_new_name(entity e, string global_new_name, bool systematically_add_suffix, bool move_initialization_p)
Create a copy of an entity, with (almost) identical type, storage and initial value if move_initializ...
const char * entity_and_common_name(entity e)
See next function!
bool stdin_entity_p(entity e)
static bool check_statement_for_label(statement s)
bool member_entity_p(entity e)
entity MakeCompilationUnitEntity(const char *name)
This is useful for the C language only.
Pbase entity_list_to_base(list l)
bool same_field_entity_p(const entity f1, const entity f2)
void set_register_qualifier(entity v)
Assuming that v is of type variable, add a qualifier register.
#define entity_to_offset(E)
static void do_get_referenced_entities_on_entity(entity e, get_referenced_entities_t *p)
static set io_functions_set
set get_referenced_entities(void *elem)
retrieves the set of entities used in elem beware that this entities may be formal parameters,...
bool memmove_effect_entity_p(entity e)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
void reset_std_static_entities()
entity make_label(const char *module_name, const char *local_name)
list extract_references_from_declarations(list decls)
FI: this function has not yet been extended for C types!!!
static void do_get_referenced_entities_on_call(call c, get_referenced_entities_t *p)
helper looking in a call for referenced entities
int entity_field_rank(entity f)
f is a field of a structure or of an union: what is its rank?
entity make_empty_function(const char *name, type r, language l)
const char * label_local_name(entity e)
END_EOLE.
entity make_empty_f95module(const char *name, language l)
entity get_stdin_entity()
#define STATIC_ENTITY_CACHE_SIZE
bool entity_in_common_p(entity e)
entity FindOrCreateEntityLikeModel(const char *package, const char *name, entity model)
hmmm...
entity get_stdout_entity()
bool entity_union_p(entity e)
Is entity e an entity representing the union declaration?
entity global_name_to_entity(const char *name)
Find an entity, if it exists, from its global name, a.k.a.
list common_members_of_module(entity common, entity module, bool only_primary)
returns the list of entity to appear in the common declaration.
entity make_entity_copy_with_new_name(entity e, string global_new_name, bool move_initialization_p)
Create a copy of an entity, with (almost) identical type, storage and initial value if move_initializ...
bool label_defined_in_current_module_p(entity l)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool unbounded_dimension_p(dimension dim)
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
bool expression_equal_integer_p(expression exp, int i)
================================================================
bool compilation_unit_entity_p(entity e)
Check if the given module entity is a compilation unit.
dimension entity_ith_dimension(entity, int)
Another semantics would be: is this reference r to e a kill for e? In general, this cannot be answere...
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
bool variable_length_array_type_p(type)
Is this equivalent to dependent_type_p()?
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
list type_supporting_types(type)
Return the list of types used to define type t.
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
void AddEntityToDeclarations(entity, entity)
END_EOLE.
int add_C_variable_to_area(entity, entity)
list type_supporting_entities(list, type)
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
bool type_structurally_equal_p(type, type)
Type t1 and t2 are equal if their basic concrete components are equal.
type MakeTypeStatement(void)
bool formal_parameter_p(entity)
basic basic_of_call(call, bool, bool)
basic basic_of_call(call c): returns the basic of the result given by the call "c".
entity find_label_entity(const char *, const char *)
util.c
int add_variable_to_area(entity, entity)
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
#define type_functional_p(x)
#define value_undefined_p(x)
#define dummy_identifier(x)
#define qualifier_register_p(x)
#define normalized_undefined
#define functional_result(x)
#define REFERENCE(x)
REFERENCE.
#define language_unknown_p(x)
#define storage_formal_p(x)
#define parameter_dummy(x)
#define QUALIFIER(x)
QUALIFIER.
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define value_intrinsic_p(x)
#define type_functional(x)
#define area_domain
newgen_application_domain_defined
#define dimension_lower(x)
#define parameter_mode(x)
#define basic_pointer_p(x)
#define basic_derived_p(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define type_statement_p(x)
#define code_declarations(x)
#define ram_domain
newgen_qualifier_domain_defined
#define call_domain
newgen_callees_domain_defined
#define storage_formal(x)
#define language_fortran95_p(x)
#define basic_undefined_p(x)
#define VARIABLE(x)
VARIABLE.
#define EXPRESSION(x)
EXPRESSION.
#define statement_label(x)
#define type_undefined_p(x)
#define dummy_unknown_p(x)
#define entity_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
#define value_symbolic_p(x)
#define functional_parameters(x)
#define PARAMETER(x)
PARAMETER.
#define formal_function(x)
#define dimension_upper(x)
#define variable_qualifiers(x)
#define variable_dimensions(x)
#define statement_declarations(x)
#define language_fortran_p(x)
#define entity_domain_number(x)
#define storage_return_p(x)
#define type_variable_p(x)
#define storage_undefined_p(x)
#define entity_domain
newgen_syntax_domain_defined
#define variable_basic(x)
#define storage_undefined
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * variable_name(Variable v)
polynome_ri.c
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
bool(* entity_filter)(entity)
bool(* chunk_filter)(void *)
@ empty
b1 < bj -> h1/hj = empty
A gen_chunk is used to store every object.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define BASE_NULLE
MACROS SUR LES BASES.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...