PIPS
entity.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "properties.h"
#include "ri-util.h"
+ Include dependency graph for entity.c:

Go to the source code of this file.

Data Structures

struct  deux_listes
 
struct  get_referenced_entities_t
 

Macros

#define STATIC_ENTITY_CACHE_SIZE   128
 
#define PREFIXES_SIZE   5
 this function maps a local name, for instance P, to the corresponding TOP-LEVEL entity, whose name is TOP-LEVEL:P. More...
 
#define declaration_formal_p(E)   storage_formal_p(entity_storage(E))
 
#define entity_to_offset(E)   formal_offset(storage_formal(entity_storage(E)))
 

Functions

void set_std_static_entities ()
 beware: cannot be called on creating the database More...
 
void set_internal_static_entities ()
 beware: cannot be called on creating the database More...
 
void reset_internal_static_entities ()
 
void reset_std_static_entities ()
 
void reset_static_entities ()
 
void register_static_entity (entity *e)
 add given entity to the set of entities that must reset upon workspace deletion practically, all static entities should be stored that way More...
 
void print_entities (list l)
 
void print_entity_set (set s)
 
entity make_empty_module (const char *full_name, type r, language l)
 The source language is not specified. More...
 
entity make_empty_program (const char *name, language l)
 
entity make_empty_subroutine (const char *name, language l)
 
entity make_empty_f95module (const char *name, language l)
 
entity make_empty_function (const char *name, type r, language l)
 
entity make_empty_blockdata (const char *name, language l)
 
code EntityCode (entity e)
 this function checks that e has an initial value code. More...
 
entity make_label (const char *module_name, const char *local_name)
 
void reset_label_counter ()
 
char * new_label_local_name (entity module)
 
entity make_new_label (entity module)
 This function returns a new label. More...
 
entity make_loop_label (int __attribute__((unused)) desired_number, entity module)
 
static bool check_statement_for_label (statement s)
 
bool label_defined_in_statement_p (entity l, statement s)
 
bool label_defined_in_current_module_p (entity l)
 
bool label_string_defined_in_current_module_p (string ls)
 
bool label_string_defined_in_statement_p (string ls, statement s)
 
string safe_entity_name (entity e)
 predicates and functions for entities More...
 
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 that it was pertinent to remove the special care of constants there. More...
 
string entity_global_name (entity e)
 Used instead of the macro to pass as formal argument. More...
 
const char * entity_user_name (entity e)
 Since entity_local_name may contain PIPS special characters such as prefixes (label, common, struct, union, typedef, ...), this entity_user_name function is created to return the initial entity/variable name, as viewed by the user in his code. More...
 
string empty_scope ()
 Functions used to manage the block scoping in conjunction with ContextStack and yco ntext. More...
 
bool empty_scope_p (string s)
 
bool string_struct_scope_p (string s)
 same kind of testing required for union as well More...
 
bool string_block_scope_p (string s)
 
string entity_name_without_scope (entity e)
 allocates a new string More...
 
string local_name_to_scope (const char *ln)
 allocates a new string More...
 
const char * module_local_name (entity e)
 Returns the module local user name. More...
 
const char * module_resource_name (entity e)
 Returns a pointer towards the resource name. More...
 
const char * label_local_name (entity e)
 END_EOLE. More...
 
bool label_name_conflict_with_labels (const char *n, list ll)
 
const char * entity_name_or_TCST (entity e)
 Return a name valid for sorting variables in vectors and constraint systems. More...
 
const char * entity_and_common_name (entity e)
 See next function! More...
 
bool entity_empty_label_p (entity e)
 
bool entity_return_label_p (entity e)
 
bool entity_label_p (entity e)
 
bool entity_module_p (entity e)
 
bool entity_f95use_p (entity e)
 
bool entity_main_module_p (entity e)
 
bool entity_f95module_p (entity e)
 
bool entity_blockdata_p (entity e)
 
bool entity_common_p (entity e)
 
bool entity_function_p (entity e)
 
bool entity_subroutine_p (entity e)
 
bool entity_pointer_p (entity e)
 
bool entity_array_p (entity e)
 Is e a variable with an array type? More...
 
bool entity_register_p (entity e)
 
void set_register_qualifier (entity v)
 Assuming that v is of type variable, add a qualifier register. More...
 
bool array_entity_p (entity e)
 
bool entity_variable_length_array_p (entity e)
 
bool assumed_size_array_p (entity e)
 
bool pointer_type_array_p (entity e)
 
bool unnormalized_array_p (entity e)
 
bool entity_field_p (entity e)
 e is the field of a structure More...
 
static entity entity_field_to_entity (entity f, char prefix)
 f is a field of a structure: what is its structure? More...
 
entity entity_field_to_entity_struct (entity f)
 
entity entity_field_to_entity_union (entity f)
 
entity entity_field_to_entity_struct_or_union (entity f)
 
int entity_field_rank (entity f)
 f is a field of a structure or of an union: what is its rank? More...
 
bool entity_enum_p (entity e)
 
bool entity_enum_member_p (entity e)
 
bool entity_enum_variable_p (entity e)
 
bool entity_struct_p (entity e)
 Is entity e the entity corresponding to a struct declaration? More...
 
bool same_struct_entity_p (const entity e0, const entity e1)
 
bool same_field_entity_p (const entity f1, const entity f2)
 
bool entity_union_p (entity e)
 Is entity e an entity representing the union declaration? More...
 
bool derived_entity_p (entity e)
 
bool local_entity_of_module_p (entity e, entity module)
 This test shows that "e" has been declared in "module". More...
 
bool entity_in_common_p (entity e)
 
const char * entity_module_name (entity e)
 See comments about module_name(). More...
 
code entity_code (entity e)
 
entity entity_empty_label (void)
 
bool top_level_entity_p (entity e)
 Check if the scope of entity e is global. More...
 
bool io_entity_p (entity e)
 Several implicit entities are declared to define the implicit effects of IO statements. More...
 
bool io_luns_entity_p (entity e)
 
bool rand_effects_entity_p (entity e)
 
bool malloc_effect_entity_p (entity e)
 
bool memmove_effect_entity_p (entity e)
 
bool time_effect_entity_p (entity e)
 
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_NAME entity. More...
 
entity get_stdin_entity ()
 
bool stdin_entity_p (entity e)
 
entity get_stdout_entity ()
 
bool stdout_entity_p (entity e)
 
entity get_stderr_entity ()
 
bool stderr_entity_p (entity e)
 
bool std_file_entity_p (entity e)
 
entity std_file_entity_to_pointed_file_entity (entity e)
 Dummy standard files targets. More...
 
bool intrinsic_entity_p (entity e)
 
bool symbolic_entity_p (entity e)
 
bool intrinsic_name_p (const char *local_name)
 
entity entity_intrinsic (const char *name)
 FI: I do not understand this function name (see next one!). More...
 
entity CreateIntrinsic (string name)
 this function does not create an intrinsic function because they must all be created beforehand by the bootstrap phase (see bootstrap/bootstrap.c). More...
 
bool same_entity_p (entity e1, entity e2)
 predicates on entities More...
 
int compare_entities (const entity *pe1, const entity *pe2)
 Comparison function for qsort. More...
 
void sort_list_of_entities (list l)
 sorted in place. More...
 
bool lexicographic_order_p (entity var1, entity var2)
 true if var1 <= var2 More...
 
basic entity_basic (entity e)
 return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwise More...
 
list entity_qualifiers (entity e)
 return the qualifiers associated to entity e if it's a variable NIL otherwise More...
 
bool entity_basic_p (entity e, enum basic_utype basictag)
 return true if the basic associated with entity e matchs the passed tag More...
 
bool entity_list_p (list el)
 Checks that el only contains entity. More...
 
entity local_name_to_top_level_entity (const char *n)
 This function try to find a top-level entity from a local name. More...
 
entity module_name_to_entity (const char *mn)
 This is an alias for local_name_to_top_level_entity. More...
 
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 More...
 
entity FindEntity (const char *package, const char *name)
 Retrieve an entity from its package/module name and its local name. More...
 
entity global_name_to_entity (const char *name)
 Find an entity, if it exists, from its global name, a.k.a. More...
 
entity FindEntityFromUserName (const char *package, const char *name)
 
entity CreateEntity (const char *package_name, const char *local_name)
 BEGIN_EOLE. More...
 
entity FindOrCreateEntity (const char *package, const char *local_name)
 Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a function or subroutine call. More...
 
entity FindOrCreateTopLevelEntity (const char *name)
 Return a top-level entity. More...
 
expression entity_ith_bounds (entity e, int i)
 FIND_MODULE returns entity. More...
 
bool io_intrinsic_p (entity e)
 rue is a statement s is an io intrinsic More...
 
bool arithmetic_intrinsic_p (entity e)
 true if e is an arithmetic instrinsic More...
 
entity get_continue_entity ()
 true if continue. More...
 
bool entity_continue_p (entity f)
 
list common_members_of_module (entity common, entity module, bool only_primary)
 returns the list of entity to appear in the common declaration. More...
 
entity make_new_common (string name, entity mod)
 This function creates a common for a given name in a given module. More...
 
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. More...
 
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 subroutine. More...
 
list string_to_entity_list (string module, string names)
 of entity More...
 
bool typedef_entity_p (entity e)
 
bool member_entity_p (entity e)
 
bool entity_formal_p (entity p)
 is p a formal parameter? More...
 
bool dummy_parameter_entity_p (entity p)
 is p a dummy parameter? More...
 
entity MakeCompilationUnitEntity (const char *name)
 This is useful for the C language only. More...
 
bool extern_entity_p (entity module, entity e)
 
bool explicit_extern_entity_p (entity module, entity e)
 
string storage_to_string (storage s)
 
entity entity_to_module_entity (entity e)
 Find the enclosing module of an entity. More...
 
void update_dummy_parameter (parameter p, entity ep)
 
bool parameter_passing_mode_p (entity f, int tag)
 Returns true when f has no parameters. More...
 
bool parameter_passing_by_value_p (entity f)
 
bool parameter_passing_by_reference_p (entity f)
 
char * AddPackageToName (string p, string n)
 This function concatenate a package name and a local name to produce a global entity name. More...
 
entity update_operator_to_regular_operator (entity op)
 Returns the binary operator associated to a C update operator such as +=. More...
 
bool entity_equivalence_p (entity e)
 checks if an entity is an equivalent More...
 
bool same_entity_name_p (entity e1, entity e2)
 compare entity names More...
 
bool entity_in_list_p (entity ent, list ent_l)
 look for ent in ent_l More...
 
list concat_new_entities (list l1, list l2)
 returns l1 after elements of l2 but not of l1 have been appended to l1. More...
 
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 More...
 
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 More...
 
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_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done). More...
 
entity make_entity_copy (entity e)
 Create a copy of an entity, with (almost) identical type, storage and initial value if move_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done). More...
 
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_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done). More...
 
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_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done). More...
 
void add_thread_safe_variable (entity v)
 
bool thread_safe_variable_p (entity v)
 
void add_abstract_state_variable (entity v)
 
bool abstract_state_variable_p (entity v)
 
bool entities_p (list el)
 Make sure that an list is an homogeneous list of entities. More...
 
entity operator_neutral_element (entity op)
 
bool commutative_call_p (call c)
 Test if we are allowed to commute operations. More...
 
list entities_to_expressions (list l_ent)
 build a list of expressions from a list of entities More...
 
entity find_enum_of_member (entity m)
 
bool c_module_p (entity m)
 Test if a module "m" is written in C. More...
 
bool fortran_module_p (entity m)
 Test if a module is in Fortran. More...
 
static void make_uniq_reference_list (reference r, deux_listes *l)
 
list extract_references_from_declarations (list decls)
 FI: this function has not yet been extended for C types!!! More...
 
Pbase entity_list_to_base (list l)
 
declarations updater
static void do_get_referenced_entities_on_entity (entity e, get_referenced_entities_t *p)
 
static void do_get_referenced_entities_on_reference (reference r, get_referenced_entities_t *p)
 helper looking in a reference r for referenced entities More...
 
static void do_get_referenced_entities_on_call (call c, get_referenced_entities_t *p)
 helper looking in a call for referenced entities More...
 
static void do_get_referenced_entities_on_loop (loop l, get_referenced_entities_t *p)
 helper looking in a loop for referenced entities More...
 
static void do_get_referenced_entities_on_list (list l, get_referenced_entities_t *p)
 helper looking in a list for referenced entities More...
 
static void do_get_referenced_entities_on_ram (ram r, get_referenced_entities_t *p)
 helper looking in a ram for referenced entities More...
 
static void do_get_referenced_entities_on_area (area a, get_referenced_entities_t *p)
 helper looking in an area for referenced entities More...
 
static void do_get_referenced_entities_on_statement (statement s, get_referenced_entities_t *p)
 helper looking in a statement declaration for referenced entities More...
 
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 only enter consider entities directly involved in object matching chunk_filter \/!\ if you strip out statements, it will not consider declared entities, but it will consider their initial value. More...
 
bool entity_not_constant_or_intrinsic_p (entity e)
 Default entity filter for get_referenced_entities() More...
 
set get_referenced_entities (void *elem)
 retrieves the set of entities used in elem beware that this entities may be formal parameters, functions etc so consider filter this set depending on your need, using get_referenced_entities_filtered More...
 
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. More...
 
set get_declared_entities (void *elem)
 retrieves the set of entities declared in elem More...
 
bool entity_local_variable_p (entity var, entity module)
 Check if a variable "var" is local to a module "module". More...
 
entity FindOrCreateEntityLikeModel (const char *package, const char *name, entity model)
 hmmm... More...
 
entity AddEntityToModule (entity e, entity module)
 !!! caution, it may not be a module, but a common... More...
 
void fprint_entity_list (FILE *fp, list l)
 void fprint_entity_list(FILE *fp,list l): prints a list of entities on file fp. More...
 
bool entity_in_formal_area_p (entity e)
 Formal parameters do not use the standard ram storage. More...
 

Variables

static bool internal_static_entities_initialized_p = false
 Functions closely related to the entity class, constructors, predicates,... More...
 
static entity rand_gen_ent = entity_undefined
 effects package entities More...
 
static entity malloc_effect_ent = entity_undefined
 
static entity memmove_effect_ent = entity_undefined
 
static entity time_effect_ent = entity_undefined
 
static entity luns_ent = entity_undefined
 
static entity io_ptr_ent = entity_undefined
 
static entity io_eof_ent = entity_undefined
 
static entity io_error_luns_ent = entity_undefined
 
static entity continue_ent = entity_undefined
 continue statement More...
 
static bool std_static_entities_initialized_p = false
 variables to store entities from standard includes More...
 
static entity stdin_ent = entity_undefined
 stdio files entities More...
 
static entity stdout_ent = entity_undefined
 
static entity stderr_ent = entity_undefined
 
static entitystatic_entity_cache [STATIC_ENTITY_CACHE_SIZE]
 
static size_t static_entity_size =0
 
static set io_functions_set = set_undefined
 
static set arithmetic_functions_set = set_undefined
 
static int init = 100000
 Maximal value set for Fortran 77. More...
 
static bool label_defined_in_statement = false
 
static entity label_searched_in_statement = entity_undefined
 
static string prefixes []
 
static list thread_safe_entities = NIL
 FI: it is assumed that thread safe entities are invariant with respect to workspaces. More...
 
static list abstract_state_entities = NIL
 FI: hidden variables added to take into account the side effects in the libc. More...
 

Macro Definition Documentation

◆ declaration_formal_p

#define declaration_formal_p (   E)    storage_formal_p(entity_storage(E))

Definition at line 1857 of file entity.c.

◆ entity_to_offset

#define entity_to_offset (   E)    formal_offset(storage_formal(entity_storage(E)))

Definition at line 1858 of file entity.c.

◆ PREFIXES_SIZE

#define PREFIXES_SIZE   5

this function maps a local name, for instance P, to the corresponding TOP-LEVEL entity, whose name is TOP-LEVEL:P.

n is the local name.

Definition at line 1432 of file entity.c.

◆ STATIC_ENTITY_CACHE_SIZE

#define STATIC_ENTITY_CACHE_SIZE   128

Definition at line 75 of file entity.c.

Function Documentation

◆ abstract_state_variable_p()

bool abstract_state_variable_p ( entity  v)

Definition at line 2572 of file entity.c.

2573 {
2574  bool abstract_state_p = gen_in_list_p(v, abstract_state_entities);
2575 
2576  return abstract_state_p;
2577 }
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
Definition: list.c:734
static list abstract_state_entities
FI: hidden variables added to take into account the side effects in the libc.
Definition: entity.c:2555

References abstract_state_entities, and gen_in_list_p().

Referenced by analyzable_scalar_entity_p().

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

◆ add_abstract_state_variable()

void add_abstract_state_variable ( entity  v)

This might happen when a workspace is closed and another one open or created within one session.

The package name of v could be checked... especially if package names are unified.

Definition at line 2558 of file entity.c.

2559 {
2561  /* This might happen when a workspace is closed and another one
2562  open or created within one session. */
2563  //pips_internal_error("Thread-safe entity \"%s\" redeclared", entity_name(v));
2564  ;
2565  }
2566  else {
2567  /* The package name of v could be checked... especially if package names are unified. */
2569  }
2570 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#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 ENTITY(x)
ENTITY.
Definition: ri.h:2755

References abstract_state_entities, CONS, ENTITY, gen_in_list_p(), gen_nconc(), and NIL.

Referenced by CreateHeapAbstractState(), CreateLogicalUnits(), CreateMemmoveAbstractState(), CreateRandomSeed(), and CreateTimeSeed().

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

◆ add_thread_safe_variable()

void add_thread_safe_variable ( entity  v)

This might happen when a workspace is closed and another one open or created within one session.

The package name of v could be checked... especially if package names are unified.

Definition at line 2525 of file entity.c.

2526 {
2528  /* This might happen when a workspace is closed and another one
2529  open or created within one session. */
2530  //pips_internal_error("Thread-safe entity \"%s\" redeclared", entity_name(v));
2531  ;
2532  }
2533  else {
2534  /* The package name of v could be checked... especially if package names are unified. */
2536  }
2537 }
static list thread_safe_entities
FI: it is assumed that thread safe entities are invariant with respect to workspaces.
Definition: entity.c:2523

References CONS, ENTITY, gen_in_list_p(), gen_nconc(), NIL, and thread_safe_entities.

Referenced by CreateHeapAbstractState(), and CreateMemmoveAbstractState().

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

◆ AddEntityToModule()

entity AddEntityToModule ( entity  e,
entity  module 
)

!!! caution, it may not be a module, but a common...

Parameters
moduleodule

Definition at line 3171 of file entity.c.

3172 {
3174  entity_local_name(e), e);
3175 
3176  pips_debug(7, "adding %s to module %s\n",
3177  entity_name(new), entity_name(module));
3178 
3179  if (entity_module_p(module))
3181 
3182  return new;
3183 }
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
static char * module
Definition: pips.c:74
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
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
bool entity_module_p(entity e)
Definition: entity.c:683
entity FindOrCreateEntityLikeModel(const char *package, const char *name, entity model)
hmmm...
Definition: entity.c:3136
void AddEntityToDeclarations(entity, entity)
END_EOLE.
Definition: variable.c:108
#define entity_name(x)
Definition: ri.h:2790

References AddEntityToDeclarations(), entity_local_name(), entity_module_p(), entity_name, FindOrCreateEntityLikeModel(), module, module_local_name(), and pips_debug.

Referenced by add_declaration_to_host_and_link(), AddCommonToModule(), AddEntityToHostAndNodeModules(), dimensions_to_dma(), and NormalizeCommonVariables().

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

◆ AddPackageToName()

char* AddPackageToName ( string  p,
string  n 
)

This function concatenate a package name and a local name to produce a global entity name.

Previous comment: This function creates a fortran operator parameter, i.e. a zero dimension variable with an overloaded basic type.

Moved from bootstrap.c

Definition at line 2134 of file entity.c.

2136 {
2137  string ps;
2138  int l;
2139 
2140  l = strlen(p);
2141  ps = gen_strndup(p, l + 1 + strlen(n) +1);
2142 
2143  *(ps+l) = MODULE_SEP;
2144  *(ps+l+1) = '\0';
2145  strcat(ps, n);
2146 
2147  return(ps);
2148 }
#define MODULE_SEP
special characters to build entity names of various kinds
Definition: naming-local.h:27
string gen_strndup(string, size_t)
string.c
Definition: string.c:59

References gen_strndup(), and MODULE_SEP.

Referenced by CreateAbstractStateVariable(), CreateAreas(), CreateLogicalUnits(), and MakeIntrinsic().

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

◆ arithmetic_intrinsic_p()

bool arithmetic_intrinsic_p ( entity  e)

true if e is an arithmetic instrinsic

Used to determine if a logical argument must be promoted to integer

FI: the arithmetic operator set is not fully defined. To be completed.

Definition at line 1702 of file entity.c.

1703 {
1715  NULL);
1716  }
1718  return true;
1719  else
1720  return false;
1721 }
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_pointer
Definition: newgen_set.h:44
set set_add_elements(set, const set, const void *e,...)
Definition: set.c:171
#define set_undefined_p(s)
Definition: newgen_set.h:49
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define DIVIDE_OPERATOR_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define UNARY_PLUS_OPERATOR_NAME
#define MINUS_C_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
#define PLUS_C_OPERATOR_NAME
static set arithmetic_functions_set
Definition: entity.c:165
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292

References arithmetic_functions_set, DIVIDE_OPERATOR_NAME, entity_intrinsic(), MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, PLUS_C_OPERATOR_NAME, PLUS_OPERATOR_NAME, set_add_elements(), set_belong_p(), set_make(), set_pointer, set_undefined_p, UNARY_MINUS_OPERATOR_NAME, and UNARY_PLUS_OPERATOR_NAME.

Referenced by basic_of_intrinsic().

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

◆ array_entity_p()

◆ assumed_size_array_p()

bool assumed_size_array_p ( entity  e)

return true if e has an assumed-size array declarator (the upper bound of the last dimension is equal to * : REAL A(*) )

Definition at line 807 of file entity.c.

808 {
809  /* return true if e has an assumed-size array declarator
810  (the upper bound of the last dimension is equal to * : REAL A(*) )*/
811  if (entity_variable_p(e))
812  {
814  list l_dims = variable_dimensions(v);
815  if (l_dims != NIL)
816  {
817  int length = gen_length(l_dims);
818  dimension last_dim = find_ith_dimension(l_dims,length);
819  if (unbounded_dimension_p(last_dim))
820  return true;
821  }
822  }
823  return false;
824 }
size_t gen_length(const list l)
Definition: list.c:150
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
bool unbounded_dimension_p(dimension dim)
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
Definition: expression.c:1130
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
Definition: type.c:5621
#define type_variable(x)
Definition: ri.h:2949
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References entity_type, entity_variable_p, find_ith_dimension(), gen_length(), NIL, type_variable, unbounded_dimension_p(), and variable_dimensions.

Referenced by array_size_stride(), interprocedural_abc_call(), and unnormalized_array_p().

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

◆ c_module_p()

bool c_module_p ( entity  m)

Test if a module "m" is written in C.

value_code_p(m) is not checked: is this code robust? Why not an if/else if/ else and a unique return statement?

All intrinsics, including Fortran intrinsics, are considered written in C.

Temporary fix for the too many make_unknown_language()...

Definition at line 2777 of file entity.c.

2778 {
2779  bool c_p = false;
2780  value v = entity_initial(m);
2781 
2782  if(!value_undefined_p(v)) {
2783  if(value_intrinsic_p(v))
2784  return true;
2786  c_p = language_c_p(l);
2787  /* Temporary fix for the too many make_unknown_language()... */
2788  if(language_unknown_p(l))
2789  pips_internal_error("language should not be unknown");
2790  }
2791  else
2792  pips_internal_error("language should not be unknown");
2793 
2794  return c_p;
2795 }
#define pips_internal_error
Definition: misc-local.h:149
#define value_undefined_p(x)
Definition: ri.h:3017
#define language_unknown_p(x)
Definition: ri.h:1600
#define value_intrinsic_p(x)
Definition: ri.h:3074
#define language_c_p(x)
Definition: ri.h:1594
#define value_code(x)
Definition: ri.h:3067
#define code_language(x)
Definition: ri.h:792
#define entity_initial(x)
Definition: ri.h:2796

References code_language, entity_initial, language_c_p, language_unknown_p, pips_internal_error, value_code, value_intrinsic_p, and value_undefined_p.

Referenced by AddEntityToCompilationUnit(), AddEntityToCurrentModule(), AddEntityToCurrentModuleWithoutDeclaration(), begin_omp_construct(), call_to_postcondition(), compilation_unit_of_module(), compile_mpi(), compute_region(), controlizer(), convex_regions_forward_translation(), distributer(), ensure_comment_consistency(), entities_maymust_conflict_p(), entity_from_user_name(), entity_module_unambiguous_user_name(), entity_more_or_less_minimal_name(), generic_make_entity_copy_with_new_name(), generic_module_name_to_transformers(), GenericAddLocalEntityToDeclarations(), gpu_ify_statement(), inline_expression_call(), internal_print_icfg(), linearize_array_generic(), live_in_paths_of_statement(), make_exec_statement_from_name(), make_return_statement(), make_scalar_entity(), module_name_to_input_file_name(), module_to_all_declarations(), module_to_value_mappings(), new_controlizer(), new_label_local_name(), outliner(), outliner_file(), outliner_independent(), outliner_independent_recursively(), parameter_passing_mode_p(), phi_free_contraints_to_expressions(), print_code_semantics(), references_may_conflict_p(), RemoveEntityFromCompilationUnit(), rice(), SafeMakeConstant(), statement_remove_useless_label(), update_referenced_entities(), user_call_to_transformer(), user_function_call_to_transformer(), variable_entities_may_conflict_p(), and variable_to_dimensions().

+ Here is the caller graph for this function:

◆ check_statement_for_label()

static bool check_statement_for_label ( statement  s)
static

Definition at line 380 of file entity.c.

381 {
384  }
386 }
static bool label_defined_in_statement
Definition: entity.c:377
static entity label_searched_in_statement
Definition: entity.c:378
#define statement_label(x)
Definition: ri.h:2450

References label_defined_in_statement, label_searched_in_statement, and statement_label.

Referenced by label_defined_in_statement_p().

+ Here is the caller graph for this function:

◆ common_members_of_module()

list common_members_of_module ( entity  common,
entity  module,
bool  only_primary 
)

returns the list of entity to appear in the common declaration.

of entity

drop equivalenced that come hereafter...

Parameters
commonommon
moduleodule
only_primarynot the equivalenced...

Definition at line 1741 of file entity.c.

1744 {
1745  list result = NIL;
1746  int cumulated_offset = 0;
1747  pips_assert("entity is a common", entity_area_p(common));
1748 
1749  list ld = area_layout(type_area(entity_type(common)));
1751 
1752  for(; !ENDP(ld);ld = CDR(ld))
1753  {
1754  v = ENTITY(CAR(ld));
1755  storage s = entity_storage(v);
1756  ram r;
1757  pips_assert("storage ram", storage_ram_p(s));
1758  r = storage_ram(s);
1759  if (ram_function(r)==module)
1760  {
1761  int offset = ram_offset(r);
1762  int size = 0;
1763 
1764  if(heap_area_p(ram_section(r))) {
1765  size = 0;
1766  }
1767  else if(stack_area_p(ram_section(r))) {
1768  size = 0;
1769  }
1770  else {
1771  if(!SizeOfArray(v, &size)) {
1772  pips_internal_error("Varying size array \"%s\"", entity_name(v));
1773  }
1774  }
1775 
1776  if (cumulated_offset==offset || !only_primary)
1777  result = CONS(ENTITY, v, result);
1778  else
1779  break; /* drop equivalenced that come hereafter... */
1780 
1781  cumulated_offset+=size;
1782  }
1783  }
1784 
1785  return gen_nreverse(result);
1786 }
static Value offset
Definition: translation.c:283
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#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 pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
bool entity_area_p(entity e)
Definition: area.c:149
bool stack_area_p(entity aire)
Definition: area.c:104
bool heap_area_p(entity aire)
Definition: area.c:86
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
Definition: size.c:87
#define entity_storage(x)
Definition: ri.h:2794
#define storage_ram_p(x)
Definition: ri.h:2519
#define ram_section(x)
Definition: ri.h:2249
#define entity_undefined
Definition: ri.h:2761
#define area_layout(x)
Definition: ri.h:546
#define type_area(x)
Definition: ri.h:2946
#define storage_ram(x)
Definition: ri.h:2521
#define ram_function(x)
Definition: ri.h:2247
#define ram_offset(x)
Definition: ri.h:2251

References area_layout, CAR, CDR, CONS, ENDP, ENTITY, entity_area_p(), entity_name, entity_storage, entity_type, entity_undefined, gen_nreverse(), heap_area_p(), module, NIL, offset, pips_assert, pips_internal_error, ram_function, ram_offset, ram_section, SizeOfArray(), stack_area_p(), storage_ram, storage_ram_p, and type_area.

Referenced by check_common_inclusion(), insert_common_declaration(), MakeEntryCommon(), print_common_layout(), sentence_area(), and text_common_declaration().

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

◆ commutative_call_p()

bool commutative_call_p ( call  c)

Test if we are allowed to commute operations.

Parameters
[in]cis the operation call
Returns
true if we can commute operations

Note that floating point operations are commutative, but since they are not associative due to rounding error , in a chain of operations, we cannot commute them. Of course, we should test whether an operation is alone or not to see if we are in this case...

Definition at line 2661 of file entity.c.

2662 {
2663  entity op = call_function(c);
2664  bool commut_p = false;
2665  if (ENTITY_PLUS_P(op) || ENTITY_MULTIPLY_P(op) ||
2666  ENTITY_AND_P(op) || ENTITY_OR_P(op) || ENTITY_PLUS_C_P(op))
2667  {
2668  basic b = basic_of_call(c,false,true);
2669  switch(basic_tag(b))
2670  {
2671  case is_basic_float:
2672  case is_basic_complex:
2673  if (get_bool_property("RELAX_FLOAT_ASSOCIATIVITY"))
2674  commut_p = true;
2675  break;
2676  case is_basic_logical:
2677  case is_basic_overloaded:
2678  case is_basic_int:
2679  case is_basic_pointer:
2680  commut_p = true;
2681  break;
2682  default:
2683  pips_internal_error("unhandled case");
2684  }
2685  free_basic(b);
2686  }
2687  return commut_p;
2688 }
void free_basic(basic p)
Definition: ri.c:107
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define ENTITY_OR_P(e)
#define ENTITY_AND_P(e)
#define ENTITY_PLUS_P(e)
#define ENTITY_MULTIPLY_P(e)
#define ENTITY_PLUS_C_P(e)
basic basic_of_call(call, bool, bool)
basic basic_of_call(call c): returns the basic of the result given by the call "c".
Definition: type.c:1469
@ is_basic_float
Definition: ri.h:572
@ is_basic_pointer
Definition: ri.h:578
@ is_basic_overloaded
Definition: ri.h:574
@ is_basic_int
Definition: ri.h:571
@ is_basic_logical
Definition: ri.h:573
@ is_basic_complex
Definition: ri.h:575
#define call_function(x)
Definition: ri.h:709
#define basic_tag(x)
Definition: ri.h:613

References basic_of_call(), basic_tag, call_function, ENTITY_AND_P, ENTITY_MULTIPLY_P, ENTITY_OR_P, ENTITY_PLUS_C_P, ENTITY_PLUS_P, free_basic(), get_bool_property(), is_basic_complex, is_basic_float, is_basic_int, is_basic_logical, is_basic_overloaded, is_basic_pointer, and pips_internal_error.

Referenced by _expression_similar_p(), do_simdizer_init(), and reorder_pointer_expression().

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

◆ compare_entities()

int compare_entities ( const entity pe1,
const entity pe2 
)

Comparison function for qsort.

FI: Which sorting do you want?

Parameters
pe1e1
pe2e2

Definition at line 1328 of file entity.c.

1329 {
1330  int
1331  null_1 = (*pe1==(entity)NULL),
1332  null_2 = (*pe2==(entity)NULL);
1333 
1334  if (null_1 || null_2)
1335  // FI: I reverse the test to place the constant term at the end of
1336  //the vector so as to regenerate expressions with trailing
1337  //constant terms; for instance, I get J+1 instead of 1+J.
1338  // Of course, this impacts PIPS code generation
1339  //return(null_2-null_1);
1340  return(null_1-null_2);
1341  else {
1342  /* FI: Which sorting do you want? */
1343 
1344  //string s1 = entity_name_without_scope(*pe1);
1345  //string s2 = entity_name_without_scope(*pe2);
1346  //int c = strcmp(s1, s2);
1347  //
1348  //free(s1);
1349  //free(s2);
1350  //
1351  //return c;
1352  return strcmp(entity_name(*pe1), entity_name(*pe2));
1353  }
1354 }
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14

References entity_name.

Referenced by compare_Pvecteur(), compile_reduction(), copy_from_statement(), copy_to_statement(), dagvtx_cmp_entity(), do_group_constants_terapix(), do_simdizer_init(), fprint_any_environment(), get_symbol_table(), inline_expression_call(), print_entity_task_buffers(), print_sesam_tasks_buffers_header(), promote_local_entities(), real_freia_scalar_rw_dep(), sort_entities_with_dep(), sort_list_of_entities(), statements_localize_declarations(), transfert_block(), transfert_loop(), transfert_statement(), and update_referenced_entities().

+ Here is the caller graph for this function:

◆ concat_new_entities()

list concat_new_entities ( list  l1,
list  l2 
)

returns l1 after elements of l2 but not of l1 have been appended to l1.

l2 is freed append all elements of l2 not in l1 to l1 and free l2

Parameters
l1list to append entities to
l2list from which the new entities come
Returns
l1 with extra new entities appended
Parameters
l11
l22

Definition at line 2236 of file entity.c.

2237 {
2238  list new_l2 = NIL;
2239  set s = set_make(set_pointer);
2240  set_assign_list(s, l1);
2241  FOREACH(ENTITY,e,l2) {
2242  if( ! set_belong_p(s,e) )
2243  new_l2=CONS(ENTITY,e,new_l2);
2244  }
2245  gen_free_list(l2);
2246  set_free(s);
2247  return gen_nconc(l1, gen_nreverse(new_l2));
2248 }
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
Definition: set.c:474
void set_free(set)
Definition: set.c:332
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59

References CONS, ENTITY, FOREACH, gen_free_list(), gen_nconc(), gen_nreverse(), NIL, set_assign_list(), set_belong_p(), set_free(), set_make(), and set_pointer.

+ Here is the call graph for this function:

◆ CreateEntity()

entity CreateEntity ( const char *  package_name,
const char *  local_name 
)

BEGIN_EOLE.

  • please do not remove this line Lines between BEGIN_EOLE and END_EOLE tags are automatically included in the EOLE project (JZ - 11/98)
Parameters
package_nameackage_name
local_nameocal_name

Definition at line 1572 of file entity.c.

1573 {
1574  char * name;
1575  asprintf(&name,"%s"MODULE_SEP_STRING"%s",package_name, local_name);
1577  return e;
1578 }
const char * local_name(const char *s)
Does not take care of block scopes and returns a pointer.
Definition: entity_names.c:221
#define asprintf
Definition: misc-local.h:225
#define MODULE_SEP_STRING
Definition: naming-local.h:30
#define make_entity(n, t, s, i)
#define value_undefined
Definition: ri.h:3016
#define type_undefined
Definition: ri.h:2883
#define storage_undefined
Definition: ri.h:2476

References asprintf, local_name(), make_entity, MODULE_SEP_STRING, storage_undefined, type_undefined, and value_undefined.

Referenced by entity_all_module_locations(), and FindOrCreateEntity().

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

◆ CreateIntrinsic()

entity CreateIntrinsic ( string  name)

this function does not create an intrinsic function because they must all be created beforehand by the bootstrap phase (see bootstrap/bootstrap.c).

Parameters
nameame

Definition at line 1311 of file entity.c.

1312 {
1314  pips_assert("entity is defined", e!=entity_undefined );
1315  pips_assert("entity is intrinsic", intrinsic_entity_p(e));
1316  return(e);
1317 }
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
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...
Definition: entity.c:1586
bool intrinsic_entity_p(entity e)
Definition: entity.c:1272

References entity_undefined, FindOrCreateEntity(), intrinsic_entity_p(), pips_assert, and TOP_LEVEL_MODULE_NAME.

Referenced by add_loop_parallel_threshold(), bound_to_statement(), c_dim_string(), cast_constant(), convert_constant_from_double_to_dcomplex(), convert_constant_from_real_to_complex(), DeclarePointer(), dereference_expression(), dims_array_init(), do_brace_expression_to_statements(), FixCReturnStatements(), get_allocatable_data_expr(), get_cast_function_for_basic(), gfc2pips_array_ref2indices(), gfc2pips_buildCaseTest(), gfc2pips_code2instruction_(), gfc2pips_dumpSELECT(), gfc2pips_expr2expression(), gfc2pips_get_list_of_dimensions2(), gfc2pips_int2expression(), gfc2pips_real2expression(), gfc2pips_reduce_repeated_values(), gfc2pips_symbol2data_instruction(), make_address_of_expression(), make_assign_expression(), make_send_receive_conversion(), make_simple_Fortran_io_instruction(), make_unbounded_expression(), MakeArithmIfInst(), MakeAtom(), MakeBraceExpression(), MakeCommaExpression(), MakeDimension(), MakeImpliedDo(), MakeIoInstA(), MakeIoInstB(), MakeSimpleIoInst1(), MakeZeroOrOneArgCallInst(), merge_conditions(), omp_operator_entity(), pragma_build_if_condition(), pragma_if_as_expr(), pragma_omp_parallel_as_exprs(), pragma_omp_parallel_for_as_exprs(), pragma_private_as_expr_with_args(), recover_structured_while(), reduction_as_expr(), signed_constant_expression_p(), simplify_complex_expression(), split_complex_expression(), statement_has_omp_parallel_directive_p(), step_local_regionArray(), switch_generic_to_specific(), switch_specific_cmplx(), switch_specific_dcmplx(), words_dimension(), and words_substring_op().

+ Here is the call graph for this function:

◆ derived_entity_p()

bool derived_entity_p ( entity  e)

Definition at line 1048 of file entity.c.

1049 {
1050  return entity_struct_p(e) || entity_union_p(e) || entity_enum_p(e);
1051 }
bool entity_struct_p(entity e)
Is entity e the entity corresponding to a struct declaration?
Definition: entity.c:1002
bool entity_enum_p(entity e)
Definition: entity.c:968
bool entity_union_p(entity e)
Is entity e an entity representing the union declaration?
Definition: entity.c:1038

References entity_enum_p(), entity_struct_p(), and entity_union_p().

Referenced by add_prettyprint_control_list_to_declaration_statement(), c_text_related_entities(), filtered_declaration_list(), get_symbol_table(), and UpdateEntities().

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

◆ do_get_declared_entities()

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.

Parameters
declared_entitieseclared_entities

Definition at line 3074 of file entity.c.

3074  {
3076  set_add_element(declared_entities,declared_entities,e);
3077  }
3078  return true;
3079 }
set set_add_element(set, const set, const void *)
Definition: set.c:152
#define statement_declarations(x)
Definition: ri.h:2460

References FOREACH, set_add_element(), and statement_declarations.

Referenced by get_declared_entities().

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

◆ do_get_referenced_entities_on_area()

static void do_get_referenced_entities_on_area ( area  a,
get_referenced_entities_t p 
)
static

helper looking in an area for referenced entities

Definition at line 2948 of file entity.c.

2949 {
2950  if(p->chunk_filter(a))
2952 }
static void do_get_referenced_entities_on_list(list l, get_referenced_entities_t *p)
helper looking in a list for referenced entities
Definition: entity.c:2930
bool(* chunk_filter)(void *)
Definition: entity.c:2881

References area_layout, get_referenced_entities_t::chunk_filter, and do_get_referenced_entities_on_list().

Referenced by get_referenced_entities_filtered().

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

◆ do_get_referenced_entities_on_call()

static void do_get_referenced_entities_on_call ( call  c,
get_referenced_entities_t p 
)
static

helper looking in a call for referenced entities

Definition at line 2906 of file entity.c.

2907 {
2908  if(p->chunk_filter(c)) {
2909  entity e = call_function(c);
2911  }
2912 }
static void do_get_referenced_entities_on_entity(entity e, get_referenced_entities_t *p)
Definition: entity.c:2886

References call_function, get_referenced_entities_t::chunk_filter, and do_get_referenced_entities_on_entity().

Referenced by get_referenced_entities_filtered().

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

◆ do_get_referenced_entities_on_entity()

static void do_get_referenced_entities_on_entity ( entity  e,
get_referenced_entities_t p 
)
static

Definition at line 2886 of file entity.c.

2887  {
2888  if(p->entity_filter(e))
2890 }
bool(* entity_filter)(entity)
Definition: entity.c:2882

References get_referenced_entities_t::entities, get_referenced_entities_t::entity_filter, and set_add_element().

Referenced by do_get_referenced_entities_on_call(), do_get_referenced_entities_on_list(), do_get_referenced_entities_on_loop(), and do_get_referenced_entities_on_reference().

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

◆ do_get_referenced_entities_on_list()

static void do_get_referenced_entities_on_list ( list  l,
get_referenced_entities_t p 
)
static

helper looking in a list for referenced entities

Definition at line 2930 of file entity.c.

2931 {
2932  FOREACH(ENTITY,e,l)
2934 }

References do_get_referenced_entities_on_entity(), ENTITY, and FOREACH.

Referenced by do_get_referenced_entities_on_area(), do_get_referenced_entities_on_ram(), and do_get_referenced_entities_on_statement().

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

◆ do_get_referenced_entities_on_loop()

static void do_get_referenced_entities_on_loop ( loop  l,
get_referenced_entities_t p 
)
static

helper looking in a loop for referenced entities

Definition at line 2917 of file entity.c.

2918 {
2919  if(p->chunk_filter(l)) {
2920  entity e = loop_index(l);
2922  }
2923 }
#define loop_index(x)
Definition: ri.h:1640

References get_referenced_entities_t::chunk_filter, do_get_referenced_entities_on_entity(), and loop_index.

Referenced by get_referenced_entities_filtered().

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

◆ do_get_referenced_entities_on_ram()

static void do_get_referenced_entities_on_ram ( ram  r,
get_referenced_entities_t p 
)
static

helper looking in a ram for referenced entities

Definition at line 2939 of file entity.c.

2940 {
2941  if(p->chunk_filter(r))
2943 }
#define ram_shared(x)
Definition: ri.h:2253

References get_referenced_entities_t::chunk_filter, do_get_referenced_entities_on_list(), and ram_shared.

Referenced by get_referenced_entities_filtered().

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

◆ do_get_referenced_entities_on_reference()

static void do_get_referenced_entities_on_reference ( reference  r,
get_referenced_entities_t p 
)
static

helper looking in a reference r for referenced entities

Definition at line 2895 of file entity.c.

2896 {
2897  if(p->chunk_filter(r)) {
2898  entity e = reference_variable(r);
2900  }
2901 }
#define reference_variable(x)
Definition: ri.h:2326

References get_referenced_entities_t::chunk_filter, do_get_referenced_entities_on_entity(), and reference_variable.

Referenced by get_referenced_entities_filtered().

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

◆ do_get_referenced_entities_on_statement()

static void do_get_referenced_entities_on_statement ( statement  s,
get_referenced_entities_t p 
)
static

helper looking in a statement declaration for referenced entities

you skip the declarations, but not the value / type inside

Definition at line 2956 of file entity.c.

2957 {
2958  if(p->chunk_filter(s))
2960  else {
2961  /* you skip the declarations, but not the value / type inside */
2964  set_union(p->entities,p->entities,tmp);
2965  set_free(tmp);
2966  }
2969  set_union(p->entities,p->entities,tmp);
2970  set_free(tmp);
2971  }
2972  }
2973 }
set set_union(set, const set, const set)
Definition: set.c:211
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...
Definition: entity.c:2982

References get_referenced_entities_t::chunk_filter, do_get_referenced_entities_on_list(), get_referenced_entities_t::entities, ENTITY, get_referenced_entities_t::entity_filter, entity_initial, entity_type, FOREACH, get_referenced_entities_filtered(), set_free(), set_union(), and statement_declarations.

Referenced by get_referenced_entities_filtered().

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

◆ dummy_parameter_entity_p()

bool dummy_parameter_entity_p ( entity  p)

is p a dummy parameter?

Definition at line 1941 of file entity.c.

1942 {
1943  string pn = entity_name(p);
1944  string dummy = strstr(pn, DUMMY_PARAMETER_PREFIX);
1945  bool is_dummy = (pn==dummy);
1946 
1947  pips_debug(9, "pn=\"%s\", dummy=\"%s\"\n", pn, dummy);
1948 
1949  return is_dummy;
1950 }
int dummy
A dummy file, to prevent empty libraries from breaking builds.
Definition: dummy.c:41
#define DUMMY_PARAMETER_PREFIX
For dmmmy parameters in functions declarations.
Definition: naming-local.h:93

References DUMMY_PARAMETER_PREFIX, entity_name, and pips_debug.

Referenced by add_implicit_interprocedural_write_effects(), module_formal_parameters(), RemoveDummyArguments(), SubstituteDummyParameters(), UpdateEntity(), UpdateEntity2(), UseFormalArguments(), and variable_to_abstract_location().

+ Here is the caller graph for this function:

◆ effects_package_entity_p()

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_NAME entity.

These entities are used to model some internal effects of standard libraries and they do not conflict with other entities.

Definition at line 1181 of file entity.c.

1182 {
1183 #ifndef NDEBUG
1184  bool result = rand_effects_entity_p(e)
1187  || time_effect_entity_p(e)
1188  || io_entity_p(e);
1189  pips_assert("entity kind is consistent", result == ((entity_kind(e) & EFFECTS_PACKAGE) == EFFECTS_PACKAGE));
1190 #endif
1191  return entity_kind(e) & EFFECTS_PACKAGE;
1192 }
@ EFFECTS_PACKAGE
bool malloc_effect_entity_p(entity e)
Definition: entity.c:1158
bool rand_effects_entity_p(entity e)
Definition: entity.c:1152
bool io_entity_p(entity e)
Several implicit entities are declared to define the implicit effects of IO statements.
Definition: entity.c:1139
bool time_effect_entity_p(entity e)
Definition: entity.c:1170
bool memmove_effect_entity_p(entity e)
Definition: entity.c:1165
#define entity_kind(x)
Definition: ri.h:2798

References EFFECTS_PACKAGE, entity_kind, io_entity_p(), malloc_effect_entity_p(), memmove_effect_entity_p(), pips_assert, rand_effects_entity_p(), and time_effect_entity_p().

Referenced by analyzed_reference_p(), copy_n_statement(), copy_write_statement(), copy_write_statement_with_cumulated_regions(), create_values_for_simple_effect(), cumul_and_update_effects_of_statement(), entities_maymust_conflict_p(), generic_apply_effects_to_transformer(), module_to_value_mappings(), references_may_conflict_p(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_GlobalVariables(), xml_TaskParameters(), and xml_Type_Entity().

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

◆ empty_scope()

string empty_scope ( void  )

Functions used to manage the block scoping in conjunction with ContextStack and yco ntext.

Definition at line 498 of file entity.c.

498 { return strdup("");}
char * strdup()

References strdup().

Referenced by CreateDefaultContext(), FindOrCreateCurrentEntity(), and local_name_to_scope().

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

◆ empty_scope_p()

bool empty_scope_p ( string  s)

Definition at line 500 of file entity.c.

500 {return strcmp(s, "")==0;}

Referenced by UpdateEntity().

+ Here is the caller graph for this function:

◆ entities_p()

bool entities_p ( list  el)

Make sure that an list is an homogeneous list of entities.

Parameters
ell

Definition at line 2580 of file entity.c.

2581 {
2582  bool success_p = true;
2583 
2584  FOREACH(ENTITY, e, el) {
2585  if(!check_entity(e)) {
2586  success_p = false;
2587  break;
2588  }
2589  }
2590  return success_p;
2591 }
entity check_entity(entity p)
Definition: ri.c:2527

References check_entity(), ENTITY, and FOREACH.

+ Here is the call graph for this function:

◆ entities_to_expressions()

list entities_to_expressions ( list  l_ent)

build a list of expressions from a list of entities

Returns
the list of expression
Parameters
l_ent,thelist of entities

FI: should have been placed in expression.c

FI: no check on arguments, robustness is doubtful; see entity_to_expression()

FI: somebody complaining about the PIPS code structuration in files and libraries might have added to the confusion?

Parameters
l_ent_ent

Definition at line 2703 of file entity.c.

2703  {
2704  list l_exp = NIL;
2705  FOREACH(ENTITY,e,l_ent) {
2706  l_exp = CONS(EXPRESSION, entity_to_expression(e), l_exp);
2707  }
2708  l_exp = gen_nreverse(l_exp);
2709  return(l_exp);
2710 }
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217

References CONS, ENTITY, entity_to_expression(), EXPRESSION, FOREACH, gen_nreverse(), and NIL.

Referenced by generate_copy_loop_nest(), lhs_subs_in_ins(), my_lhs_subs_in_ins(), and pragma_private_as_expr().

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

◆ entity_and_common_name()

const char* entity_and_common_name ( entity  e)

See next function!

Definition at line 654 of file entity.c.

655 {
657  string name ;
658  pips_assert("some current entity", !entity_undefined_p(m));
659 
662 
663  return name +sizeof(COMMON_PREFIX) -1;
664 }
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define COMMON_PREFIX
Definition: naming-local.h:34
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define entity_undefined_p(x)
Definition: ri.h:2762

References COMMON_PREFIX, concatenate(), entity_local_name(), entity_name, entity_storage, entity_undefined_p, get_current_module_entity(), MODULE_SEP_STRING, NIL, pips_assert, ram_section, and storage_ram.

Referenced by compare_effect_reference_in_common(), and effect_words_reference().

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

◆ entity_array_p()

◆ entity_basic()

basic entity_basic ( entity  e)

return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwise

Definition at line 1380 of file entity.c.

1381 {
1382  if (e != entity_undefined) {
1383  type t = entity_type(e);
1384 
1385  if (type_functional_p(t))
1387  if (type_variable_p(t))
1388  return (variable_basic(type_variable(t)));
1389  }
1390  return (basic_undefined);
1391 }
#define type_functional_p(x)
Definition: ri.h:2950
#define functional_result(x)
Definition: ri.h:1444
#define type_functional(x)
Definition: ri.h:2952
#define basic_undefined
Definition: ri.h:556
#define type_variable_p(x)
Definition: ri.h:2947
#define variable_basic(x)
Definition: ri.h:3120

References basic_undefined, entity_type, entity_undefined, functional_result, type_functional, type_functional_p, type_variable, type_variable_p, and variable_basic.

Referenced by add_declaration_to_declaration_statement_p(), c_user_function_call_to_transformer(), call_to_complexity(), check_this_loop(), compile_one_reduction(), constant_entity_to_float(), constant_to_transformer(), convert_constant(), create_new_ent_list(), do_clone_entity(), do_group_basics_maximum(), do_group_basics_maximum_reduce(), do_outliner_smart_replacment(), do_scalar_renaming_in_vertex(), do_split_structure(), do_terapix_argument_handler(), entity_basic_p(), expression_basic(), find_or_create_newInd(), fsr_reference_flt(), generate_code_loop(), generate_parallel_body(), generate_read_of_ref_for_all(), generate_read_of_ref_for_computer(), generate_update_distributed_value_from_host(), hpfc_buffer_entity(), inline_expression_call(), is_string_constant(), make_special_value(), make_test_condition(), outliner_smart_references_computation(), promote_local_entities(), pvm_what_option_expression(), reduction_parameters(), sac_commenter(), sentence_basic_declaration(), simplification_conversion(), simplify_complex_entity(), st_generate_packing(), statements_localize_declarations(), switch_basic_type_to_overloaded(), this_entity_cdeclaration(), type_this_entity_if_needed(), type_this_expression(), verify_array_element(), verify_array_variable(), and verify_scalar_variable().

+ Here is the caller graph for this function:

◆ entity_basic_p()

bool entity_basic_p ( entity  e,
enum basic_utype  basictag 
)

return true if the basic associated with entity e matchs the passed tag

Parameters
basictagasictag

Definition at line 1405 of file entity.c.

1406 {
1407  return basic_tag(entity_basic(e)) == basictag;
1408 }
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380

References basic_tag, and entity_basic().

Referenced by find_or_create_scalar_entity(), and find_or_create_typed_entity().

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

◆ entity_blockdata_p()

bool entity_blockdata_p ( entity  e)

Definition at line 712 of file entity.c.

713 {
714  return entity_module_p(e) &&
715  strspn(entity_local_name(e), BLOCKDATA_PREFIX)==1;
716 }
#define BLOCKDATA_PREFIX
Definition: naming-local.h:35

References BLOCKDATA_PREFIX, entity_local_name(), and entity_module_p().

Referenced by AddVariableToCommon(), AnalyzeData(), entity_subroutine_p(), fix_storage(), initialize_and_verify_common_variable(), MakeExternalFunction(), sentence_head(), and sentence_tail().

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

◆ entity_code()

◆ entity_common_p()

bool entity_common_p ( entity  e)

??????

Definition at line 718 of file entity.c.

719 {
720  return entity_module_p(e) && /* ?????? */
721  strspn(entity_local_name(e), COMMON_PREFIX)==1;
722 }

References COMMON_PREFIX, entity_local_name(), and entity_module_p().

Referenced by make_common_entity().

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

◆ entity_continue_p()

bool entity_continue_p ( entity  f)

Definition at line 1731 of file entity.c.

1732 {
1733  return same_entity_p(f, get_continue_entity());
1734 }
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
bool same_entity_p(entity e1, entity e2)
predicates on entities
Definition: entity.c:1321
entity get_continue_entity()
true if continue.
Definition: entity.c:1726

References f(), get_continue_entity(), and same_entity_p().

Referenced by declaration_statement_p(), and only_io_call().

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

◆ entity_empty_label()

entity entity_empty_label ( void  )

FI: it is difficult to memoize entity_empty_label because its value is changed when the symbol table is written and re-read from disk; Remi's memoizing scheme was fine as long as the entity table lasted as long as one run of pips, i.e. is not adequate for wpips

static entity empty = entity_undefined;

Definition at line 1105 of file entity.c.

1106 {
1107  /* FI: it is difficult to memoize entity_empty_label because its value is changed
1108  * when the symbol table is written and re-read from disk; Remi's memoizing
1109  * scheme was fine as long as the entity table lasted as long as one run of
1110  * pips, i.e. is not adequate for wpips
1111  */
1112  /* static entity empty = entity_undefined; */
1113  entity empty;
1114 
1118  NULL), entity_domain);
1119  pips_assert("The empty label is defined", empty != entity_undefined );
1120 
1121  return empty;
1122 }
#define EMPTY_LABEL_NAME
Its value is "@", the label prefix followed by nothing.
Definition: naming-local.h:96
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
@ empty
b1 < bj -> h1/hj = empty
Definition: union-local.h:64

References concatenate(), empty, EMPTY_LABEL_NAME, entity_domain, entity_undefined, gen_find_tabulated(), MODULE_SEP_STRING, pips_assert, and TOP_LEVEL_MODULE_NAME.

Referenced by __attribute__(), add_exec_mmcd(), add_test(), begin_omp_construct(), bound_generation(), build_first_comb(), build_third_comb(), C_MakeReturnStatement(), clean_statement_label(), clear_label(), cluster_stage_spire(), code_generation(), com_call(), comEngine_distribute_code(), compact_list(), controlize_distribution(), controlize_list(), controlizer(), copy_n_statement(), distribute_code(), do_clone_label(), do_group_constants_terapix(), do_loop_expansion_init(), do_loop_to_while_loop(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_symbolic_tiling(), enclose_in_a_parallel_loop(), fix_sequence_statement_attributes(), for_to_do_loop_conversion(), forloop_test(), full_spaghettify_module(), gather_and_remove_all_format_statements_rewrite(), gen_mpi_send_recv(), gen_omp_taskwait(), generate_code(), generate_code_loop(), generate_copy_loop_nest(), generate_full_copy(), generate_guarded_statement(), generate_loop_workchunk(), generic_insert_statement(), GenericAddLocalEntityToDeclarations(), gfc2pips_code2get_label(), gfc2pips_code2get_label2(), gfc2pips_code2get_label3(), gfc2pips_code2get_label4(), gfc2pips_code2instruction__TOP(), Hierarchical_tiling(), hpf_compile_loop(), insert_before_current_statement(), insert_endscop_after_stmt(), insert_endscop_before_stmt(), insert_endscop_in_sequence(), insert_rwt(), instruction_to_statement(), io_filter(), isolate_code_portion(), loop_normalize_of_loop(), loop_strip_mine(), loop_test(), make_binary_call_statement(), make_body_from_loop(), make_call_statement(), make_communication_statement(), make_condition_from_forloop(), make_condition_from_loop(), make_condition_from_test(), make_condition_from_whileloop(), make_exit_from_forloop(), make_exit_from_loop(), make_exit_from_test(), make_exit_from_whileloop(), make_forloop_statement(), make_fsm_from_statement(), make_global_common_and_initialize(), make_initialization_from_loop(), make_loop_skeleton(), make_loop_statement(), make_loop_step_stat(), make_loopPattern(), make_loopStat1(), make_movements_loop_body_wp65(), make_new_loop_statement(), make_plain_continue_statement(), make_scalar_communication_module(), make_start_ru_module(), make_state_variable_assignement_statement(), make_statement_operator(), make_test_statement(), make_transition_statement(), make_transStat(), make_undefined_list(), make_whileloop_statement(), MakeAssignInst(), MakeBlock(), MakeCaseStatement(), MakeDefaultStatement(), MakeForloop(), MakeGotoStatement(), MakeIoInstA(), MakeLoopAs(), makeloopbody(), MakeNewLabelledStatement(), Overlap_Analysis(), parallel_tiling(), ProcessEntry(), put_a_comment_on_a_statement(), re_do_it(), recover_structured_while(), ReuseLabelledStatement(), sa_do_it(), simd_insert_statement(), srwt(), statement_convert_to_statement_with_sequence_of_intruction(), statement_filter(), statement_remove_useless_label(), statement_to_label(), substitute_and_create(), systeme_to_loop_nest(), take_out_the_entry_node_of_the_unstructured(), Tiling2_buffer(), Tiling_buffer_allocation(), tiling_transformation(), update_statement_instruction(), usual_loop_tiling(), and whileloop_test().

+ Here is the call graph for this function:

◆ entity_empty_label_p()

◆ entity_enum_member_p()

bool entity_enum_member_p ( entity  e)

SG: not all entities seem to have this field defined if not defined, assume it's not an enum, although i am unsure of the validity of this:

pips_assert("Value of e is defined", !value_undefined_p(ev));

Definition at line 980 of file entity.c.

981 {
982  value ev = entity_initial(e);
983  /* SG: not all entities seem to have this field defined if not
984  * defined, assume it's not an enum, although i am unsure of the
985  * validity of this:
986  *
987  * pips_assert("Value of e is defined", !value_undefined_p(ev));
988  */
989  return !value_undefined_p(ev) && value_symbolic_p(ev);
990 }
#define value_symbolic_p(x)
Definition: ri.h:3068

References entity_initial, value_symbolic_p, and value_undefined_p.

Referenced by inline_expression_call(), and outliner_independent_recursively().

+ Here is the caller graph for this function:

◆ entity_enum_p()

bool entity_enum_p ( entity  e)

Base the predicate on the entity name as for struct and union.

Definition at line 968 of file entity.c.

969 {
970  /* Base the predicate on the entity name as for struct and union.*/
971  //return type_enum_p(entity_type(e));
972  const char* ln = entity_local_name(e);
973  string ns = strrchr(ln, BLOCK_SEP_CHAR);
974  bool struct_p = (ns==NULL && *ln==ENUM_PREFIX_CHAR)
975  || (ns!=NULL && *(ns+1)==ENUM_PREFIX_CHAR)
976  || (strstr(entity_name(e),ENUM_PREFIX DUMMY_ENUM_PREFIX)!=NULL);
977  return struct_p;
978 }
#define ENUM_PREFIX_CHAR
Definition: naming-local.h:61
#define BLOCK_SEP_CHAR
Definition: naming-local.h:51
#define DUMMY_ENUM_PREFIX
For enum and struct and union without names (see c_syntax/cyacc.y)
Definition: naming-local.h:86
#define ENUM_PREFIX
Definition: naming-local.h:60

References BLOCK_SEP_CHAR, DUMMY_ENUM_PREFIX, entity_local_name(), entity_name, ENUM_PREFIX, and ENUM_PREFIX_CHAR.

Referenced by basic_maximum(), derived_entity_p(), do_clone_entity(), entity_enum_variable_p(), filtered_declaration_list(), find_enum_of_member(), and get_symbol_table().

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

◆ entity_enum_variable_p()

bool entity_enum_variable_p ( entity  e)

Definition at line 992 of file entity.c.

992  {
996 }
#define basic_derived(x)
Definition: ri.h:640
#define basic_derived_p(x)
Definition: ri.h:638
#define basic_undefined_p(x)
Definition: ri.h:557

References basic_derived, basic_derived_p, basic_undefined, basic_undefined_p, entity_enum_p(), entity_type, type_variable, type_variable_p, ultimate_type(), and variable_basic.

Referenced by NormalizeReference().

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

◆ entity_equivalence_p()

bool entity_equivalence_p ( entity  e)

checks if an entity is an equivalent

Parameters
eentity to check
Returns
true if entity is an equivalent

Definition at line 2194 of file entity.c.

2195 {
2196  return storage_ram_p(entity_storage(e))
2198 }

References ENDP, entity_storage, ram_shared, storage_ram, and storage_ram_p.

◆ entity_f95module_p()

bool entity_f95module_p ( entity  e)

Definition at line 707 of file entity.c.

707  {
708  return entity_module_p(e) &&
709  strspn(entity_local_name(e), F95MODULE_PREFIX)==1;
710 }
#define F95MODULE_PREFIX
Definition: naming-local.h:36

References entity_local_name(), entity_module_p(), and F95MODULE_PREFIX.

Referenced by sentence_head(), and sentence_tail().

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

◆ entity_f95use_p()

bool entity_f95use_p ( entity  e)

Definition at line 694 of file entity.c.

695 {
696  const char* name = entity_name(e);
697  return strncmp(name,F95_USE_LOCAL_NAME,strlen(F95_USE_LOCAL_NAME)) == 0;
698 }
#define F95_USE_LOCAL_NAME
constant names
Definition: naming-local.h:67

References entity_name, and F95_USE_LOCAL_NAME.

Referenced by text_entity_declaration().

+ Here is the caller graph for this function:

◆ entity_field_p()

bool entity_field_p ( entity  e)

e is the field of a structure

Definition at line 857 of file entity.c.

858 {
859  const char* eln = entity_local_name(e);
860  bool field_p = false;
861 
862  if(*eln!='\'' && *eln!='"') {
863  const char* pos = strrchr(eln, MEMBER_SEP_CHAR);
864 
865  field_p = pos!=NULL;
866  }
867 
868  return field_p;
869 }
#define MEMBER_SEP_CHAR
Definition: naming-local.h:54

References entity_local_name(), and MEMBER_SEP_CHAR.

Referenced by c_convex_effects_on_actual_parameter_forward_translation(), constant_points_to_indices_p(), distance_between_entity(), do_atomize_call(), do_brace_expression_to_statements(), effect_words_reference(), entity_for_value_mapping_p(), entity_more_or_less_minimal_name(), extended_regions_must_convex_hull(), field_expression_p(), field_reference_expression_p(), get_dma_dimension(), get_sizeofexpression_for_region(), inline_expression_call(), isolate_patch_reference(), make_declarations_statement(), outliner_independent_recursively(), points_to_indices_to_subscript_indices(), points_to_indices_to_unbounded_indices(), points_to_reference_to_type(), proper_to_summary_simple_effect(), r_cell_reference_to_type(), reference_equal_p(), reference_to_field_disambiguator(), references_must_conflict_p(), safe_expression_to_transformer(), simple_reference_to_convex_reference_conversion(), store_independent_points_to_indices_p(), variable_references_may_conflict_p(), and variable_to_dimensions().

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

◆ entity_field_rank()

int entity_field_rank ( entity  f)

f is a field of a structure or of an union: what is its rank?

FI: positions are counted from 1 on; do we want to subtract 1?

Definition at line 940 of file entity.c.

941 {
942  int rank = -1;
944  type st = entity_type(su);
945  list fl = list_undefined;
946 
947  if(type_struct_p(st))
948  fl = type_struct(st);
949  else if(type_union_p(st))
950  fl = type_union(st);
951  else
952  pips_internal_error("Unexpected type tag %d", type_tag(st));
953 
954  pips_assert("st is a struct or union type",
955  type_struct_p(st) || type_union_p(st));
956 
957  /* FI: positions are counted from 1 on; do we want to subtract 1? */
958  rank = gen_position((void *) f, fl);
959 
960  if(rank==0) {
961  pips_internal_error("Field \"\%s\" is not part of its %s \"\%s\"",
962  entity_name(f), type_struct_p(st)?"structure":"union" , entity_name(su));
963  }
964 
965  return rank;
966 }
int gen_position(const void *item, const list l)
Element ranks are strictly positive as for first, second, and so on.
Definition: list.c:995
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
static entity rank
entity entity_field_to_entity_struct_or_union(entity f)
Definition: entity.c:925
#define type_struct(x)
Definition: ri.h:2964
#define type_struct_p(x)
Definition: ri.h:2962
#define type_tag(x)
Definition: ri.h:2940
#define type_union_p(x)
Definition: ri.h:2965
#define type_union(x)
Definition: ri.h:2967

References entity_field_to_entity_struct_or_union(), entity_name, entity_type, f(), gen_position(), list_undefined, pips_assert, pips_internal_error, rank, type_struct, type_struct_p, type_tag, type_union, and type_union_p.

Referenced by reference_to_field_disambiguator().

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

◆ entity_field_to_entity()

static entity entity_field_to_entity ( entity  f,
char  prefix 
)
static

f is a field of a structure: what is its structure?

To get the structure name, we have to drop the field part of f's name and to insert a struct prefix before the struct name. Maybe, it would have been better to keep the struct prefix in the field name.

structure name

get rid of the field name

can be done in place because the field name is at least one character long and because we also gain the field marker

Definition at line 879 of file entity.c.

880 {
882  const string sn = strdup(entity_name(f)); /* structure name */
883  string pos = strrchr(sn, MEMBER_SEP_CHAR);
884  string usn = string_undefined;
885  int usnl = 0;
886 
887  pips_assert("The entity is a field", pos!=NULL);
888 
889  *pos = '\0'; /* get rid of the field name */
890  usn = strdup(global_name_to_user_name(sn));
891  usnl = strlen(usn);
892  *(pos-usnl) = prefix;
893  /* can be done in place because the field name is at least one
894  character long and because we also gain the field marker */
895  (void) strcpy(pos-usnl+1, usn);
896  free(usn);
897 
898  pips_debug(8, "struct entity name is \"\%s\"\n", sn);
900  free(sn);
901 
902  return s;
903 }
const char * global_name_to_user_name(const char *global_name)
functions on strings for entity names
Definition: entity_names.c:136
void free(void *)
#define string_undefined
Definition: newgen_types.h:40
static const char * prefix

References entity_domain, entity_name, entity_undefined, f(), free(), gen_find_tabulated(), global_name_to_user_name(), MEMBER_SEP_CHAR, pips_assert, pips_debug, prefix, strdup(), and string_undefined.

Referenced by entity_field_to_entity_struct(), entity_field_to_entity_struct_or_union(), and entity_field_to_entity_union().

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

◆ entity_field_to_entity_struct()

entity entity_field_to_entity_struct ( entity  f)

To be able to breakpoint effectively

Definition at line 905 of file entity.c.

906 {
908 
909  /* To be able to breakpoint effectively */
910  if(entity_undefined_p(s))
911  pips_assert("entity s is defined", !entity_undefined_p(s));
912  return s;
913 }
#define STRUCT_PREFIX_CHAR
Definition: naming-local.h:57
static entity entity_field_to_entity(entity f, char prefix)
f is a field of a structure: what is its structure?
Definition: entity.c:879

References entity_field_to_entity(), entity_undefined_p, f(), pips_assert, and STRUCT_PREFIX_CHAR.

Referenced by offset_of_struct(), and same_struct_entity_p().

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

◆ entity_field_to_entity_struct_or_union()

entity entity_field_to_entity_struct_or_union ( entity  f)

To be able to breakpoint effectively

Definition at line 925 of file entity.c.

926 {
928 
929  if(entity_undefined_p(su))
931 
932  /* To be able to breakpoint effectively */
933  if(entity_undefined_p(su))
934  pips_assert("entity s is defined", !entity_undefined_p(su));
935 
936  return su;
937 }
#define UNION_PREFIX_CHAR
Definition: naming-local.h:59

References entity_field_to_entity(), entity_undefined_p, f(), pips_assert, STRUCT_PREFIX_CHAR, and UNION_PREFIX_CHAR.

Referenced by entity_field_rank(), inline_expression_call(), and outliner_independent_recursively().

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

◆ entity_field_to_entity_union()

entity entity_field_to_entity_union ( entity  f)

To be able to breakpoint effectively

Definition at line 915 of file entity.c.

916 {
918 
919  /* To be able to breakpoint effectively */
920  if(entity_undefined_p(u))
921  pips_assert("entity s is defined", !entity_undefined_p(u));
922  return u;
923 }

References entity_field_to_entity(), entity_undefined_p, f(), pips_assert, and UNION_PREFIX_CHAR.

+ Here is the call graph for this function:

◆ entity_formal_p()

bool entity_formal_p ( entity  p)

◆ entity_function_p()

bool entity_function_p ( entity  e)

Definition at line 724 of file entity.c.

725 {
726  type
727  t_ent = entity_type(e),
728  t = (type_functional_p(t_ent) ?
731 
732  return(entity_module_p(e) &&
733  !type_undefined_p(t) &&
734  !type_void_p(t));
735 }
#define type_undefined_p(x)
Definition: ri.h:2884
#define type_void_p(x)
Definition: ri.h:2959

References entity_module_p(), entity_type, functional_result, type_functional, type_functional_p, type_undefined, type_undefined_p, and type_void_p.

Referenced by call_selection(), do_gpu_qualify_pointers(), do_inlining(), entities_maymust_conflict_p(), entity_subroutine_p(), freia_create_helper_function(), make_host_and_node_modules(), MakeEntry(), outliner_parameters(), outliner_scan(), retype_formal_parameters(), run_inlining(), search_1r_function_call(), xml_Arguments(), xml_Call(), and xml_Chain_Graph().

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

◆ entity_global_name()

string entity_global_name ( entity  e)

◆ entity_in_common_p()

bool entity_in_common_p ( entity  e)

Definition at line 1082 of file entity.c.

1083 {
1084  storage s = entity_storage(e);
1085 
1086  return(storage_ram_p(s) &&
1088 }
bool entity_special_area_p(entity e)
Definition: area.c:154

References entity_special_area_p(), entity_storage, ram_section, storage_ram, and storage_ram_p.

Referenced by compare_effect_reference_in_common(), debug_ref_rwt(), effect_words_reference(), entity_hpf_number(), hpfc_main_entity(), NormalizeCommonVariables(), and STATIC_LIST_OF_HPF_OBJECTS().

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

◆ entity_in_formal_area_p()

bool entity_in_formal_area_p ( entity  e)

Formal parameters do not use the standard ram storage.

However, a formal area is used for points-to stubs

Definition at line 3196 of file entity.c.

3197 {
3198  bool in_p = false;
3199  storage s = entity_storage(e);
3200  if(storage_ram_p(s)) {
3201  ram r = storage_ram(s);
3202  entity a = ram_section(r);
3203  in_p = formal_area_p(a);
3204  }
3205  return in_p;
3206 }
bool formal_area_p(entity aire)
Definition: area.c:95

References entity_storage, formal_area_p(), ram_section, storage_ram, and storage_ram_p.

Referenced by transformer_general_consistency_p().

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

◆ entity_in_list_p()

bool entity_in_list_p ( entity  ent,
list  ent_l 
)

look for ent in ent_l

Parameters
ententity to find
ent_llist to scan
Returns
true if ent belongs to ent_l
Parameters
entnt
ent_lnt_l

Definition at line 2221 of file entity.c.

2222 {
2223  return !gen_chunk_undefined_p(gen_find_eq(ent,ent_l));
2224 }
#define gen_chunk_undefined_p(c)
Definition: genC.h:75
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422

References gen_chunk_undefined_p, and gen_find_eq().

Referenced by array_bound_check_instrumentation(), copy_write_statement(), copy_write_statement_with_cumulated_regions(), entity_to_declaring_statement_aux(), full_loop_unroll(), initialize_and_verify_common_variable(), and prepare_context().

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

◆ entity_intrinsic()

entity entity_intrinsic ( const char *  name)

FI: I do not understand this function name (see next one!).

It seems to me that any common or user function or user subroutine would be returned. FI: assert condition made stronger (18 December 1998)

Parameters
nameame

Definition at line 1292 of file entity.c.

1293 {
1296  name,
1297  NULL),
1298  entity_domain);
1299 
1300  pips_assert("entity_intrinsic", e != entity_undefined
1301  && intrinsic_entity_p(e));
1302  return(e);
1303 }

References concatenate(), entity_domain, entity_undefined, gen_find_tabulated(), intrinsic_entity_p(), MODULE_SEP_STRING, pips_assert, and TOP_LEVEL_MODULE_NAME.

Referenced by add_exec_mmcd(), add_pvm_init_and_end(), alloc_instrumentation(), any_basic_update_operation_to_transformer(), any_basic_update_to_transformer_list(), arithmetic_intrinsic_p(), array_scalar_access_to_bank_communication(), basic_to_generic_conversion(), basic_update_reflhs_with_rhs_to_transformer(), binary_to_nary(), bound_to_statement(), buffer_full_condition(), build_flag_assign(), build_flag_test(), build_global_time_test_with_exp(), build_local_time_test(), c_reference(), call_flt(), call_STEP_subroutine3(), clean_statement(), compile_master(), compute_final_index_value(), compute_region(), constraint_to_bound(), constraints_to_loop_bound(), convert_bound_expression(), convert_pointer_to_array(), convert_pointer_to_array_aux(), copy_write_statement_with_cumulated_regions(), ctx_generate_new_statement_cluster_dependant(), derived_formal_parameter_to_stub_points_to(), dimensions_to_dma(), do_array_expansion(), do_array_to_pointer_walk_call_and_patch(), do_array_to_pointer_walk_expression(), do_check_isolate_statement_preconditions_on_call(), do_convert_to_c_operator(), do_convert_to_standard_operators(), do_isolate_statement_preconditions_satisified_p(), do_linearize_array_manage_callers(), do_linearize_pointer_is_expression(), do_loop_expansion(), do_loop_to_for_loop(), do_loop_to_while_loop(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_outliner_smart_replacment(), do_simplify_c_operator(), do_solve_hardware_constraints_on_nb_proc(), do_split_structure(), do_terapix_argument_handler(), do_terapix_loop_optimizer(), do_terapix_remove_divide(), do_terapix_warmup_patching(), expr_compute_local_index(), expression_list_to_conjonction(), expression_plusplus(), fcs_call_flt(), fix_if_condition(), forloop_test(), free_guards(), gen_if_rank(), generate_bminus(), Generate_C_ReturnStatement(), generate_compact(), generate_fifo_stat(), generate_mmcd_stat_from_ref(), generate_monome(), get_bounds_expression(), get_expression_addr(), get_fifoExp_from_ref(), gfc2pips_expr2expression(), guard_expanded_statement(), heap_intrinsic_to_post_pv(), hpfc_add_2(), hpfc_add_n(), hpfc_compile(), if_conv_init_statement(), incrementation_expression_to_increment(), initialization_list_to_statements(), initialize_array_variable(), inline_expression_call(), instruction_selection(), int_to_expression(), inv_call_flt(), inverse_operator_of(), io_intrinsic_p(), isolate_patch_reference(), loop_annotate(), loop_inc(), loop_strip_mine(), loop_test(), make_array_communication_statement(), make_assign_instruction(), make_binary_call_statement(), make_body_from_loop(), make_bound_expression(), make_call_statement(), make_condition_from_loop(), make_constraint_expression(), make_continue_instruction(), make_expression_with_state_variable(), make_factor_expression(), make_fields_assignment_instruction(), make_guard_expression(), make_increment_instruction(), make_increment_statement(), make_init_time(), make_lInitStats(), make_loadsave_statement(), make_loop_step_stat(), make_lSwitchStats(), make_max_expression(), make_min_expression(), make_mmcd_load_store_stat(), make_scalar_communication_module(), make_send_receive_conversion(), make_simple_Fortran_io_instruction(), make_start_ru_module(), make_state_variable_assignement_statement(), make_step_inc_statement(), make_toggle_inc_statement(), make_transStat(), make_vecteur_expression(), MakeAssignInst(), MakeAtom(), MakeCaseStatement(), MakeForloop(), makeTransfertSizeExpression(), MakeWhileDoInst(), merge_expressions(), mpic_make_generic_mpi_receive_call(), mpic_make_generic_mpi_send_call(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), mpic_make_mpi_finalize(), mpic_make_mpi_init(), normalize_microcode(), optimize_simplify_nary_patterns(), outliner_extract_loop_bound(), outliner_patch_parameters(), outliner_smart_references_computation(), partial_eval_binary_operator_old(), partial_eval_mult_operator(), partial_eval_plus_or_minus_operator(), phi_free_contraints_to_expressions(), process_innerStat1_proc(), Psysteme_to_expression(), Psysteme_to_loop_nest(), re_do_it(), reduction_operator_entity(), reference_filter(), regenerate_call(), regenerate_expression(), region_to_address(), region_to_minimal_dimensions(), remove_unread_variable(), rename_op(), replace_field_by_reference_walker(), replace_reductions_in_statement(), replace_subscript(), scalopify(), sesamify(), set_resources_for_module(), simdizer_auto_tile(), simplify_C_expression(), split_update_call(), st_make_nice_test(), st_send_to_computer_if_necessary(), statement_insertion_fix_access(), statement_phi_function_p(), string_to_expression(), switch_nary_to_binary(), terapix_loop_optimizer(), terapix_normalize_tests(), top_down_abc_not_exact_case(), try_reorder_expression_call(), typedef_formal_parameter_to_stub_points_to(), unsugared_loop_inc(), unsugared_loop_test(), update_indices_for_local_computation(), update_operator_to_regular_operator(), update_range(), update_test_condition(), variable_to_dimensions(), verify_array_variable(), and whileloop_test().

+ Here is the call graph for this function:

◆ entity_ith_bounds()

expression entity_ith_bounds ( entity  e,
int  i 
)

FIND_MODULE returns entity.

Argument is module_name This function should be replaced by local_name_to_top_level_entity() ntity FindEntity(_module(name) string name; { string full_name = concatenate(TOP_LEVEL_MODULE_NAME, MODULE_SEP_STRING, name, NULL); entity e = gen_find_tabulated(full_name, entity_domain);

return(e); } END_EOLE returns a range expression containing e's i-th bounds

Definition at line 1626 of file entity.c.

1627 {
1628  dimension d = entity_ith_dimension(e, i);
1632  int_to_expression(1)));
1634 }
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
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
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...
Definition: variable.c:1228
#define normalized_undefined
Definition: ri.h:1745
#define dimension_lower(x)
Definition: ri.h:980
@ is_syntax_range
Definition: ri.h:2692
#define dimension_upper(x)
Definition: ri.h:982

References copy_expression(), dimension_lower, dimension_upper, entity_ith_dimension(), int_to_expression(), is_syntax_range, make_expression(), make_range(), make_syntax(), and normalized_undefined.

+ Here is the call graph for this function:

◆ entity_label_p()

bool entity_label_p ( entity  e)

Definition at line 678 of file entity.c.

679 {
680  return type_statement_p(entity_type(e));
681 }
#define type_statement_p(x)
Definition: ri.h:2941

References entity_type, and type_statement_p.

Referenced by find_implicit_goto(), is_label_statement(), and type_this_call().

+ Here is the caller graph for this function:

◆ entity_list_p()

bool entity_list_p ( list  el)

Checks that el only contains entity.

Parameters
ell

Definition at line 1411 of file entity.c.

1412 {
1413  bool pure = true;
1414 
1415  FOREACH(ENTITY, e, el)
1416  {
1417  static entity le = entity_undefined;
1418  pips_debug(10, "Entity e in list is \"%s\"\n", safe_entity_name(e));
1420  pips_debug(8, "Last entity le in list is \"%s\"\n", safe_entity_name(le));
1421  pure = false;
1422  break;
1423  }
1424  le = e;
1425  }
1426  return pure;
1427 }
string safe_entity_name(entity e)
predicates and functions for entities
Definition: entity.c:433
#define entity_domain_number(x)
Definition: ri.h:2788

References ENTITY, entity_domain, entity_domain_number, entity_undefined, FOREACH, pips_debug, and safe_entity_name().

Referenced by AddToExterns(), CheckExternList(), FindOrCreateCurrentEntity(), get_symbol_table(), and module_entities().

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

◆ entity_list_to_base()

Pbase entity_list_to_base ( list  l)

Definition at line 2860 of file entity.c.

2862 {
2863  list l2 = gen_nreverse(gen_copy_seq(l));
2864  Pbase result = BASE_NULLE;
2865  FOREACH(ENTITY, e, l2)
2866  {
2867  Pbase new = (Pbase) vect_new((Variable) e, VALUE_ONE);
2868  new->succ = result;
2869  result = new;
2870  }
2871 
2872  gen_free_list(l2);
2873  return(result);
2874 }
#define VALUE_ONE
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
struct Svecteur * succ
Definition: vecteur-local.h:92
struct Svecteur * Pbase
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 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...
Definition: alloc.c:110

References BASE_NULLE, ENTITY, FOREACH, gen_copy_seq(), gen_free_list(), gen_nreverse(), Svecteur::succ, VALUE_ONE, and vect_new().

Referenced by generate_remapping_code(), hpfc_algorithm_row_echelon(), hpfc_algorithm_tiling(), and verify_array_variable().

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

◆ entity_local_name()

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 that it was pertinent to remove the special care of constants there.

So I added something here, to deal with the "null" entity which codes the constant. FC 28/11/94. SG: should return a const pointer

Definition at line 453 of file entity.c.

454 {
455  const char* null_name = "null";
456  pips_assert("entity is defined", !entity_undefined_p(e));
457  pips_assert("constant term or entity",
458  e==NULL || entity_domain_number(e)==entity_domain);
459  return e==NULL ? null_name : local_name(entity_name(e));
460 }

References entity_domain, entity_domain_number, entity_name, entity_undefined_p, local_name(), and pips_assert.

Referenced by abc_with_allocation_size(), abstract_locations_max(), add_array_dimension_bound_test(), add_call_to_callees(), add_conflicts(), add_constraint_on_x(), add_formal_to_actual_bindings(), add_loop_index_exit_value(), add_new_module_from_text(), add_non_declared_reference_to_declaration(), add_or_kill_equivalenced_variables(), add_parameter_variable_to_module(), add_private_variable_to_module(), add_reduction(), add_symbolic_constant_to_declaration(), add_synonym_values(), AddCommonToModule(), AddEntityToModule(), AddEntityToModuleCompilationUnit(), address_of_value_entity_p(), AddToCalledModules(), AddVariableToCommon(), adg_fprint_psysteme(), adg_fprint_sc_pvecteur(), adg_get_integer_entity(), adg_print_graph(), adg_rename_entities(), align_indices_p(), AnalyzeData(), anonymous_type_p(), any_assign_operation_to_transformer(), any_expression_to_transformer(), any_scalar_assign_to_transformer_list(), any_scalar_assign_to_transformer_without_effect(), any_use_statement(), arguments_are_something(), atinit(), atomizer_of_loop(), atomizer_of_test(), better_elim_var_with_eg(), binary_arithmetic_operator_to_post_pv(), binary_to_nary(), boolean_intrinsic_call_condition_to_points_to(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), bound_distribution(), bound_generation(), bound_parameter_name(), build_list_of_min(), build_new_ref(), build_sc_machine(), build_sc_with_several_uniform_ref(), build_third_comb(), build_written_list(), c_call(), c_entity_local_name(), c_io_function_to_post_pv(), c_return_to_transformer(), c_statement(), c_text_related_entities(), c_user_function_call_to_transformer(), call_instruction_to_communications(), call_rwt(), call_to_post_pv(), call_to_wp65_code(), CCompilationUnitMemoryAllocations(), check_io_list(), check_one_common(), check_range_wrt_precondition(), check_simple(), check_the_reference(), check_this_loop(), CheckLeftHandSide(), clean_distributed_io_system(), clean_shared_io_system(), CleanUpEntity(), common_variable_in_module_scope_p(), comp_regions_of_instruction(), comp_regions_of_loop(), comparable_entity_in_list_p(), compare_coeff(), complex_constant_expression_p(), compute_distribution_context(), compute_distribution_controlization_context(), compute_iteration_domain(), compute_points_to_kill_set(), compute_regions_union(), ComputeAddresses(), constant_to_transformer(), constraint_distribution(), constraint_to_bound(), constraints_to_loop_bound(), contexts_mapping_of_nest(), controlize_distribution(), convert_constant_from_double_to_real(), convert_constant_from_int_to_double(), convert_constant_from_int_to_real(), convert_constant_from_real_to_double(), convert_constant_from_real_to_int(), copy_from_call(), copy_from_statement(), copy_to_call(), copy_to_statement(), create_HRE_module(), create_init_common_param_for_arrays(), create_init_common_param_for_processors(), create_init_common_param_for_templates(), create_local_index(), create_local_index2(), create_new_ent_list(), create_scalar_stub_sink_cell(), create_stub_entity(), create_tile_basis(), CreateReturnEntity(), cute_convex_union(), dag_append_freia_call(), dag_normalize(), dagvtx_copy_list_dot(), dataflows_on_reference(), davinci_dump_expression_rc(), dead_fcd_directive_p(), declare_common_variables_in_module(), DeclarePointer(), DeclareVariable(), default_common_hook(), defs_elim_of_statement(), directive_filter(), distribution_format(), do_check_isolate_statement_preconditions_on_call(), do_gpu_qualify_pointers(), dprint(), dump_common_layout(), ecrit_coeff1(), ecrit_commentaire2(), ecrit_une_var(), ecrit_une_var_neg(), edge_weight(), effect_indices_first_pointer_dimension_rank(), egalite_debug(), entity_all_locations_p(), entity_all_module_heap_locations_typed(), entity_all_module_locations(), entity_all_module_locations_p(), entity_all_module_xxx_locations(), entity_all_module_xxx_locations_p(), entity_all_xxx_locations_p(), entity_allocatable_p(), entity_and_common_name(), entity_blockdata_p(), entity_common_p(), entity_empty_label_p(), entity_enum_p(), entity_f95module_p(), entity_field_p(), entity_flow_or_context_sentitive_heap_location_p(), entity_freia_api_p(), entity_heap_location_p(), entity_hpf_number(), entity_in_module(), entity_locations_max(), entity_module_unambiguous_user_name(), entity_more_or_less_minimal_name(), entity_struct_p(), entity_stub_sink_p(), entity_typed_anywhere_locations_p(), entity_typed_nowhere_locations_p(), entity_union_p(), entity_xml_parameter_p(), eov_add_entity_to_eliminate(), equiv_class_debug(), equivalent_entity_compare(), eval_var(), EvalConstant(), expand_call(), expression_equal_in_context_p(), expression_implied_do_p(), expression_int_scalar(), expression_less_than_in_context(), expression_list_directed_p(), expression_null_p(), expression_reference_number(), expression_to_float(), expression_to_int(), expression_to_polynome(), expression_to_post_pv(), external_call_to_post_pv(), external_value_name(), extract_lambda_list(), extract_stat_lunk(), fcd_directive_p(), fcs_count(), fill_HRE_module(), find_entity(), find_implicit_equation(), find_implicit_goto(), find_iteration_domain(), find_loop_with_name(), find_or_create_emulated_shared_variable(), find_or_create_newInd(), fix_sequence_statement_attributes(), fix_storage(), flatten_code(), for_to_do_loop_conversion(), formal_label_replacement_p(), fortran_library_entity_p(), fortran_user_call_to_transformer(), fortran_user_function_call_to_transformer(), fprint_bdt(), fprint_bdt_with_stat(), fprint_call(), fprint_coef_list(), fprint_entity_list(), fprint_message(), fprint_psysteme(), fprint_sc_pvecteur(), fprint_vv(), fprint_wp65_hash_tables(), freia_allocate_new_images_if_needed(), freia_cleanup_sequence_rec(), freia_data2d_field(), freia_image_variable_p(), freia_is_transpose_call(), freia_reduction_variable(), freia_spoc_pipeline(), fsi_seq_flt(), generate_all_liveness_but(), generate_code_loop(), generate_dynamic_liveness_for_primary(), generate_io_statements_for_shared_arrays(), generate_one_message(), generate_remapping_code(), generate_scalar_variables(), generate_scalar_variables_from_list(), generate_wiring(), GENERATION(), generic_c_words_simplified_entity(), generic_equality_to_transformer(), generic_function_to_return_value(), generic_stub_source_to_sinks(), GenericCleanEntities(), get_common_param_name(), get_controlized_statement_comment(), get_dynamic_variable_name(), get_externalized_function_param_name(), get_externalized_function_private_param_name(), get_function_common_name(), get_function_id_name(), get_in_param_id_name(), get_m_coef(), get_nlc_number(), get_number_of_ins(), get_operator_id(), get_out_param_id_name(), get_ppt(), get_receive_param_module_name(), get_ref_var_param_name(), get_send_param_module_name(), get_special_prettyprint_for_operator(), gfc2pips_add_to_callees(), gfc2pips_computeAdressesOfArea(), gfc2pips_generate_parameters_list(), gfc2pips_namespace(), gfc2pips_vars_(), global_intermediate_value_p(), global_old_value_p(), gpips_main(), handle_set_directive(), heap_cell_p(), heap_effect(), heap_effect_p(), heap_intrinsic_to_post_pv(), host_section_p(), hpf_directive_entity_p(), hpfc_intrinsic_like_function(), hpfc_io_like_function(), impact_check_two_scalar_variables_in_path(), implicit_type_p(), ImplicitType(), implied_do_reference_number(), inegalite_debug(), init_c_implicit_variables(), inline_expression_call(), inlining_regenerate_labels(), insert_check_alias_before_statement(), insert_impact_description_as_comment(), insert_one_type_declaration(), insert_test_before_statement(), interprocedural_abc_arrays(), interprocedural_abc_call(), interprocedural_mapping(), intrinsic_to_post_pv(), inv_call_flt(), io_comp_regions(), io_filter(), io_loop_nest_p(), Is_Associative_Commutative(), is_index_coeff_p(), is_mu_coeff_p(), is_mu_stat_in_sc(), IsBinaryOperator(), IsNaryOperator(), IsUnaryOperator(), lexicographic_order_p(), load_summary_transformer(), local_intermediate_value_entity_p(), local_old_value_entity_p(), local_temporary_value_entity_p(), local_tile_constraints(), look_for_the_best_counter(), loop_bounds_to_tile_bounds(), loop_iteration_domaine_to_sc(), loop_nest_movement_generation(), loop_nest_to_local_variables(), loop_nest_to_wp65_code(), loop_to_complexity(), make_array_communication_module(), make_array_communication_statement(), make_base_phi_variables(), make_bounds(), make_communication_statement(), make_context_of_loop(), make_emulated_shared_variable(), make_filtered_dg_or_dvdg(), make_global_common_and_initialize(), make_global_entity_from_local(), make_host_and_node_modules(), make_layout_statement(), make_load_blocks(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), make_new_entity(), make_new_local_variables(), make_new_simd_vector_with_prefix(), make_nlc_entity(), make_nsp_entity(), make_nub_entity(), make_return_statement(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_shared_statement(), make_start_ru_module(), make_statement_copy_i(), make_store_blocks(), make_tile_constraints(), MakeAssignInst(), MakeAtom(), MakeComplexConstant(), MakeCurrentFunction(), MakeCurrentModule(), MakeEntry(), MakeEntryCommon(), MakeEquivAtom(), MakeFormalParameter(), MakeIoInstA(), MakeParameter(), MakeReturn(), MakeStatement(), MakeVariableStatic(), malloc_arg_to_type(), maybe_unroll_while_rwt(), module_codefilename(), module_entitiesfilename(), module_fortranfilename(), module_name_to_preconditions(), module_name_to_total_preconditions(), module_par_codefilename(), module_par_fortranfilename(), module_pp_fortranfilename(), module_predicat_fortranfilename(), module_resource_name(), module_to_all_declarations(), module_to_callees(), module_to_dynamic_area(), module_to_heap_area(), module_to_value_mappings(), module_to_wp65_modules(), movement_computation(), my_build_new_ref(), nary_operator_p(), new_elim_var_with_eg(), new_local_image_variable(), new_synonym(), normal_expression_of_statement(), normal_loop_p(), nowhere_source_to_sinks(), null_source_to_sinks(), oi_call_rwt(), old_value_entity_p(), only_minor_statements_in_between(), operator_expression_p(), outliner_independent_recursively(), parametric_transformer_empty_p(), partial_eval_binary_operator(), partial_eval_binary_operator_old(), pip_solve_min_with_big(), pips_main(), pips_region_user_name(), place_holder_variable_p(), plc_elim_var_with_eg(), plc_fprint_proto(), plc_make_distance(), points_to_cell_translation(), points_to_compare_cells(), points_to_compare_ptr_cell(), points_to_reference_to_typed_index(), pragma_omp_p(), pragma_PRAGMA_DISTRIBUTED_p(), prepare_reindexing(), prettyprint_dependence_graph(), prettyprint_dependence_graph_view(), print_any_transformer(), print_common_layout(), print_fullname_base(), print_list_of_entities(), print_op_schedule(), print_or_dump_points_to(), print_points_to_cells(), print_reference_list(), process_static_initialization(), process_true_call_stat(), process_value_list(), propagation_on_remapping_graph(), proper_comp_regions_of_intrinsic(), pu_variable_name(), pu_vect_fprint(), put_variables_in_ordered_lists(), read_statement_with_write_effect_on_array_subscript(), readable_value_name(), realign_directive_p(), recursive_rename_types(), redistribute_directive_p(), ref_found_p(), ref_in_implied_do(), reference_conflicting_test_and_update(), reference_list_print(), reference_written_p(), referencenodeclfilter(), references_for_regions(), region_dynamic_var_elim(), region_entity_variable_to_new_declare_entity(), regions_transformer_apply(), related_effect(), related_images_p(), relation_to_transformer(), remapping_file_name(), remove_ghost_variable_entities(), remove_variables_from_system(), remove_variables_if_possible(), rename_directive_p(), rename_loop_index(), rename_reference(), rename_statement_declarations(), RenameFunctionEntity(), replicate_declaration(), retype_formal_parameters(), rewrite_modulo_expression(), rice_loop(), rice_update_dependence_graph(), sa_print_ins(), safe_load_primary_entity(), SafeLocalToGlobal(), same_entity_lname_p(), SaveChains(), SaveEntity(), sc_image_computation(), sc_proj_on_di(), sc_projection_optim_along_vecteur_ofl(), sc_syst_debug(), scalar_postlude(), sctc_call_rwt(), sentence_area(), sentence_basic_declaration(), sentence_data(), sentence_external(), sentence_f95use_declaration(), sentence_goto(), sentence_symbolic(), separate_variables(), separate_variables_2(), set_dimensions_of_local_variable_family(), simd_load_call_p(), simd_replace_parameters(), simd_store_call_p(), simd_work_call_p(), simple_addition_to_transformer(), simplify_C_expression(), simplify_relational_expression(), sio_call_flt(), sizeof_value_entity_p(), skip_cast_and_addop_expression(), sort_unknowns(), spire_distributed_unstructured_to_structured(), st_call(), st_declaration(), st_entity_local_name(), st_one_message(), statement_flatten_declarations(), statement_remove_omp_clauses(), statement_to_label(), statement_with_at_most_one_expression_integer(), statement_with_at_most_one_integer_or_character(), statement_without_argument(), static_controlize_call(), store_a_lower(), store_an_upper(), store_initial_value(), subarray_shift_assignment_p(), substitute_unbounded_call(), SubstituteDummyParameters(), swis_call_flt(), switch_generic_to_specific(), terapix_renamed_entity_p(), TestDiVariables(), text_entity_declaration(), text_equivalence_class(), text_equivalences(), text_loop(), text_loop_cmf(), text_loop_craft(), text_loop_default(), text_whileloop(), this_entity_xmldeclaration(), tile_hyperplane_constraints(), tile_membership(), tile_membership_constraints(), tiling_transformation(), tpips_init(), tpips_main(), transfert_statement(), transformer_add_integer_relation_information(), transformer_add_loop_index_incrementation(), transformer_combine(), transformer_general_consistency_p(), transformer_internal_consistency_p(), transformer_normalize(), translate_global_value(), translate_IO_ref(), translate_to_module_frame(), TranslateEntryFormals(), type_this_call(), type_this_entity_if_needed(), type_this_instruction(), type_to_named_type(), typing_arguments_of_user_function(), typing_buffer_inout(), typing_function_argument_type_to_return_type(), typing_implied_do(), typing_of_assign(), unary_minus_operation_to_transformer(), unbounded_dimension_p(), unbounded_entity_p(), undefined_pointer_value_entity_p(), update_called_modules(), update_functional_type_with_actual_arguments(), update_map(), update_operation_to_transformer(), update_operator_to_post_pv(), update_range(), update_runtime_for_remapping(), update_summary_precondition(), update_written_variables(), UpdateEntity(), UpdateEntity2(), UseFormalArguments(), user_call_to_points_to_sinks(), variable_in_declaration_module_p(), variable_list_update(), variable_to_abstract_location(), vect_debug(), verify_used_before_set_call(), what_operator(), where_to_perform_operation(), words_assign_op(), words_basic(), words_cmf_loop_range(), words_common_variable(), words_entity_list(), words_infix_binary_op(), words_infix_nary_op(), words_intrinsic_call(), words_intrinsic_precedence(), words_io_control(), words_io_inst(), words_loop_list(), words_loop_range(), words_nullary_op_c(), words_nullary_op_fortran(), words_omp_red(), words_parameters(), words_postfix_unary_op(), words_prefix_unary_op(), words_range(), words_regular_call(), words_stat_io_inst(), words_subscript_range(), wpips_main(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_entity_local_name(), xml_loop_from_loop(), and xml_loop_from_sequence().

+ Here is the call graph for this function:

◆ entity_local_variable_p()

bool entity_local_variable_p ( entity  var,
entity  module 
)

Check if a variable "var" is local to a module "module".

A variable is local to a module:

  • if it has been allocated in one of the module areas such as STATIC, DYNAMIC,...
  • if it is a formal parameter passed by value, that is a C scalar formal parameter; note that a scalar can be a structure or a union.

it might be better to check the parameter passing mode itself, via the module type

Parameters
varar
moduleodule

Definition at line 3104 of file entity.c.

3104  {
3105  bool local = false;
3106 
3107  if(storage_ram_p(entity_storage(var))) {
3108  ram r = storage_ram(entity_storage(var));
3109  if(same_entity_p(module, ram_function(r))) {
3110  entity section = ram_section(r);
3112  local=true;
3113  }
3114  }
3115  } else if( storage_formal_p(entity_storage(var))) {
3116  /* it might be better to check the parameter passing mode itself,
3117  via the module type */
3118  bool fortran_p = fortran_module_p(module);
3119  bool scalar_p = entity_scalar_p(var);
3120 
3122  if(!fortran_p && scalar_p && same_entity_p(module, formal_function(r))) {
3123  local=true;
3124  }
3125  }
3126  pips_debug(4,"Looked if variable %s is local to function %s, result is %d\n",
3127  entity_name(var), entity_name(module), local);
3128  return local;
3129 }
#define same_string_p(s1, s2)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define storage_formal_p(x)
Definition: ri.h:2522
#define storage_formal(x)
Definition: ri.h:2524
#define formal_function(x)
Definition: ri.h:1406

References entity_module_name(), entity_name, entity_scalar_p(), entity_storage, entity_user_name(), formal_function, fortran_module_p(), module, pips_debug, ram_function, ram_section, same_entity_p(), same_string_p, storage_formal, storage_formal_p, storage_ram, and storage_ram_p.

Referenced by do_check_isolate_statement_preconditions_on_call().

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

◆ entity_main_module_p()

◆ entity_module_name()

const char* entity_module_name ( entity  e)

See comments about module_name().

Its result is transient and must be strduped.

Definition at line 1092 of file entity.c.

1093 {
1094  return module_name(entity_name(e));
1095 }
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296

References entity_name, and module_name().

Referenced by abstract_locations_max(), array_location_entity_of_module_p(), array_need_bound_check_p(), cell_reference_compare(), check_one_common(), clean_distributed_io_system(), clean_shared_io_system(), CleanUpEntity(), common_region_translation(), constant_memory_access_path_to_location_name(), create_stub_entity(), do_terapix_argument_handler(), dprint(), dump_common_layout(), effect_on_non_local_variable_p(), entity_all_locations_p(), entity_all_xxx_locations_p(), entity_any_module_p(), entity_hpfc_dummy_p(), entity_local_variable_p(), entity_more_or_less_minimal_name(), entity_name_without_scope(), entity_to_module_entity(), eov_add_entity_to_eliminate(), expression_reference_number(), FixCInternalLabels(), function_return_value_p(), Generate_C_ReturnLabel(), generic_make_entity_copy_with_new_name(), global_intermediate_value_p(), global_new_value_to_global_old_value(), global_old_value_p(), global_variable_p(), initialize_and_verify_common_variable(), inline_expression_call(), insert_common_declaration(), interprocedural_abc_arrays(), local_entity_of_current_function_p(), local_entity_of_module_p(), location_entity_of_module_p(), make_location_entity(), make_new_index_entity(), make_statement_copy_i(), new_synonym(), opgen_may_module(), opgen_must_module(), precondition_intra_to_inter(), print_C_common_layout(), print_common_layout(), print_fullname_base(), print_or_dump_points_to(), print_points_to_cells(), reference_to_address_entity(), remapping_file_name(), remove_variable_entity(), replicate_declaration(), return_value_p(), set_current_function(), split_initializations_in_statement(), static_global_variable_p(), top_level_entity_p(), transformer_general_consistency_p(), translate_global_value(), translate_to_module_frame(), undefined_pointer_value_entity_p(), UpdateFormalStorages(), used_before_set(), variable_in_module_p(), and variable_in_module_p2().

+ Here is the call graph for this function:

◆ entity_module_p()

bool entity_module_p ( entity  e)

Functional typedef also have value code ...

Definition at line 683 of file entity.c.

684 {
685  if(typedef_entity_p(e))
686  /* Functional typedef also have value code ... */
687  return false;
688  else {
689  value v = entity_initial(e);
690  return v!=value_undefined && value_code_p(v);
691  }
692 }
bool typedef_entity_p(entity e)
Definition: entity.c:1902

References entity_initial, typedef_entity_p(), value_code_p, and value_undefined.

Referenced by add_common_variables_to_hash_table(), add_formal_parameters_to_hash_table(), add_formal_to_actual_bindings(), add_module_call_site_precondition(), add_parameter_variable_to_module(), add_private_variable_to_module(), AddEntityToModule(), c_text_related_entities(), compute_SENDRECV_regions(), current_module(), entity_blockdata_p(), entity_common_p(), entity_f95module_p(), entity_function_p(), entity_main_module_p(), entity_subroutine_p(), entity_to_formal_integer_parameters(), entity_to_module_entity(), expression_to_transformer(), find_ith_parameter(), formal_and_actual_parameters_association(), fprint_any_environment(), functional_call_p(), get_module_precondition(), get_referenced_entities_filtered(), get_symbol_table(), global_parallelization(), in_regions_of_external(), interactive_loop_transformation(), ith_parameter_p(), language_module_p(), load_body_effects(), load_module_intraprocedural_effects(), load_summary_effects(), load_summary_precondition(), load_summary_reductions(), load_summary_total_postcondition(), load_summary_transformer(), module_formal_parameters(), module_to_formal_analyzable_parameters(), module_to_value_mappings(), pr_call_flt(), print_module_name_to_toposorts(), pure_function_p(), put_summary(), regions_of_external(), remove_common_variables_from_hash_table(), remove_formal_parameters_from_hash_table(), remove_variable_entity(), replace_formal_parameters_by_real_ones(), sc_entity_to_formal_integer_parameters(), set_current_module_entity(), step_translate_and_map_step_regions(), text_initializations(), translate_reductions(), update_summary_precondition(), update_user_common_layouts(), user_call_to_transformer(), and verify_used_before_set_call().

+ Here is the call graph for this function:

◆ entity_name_or_TCST()

const char* entity_name_or_TCST ( entity  e)

Return a name valid for sorting variables in vectors and constraint systems.

Returns
the name or "TCST" if the entity is null.

Definition at line 627 of file entity.c.

628 {
629  if (e != NULL)
630  return entity_name(e);
631  else
632  return "TCST";
633 }

References entity_name.

Referenced by make_bound_expression(), and vect_change_base().

+ Here is the caller graph for this function:

◆ entity_name_without_scope()

string entity_name_without_scope ( entity  e)

allocates a new string

Definition at line 543 of file entity.c.

544 {
545  string en = entity_name(e);
546  const char* mn = entity_module_name(e);
547  string ns = strrchr(en, BLOCK_SEP_CHAR);
548  string enws = string_undefined;
549 
550  if(ns==NULL)
551  enws = strdup(en);
552  else
553  enws = strdup(concatenate(mn, MODULE_SEP_STRING, ns+1, NULL));
554 
555  pips_debug(9, "entity name = \"%s\", without scope: \"%s\"\n",
556  en, enws);
557 
558  return enws;
559 }

References BLOCK_SEP_CHAR, concatenate(), entity_module_name(), entity_name, MODULE_SEP_STRING, pips_debug, strdup(), and string_undefined.

+ Here is the call graph for this function:

◆ entity_not_constant_or_intrinsic_p()

bool entity_not_constant_or_intrinsic_p ( entity  e)

Default entity filter for get_referenced_entities()

It filters out constants and intrinsics

It should have been named entity_neither_constant_nor_intrinsic_p()...

Definition at line 3050 of file entity.c.

3050  {
3051  return !entity_constant_p(e) && ! intrinsic_entity_p(e);
3052 }
#define entity_constant_p(e)

References entity_constant_p, and intrinsic_entity_p().

Referenced by do_group_statement_constant_prune(), entity_for_value_mapping_p(), entity_not_undefined_nor_constant_nor_intrinsic_p(), get_referenced_entities(), skip_constants_intrinsics_members(), and wipeout_entity().

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

◆ entity_pointer_p()

◆ entity_qualifiers()

list entity_qualifiers ( entity  e)

return the qualifiers associated to entity e if it's a variable NIL otherwise

Definition at line 1394 of file entity.c.

1395 {
1396  if (e != entity_undefined) {
1397  type t = entity_type(e);
1398  if (type_variable_p(t))
1399  return (variable_qualifiers(type_variable(t)));
1400  }
1401  return NIL;
1402 }
#define variable_qualifiers(x)
Definition: ri.h:3124

References entity_type, entity_undefined, NIL, type_variable, type_variable_p, and variable_qualifiers.

Referenced by add_declaration_to_declaration_statement_p(), c_text_related_entities(), and split_initializations_in_statement().

+ Here is the caller graph for this function:

◆ entity_register_p()

bool entity_register_p ( entity  e)
Returns
whether entity is a "register" variable

See also entity_volatile_variable_p()

Definition at line 766 of file entity.c.

767 {
768  if (entity_variable_p(e))
769  {
771  if (qualifier_register_p(q))
772  return true;
773  }
774  return false;
775 }
#define qualifier_register_p(x)
Definition: ri.h:2185

References entity_type, entity_variable_p, FOREACH, qualifier_register_p, type_variable, and variable_qualifiers.

Referenced by entities_maymust_conflict_p(), reference_to_complexity(), and set_register_qualifier().

+ Here is the caller graph for this function:

◆ entity_return_label_p()

bool entity_return_label_p ( entity  e)

Definition at line 673 of file entity.c.

674 {
675  return return_label_p(entity_name(e));
676 }
bool return_label_p(const char *s)
Definition: entity_names.c:272

References entity_name, and return_label_p().

Referenced by safe_print_statement(), srwt(), statement_does_return(), and update_statement_instruction().

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

◆ entity_struct_p()

bool entity_struct_p ( entity  e)

Is entity e the entity corresponding to a struct declaration?

Note the difference with entity_array_p()

Definition at line 1002 of file entity.c.

1003 {
1004  const char* ln = entity_local_name(e);
1005  string ns = strrchr(ln, BLOCK_SEP_CHAR);
1006  bool struct_p = (ns==NULL && *ln==STRUCT_PREFIX_CHAR)
1007  || (ns!=NULL && *(ns+1)==STRUCT_PREFIX_CHAR)
1008  || (strstr(entity_name(e),STRUCT_PREFIX DUMMY_STRUCT_PREFIX)!=NULL);
1009  return struct_p;
1010 }
#define DUMMY_STRUCT_PREFIX
Definition: naming-local.h:87
#define STRUCT_PREFIX
Definition: naming-local.h:56

References BLOCK_SEP_CHAR, DUMMY_STRUCT_PREFIX, entity_local_name(), entity_name, STRUCT_PREFIX, and STRUCT_PREFIX_CHAR.

Referenced by derived_entity_p(), do_clone_entity(), filtered_declaration_list(), get_symbol_table(), type_struct_variable_p(), type_used_in_type_declarations_p(), and wipeout_entity().

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

◆ entity_subroutine_p()

bool entity_subroutine_p ( entity  e)

???

Definition at line 737 of file entity.c.

738 {
739  return entity_module_p(e) &&
740  !entity_main_module_p(e) &&
741  !entity_blockdata_p(e) && /* ??? */
742  !entity_function_p(e);
743 }
bool entity_main_module_p(entity e)
Definition: entity.c:700
bool entity_function_p(entity e)
Definition: entity.c:724
bool entity_blockdata_p(entity e)
Definition: entity.c:712

References entity_blockdata_p(), entity_function_p(), entity_main_module_p(), and entity_module_p().

Referenced by c_head(), call_selection(), do_inlining(), interface_code_string(), run_inlining(), search_1r_function_call(), xml_Arguments(), xml_Call(), and xml_Chain_Graph().

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

◆ entity_to_module_entity()

entity entity_to_module_entity ( entity  e)

Find the enclosing module of an entity.

If an entity is a module, return e. If the entity is a top-level entity, return e. FI: I'm surprised this function does not exist already

Definition at line 2053 of file entity.c.

2054 {
2056 
2057  if(top_level_entity_p(e))
2058  m = e;
2059  else if(entity_module_p(e))
2060  m = e;
2061  else {
2062  const char* mn = entity_module_name(e);
2063  m = module_name_to_entity(mn);
2064  }
2065 
2066  pips_assert("entity m is defined", !entity_undefined_p(m));
2067  pips_assert("entity m is a module or top_level_entity", entity_module_p(m)||top_level_entity_p(e) );
2068 
2069  return m;
2070 }
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
Definition: entity.c:1130

References entity_module_name(), entity_module_p(), entity_undefined, entity_undefined_p, module_name_to_entity(), pips_assert, and top_level_entity_p().

Referenced by compute_points_to_gen_set(), find_enum_of_member(), make_global_entity_from_local(), move_declaration_control_node_declarations_to_statement(), and points_to_cell_translation().

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

◆ entity_union_p()

bool entity_union_p ( entity  e)

Is entity e an entity representing the union declaration?

See entity_struct_p(), but different from entity_array_p()

Definition at line 1038 of file entity.c.

1039 {
1040  const char* ln = entity_local_name(e);
1041  string ns = strrchr(ln, BLOCK_SEP_CHAR);
1042  bool union_p = (ns==NULL && *ln==UNION_PREFIX_CHAR)
1043  || (ns!=NULL && *(ns+1)==UNION_PREFIX_CHAR)
1044  || (strstr(entity_name(e),UNION_PREFIX DUMMY_UNION_PREFIX)!=NULL);
1045  return union_p;
1046 }
#define UNION_PREFIX
Definition: naming-local.h:58
#define DUMMY_UNION_PREFIX
Definition: naming-local.h:88

References BLOCK_SEP_CHAR, DUMMY_UNION_PREFIX, entity_local_name(), entity_name, UNION_PREFIX, and UNION_PREFIX_CHAR.

Referenced by derived_entity_p(), do_clone_entity(), filtered_declaration_list(), get_symbol_table(), type_union_variable_p(), type_used_in_type_declarations_p(), and wipeout_entity().

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

◆ entity_used_in_declarations_p()

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

Parameters
eentity to check
ldecllist of entities whose declaration may use e
Returns
true if e appears in one of the declaration in ldecl
Parameters
ldecldecl

Definition at line 2258 of file entity.c.

2259 {
2260  bool found_p = false;
2261 
2262  FOREACH(ENTITY, d, ldecl) {
2263  type dt = entity_type(d);
2264  list sel = type_supporting_entities(NIL, dt);
2265 
2266  if(gen_in_list_p(e, sel)) {
2267  pips_debug(8, "entity \"%s\" is used to declare entity \"%s\"\n",
2268  entity_name(e), entity_name(d));
2269  found_p = true;
2270  gen_free_list(sel);
2271  break;
2272  }
2273  else {
2274  gen_free_list(sel);
2275  }
2276  }
2277 
2278  return found_p;
2279 }
list type_supporting_entities(list, type)
Definition: type.c:4347

References ENTITY, entity_name, entity_type, FOREACH, gen_free_list(), gen_in_list_p(), NIL, pips_debug, and type_supporting_entities().

+ Here is the call graph for this function:

◆ entity_user_name()

const char* entity_user_name ( entity  e)

Since entity_local_name may contain PIPS special characters such as prefixes (label, common, struct, union, typedef, ...), this entity_user_name function is created to return the initial entity/variable name, as viewed by the user in his code.

In addition, all possible seperators (file, module, block, member) are taken into account.

Function strstr locates the occurence of the last special character which can appear just before the initial name, so the order of test is important.

01/08/2003 Nga Nguyen -

Returns
pointer to the the user name (not newly allocated!)

Definition at line 487 of file entity.c.

488 {
489  string gn = entity_name(e);
490  const char* un = global_name_to_user_name(gn);
491  return un;
492 }

References entity_name, and global_name_to_user_name().

Referenced by actual_label_replacement_p(), add_address_of_value(), add_pragma_to_sequence(), add_prettyprint_control_list_to_declaration_statement(), AddEntityToCompilationUnit(), AddToDeclarations(), AddToExterns(), aliased_translation_p(), any_assign_operation_to_transformer(), any_expression_to_transformer(), any_scalar_assign_to_transformer_list(), any_scalar_assign_to_transformer_without_effect(), any_user_call_site_to_transformer(), array_location_entity_of_module_p(), bound_generation_compare_vector_component(), C_loop_range(), c_parser_error(), c_text_related_entities(), call_to_transformer(), callnodeclfilter(), can_terapixify_call_p(), CCompilationUnitMemoryAllocations(), cell_reference_compare(), check_C_function_type(), check_fortran_declaration_dependencies(), check_loop_distribution_feasability(), clean_statement_label(), clean_up_sequences_rewrite(), compilation_unit_text(), compute_points_to_binded_set(), constant_string_entity_p(), create_pointer_to_array_stub_points_to(), create_scalar_stub_sink_cell(), create_stub_entity(), CreateReturnEntity(), declaration_statement_to_points_to(), declaration_to_post_pv(), dereferencing_to_sinks(), do_check_isolate_statement_preconditions_on_call(), do_reduction_detection(), do_scalar_renaming_in_vertex(), do_slightly_rename_entities(), do_solve_hardware_constraints_on_nb_proc(), do_solve_hardware_constraints_on_volume(), do_terapix_argument_handler(), dump_common_layout(), effect_indices_first_pointer_dimension_rank(), effects_to_dma(), ensure_comment_consistency(), entities_maymust_conflict_p(), entities_type_and_name(), entity_dot_name(), entity_from_user_name(), entity_local_variable_p(), entity_module_unambiguous_user_name(), entity_more_or_less_minimal_name(), entity_sesam_buffer_p(), eov_add_entity_to_eliminate(), expression_allocatable_data_access_p(), expression_string_constant(), expression_to_float(), extended_source_to_sinks(), FILE_star_effect_reference_p(), find_field_in_field_list(), FindOrCreateCurrentEntity(), FindParameterEntity(), fix_loop_index_sign(), flag_loop(), flatten_code(), freed_list_to_points_to(), freia_alloc_call_p(), freia_stmt_free_p(), freia_terapix_call(), function_return_value_p(), gcd_and_constant_dependence_test(), generate_starpu_pragma(), generic_basic_equal_p(), generic_c_words_simplified_entity(), generic_clone_variable_with_unique_name(), generic_field_list_names_equal_p(), generic_function_to_return_value(), get_externalized_function_param_name(), get_externalized_function_private_param_name(), get_next_task_name(), get_statement_pragma_register(), global_source_to_sinks(), gpu_ify_statement(), gpu_xml_dump(), guess_potential_reduction(), has_similar_entity(), implicit_c_variable_p(), init_c_implicit_variables(), inline_calls(), inline_expression_call(), inline_statement_crawler(), intrinsic_call_to_points_to(), is_freia_this_call(), loadstore_type_conversion_string(), location_entity_of_module_p(), loop_rwt(), make_available_scalar(), make_bottom_up_abc_tests(), make_statement_copy_i(), MakeCurrentModule(), MakeFunctionExpression(), MakeParameterList(), MemberDerivedIdentifierToExpression(), module_initial_parameter_pv(), move_declaration_control_node_declarations_to_statement(), native_call_p(), new_array_element_backward_substitution_in_transformer(), normalize_microcode(), normalize_microcode_anotate(), NormalizeReference(), offset_cell(), offset_points_to_cell(), operator_neutral_element(), outliner_compilation_unit(), outliner_file(), outliner_independent_recursively(), outliner_parameters(), outliner_smart_references_computation(), parallel_tiling(), perform_array_element_substitutions_in_transformer(), pips_user_value_name(), pointer_arithmetic_to_points_to(), points_to_set_block_projection(), prepare_context(), print_call_precondition(), print_entity_task_buffers(), print_sesam_tasks_buffers_header(), promote_local_entities(), recursive_functional_type_supporting_entities(), redeclaration_enter_statement(), reference_add_field_dimension(), RenameFunctionEntity(), replace_sender_entity_by_receiver_entity_in_reference(), replicate_declaration(), return_value_p(), sac_aligned_entity_p(), sac_expression_reduction_p(), same_field_entity_p(), sentence_head(), sentence_tail(), sesam_buffer_to_server_entity(), sesam_task_label_p(), simd_vector_entity_p(), simplify_C_expression(), solve_name_clashes(), source_to_sinks(), split_initializations_in_statement(), statement_flatten_declarations(), statements_localize_declarations(), step_directives_init(), step_directives_save(), step_local_RT_Integer(), step_parameter(), step_translate_and_map_step_regions(), step_update_comm(), string_parameter_p(), string_to_entity(), stub_text(), substitute_scalar_stub_in_transformer(), SubstituteDummyParameters(), task_to_string(), TestCoupleOfReferences(), text_loop_default(), type_to_named_type(), unique_entity_name_p(), update_functional_type_result(), update_sesam_tasks_buffers(), UpdateEntity2(), UseFormalArguments(), user_call_to_points_to_interprocedural(), user_call_to_points_to_interprocedural_binding_set(), words_basic(), words_declaration(), words_enum(), words_goto_label(), words_omp_red(), words_points_to_reference(), Words_Reference(), words_reference(), words_regular_call(), words_variable_or_function(), xml_Application(), xml_Argument(), xml_Array(), xml_AssignArgument(), xml_Call(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_declarations(), xml_Full_Type(), xml_loop(), xml_Loop(), xml_ParameterUseToArrayBound(), xml_Pattern_Paving(), xml_print_parameter(), xml_reference(), xml_Region_Parameter(), xml_Scalar(), xml_TaskParameter(), xml_tiling(), xml_Transposition(), and xml_Type_Entity().

+ Here is the call graph for this function:

◆ entity_variable_length_array_p()

bool entity_variable_length_array_p ( entity  e)

Definition at line 798 of file entity.c.

798  {
799  bool return_val = false;
800  if (entity_variable_p(e)) {
802  }
803  return return_val;
804 }
bool variable_length_array_type_p(type)
Is this equivalent to dependent_type_p()?
Definition: type.c:2972

References entity_type, entity_variable_p, ultimate_type(), and variable_length_array_type_p().

Referenced by do_convert_this_array_to_pointer_p().

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

◆ EntityCode()

code EntityCode ( entity  e)

this function checks that e has an initial value code.

if yes returns it, otherwise aborts.

Definition at line 301 of file entity.c.

302 {
303  value ve = entity_initial(e);
304  pips_assert("EntityCode", value_tag(ve) == is_value_code);
305  return(value_code(ve));
306 }
#define value_tag(x)
Definition: ri.h:3064
@ is_value_code
Definition: ri.h:3031

References entity_initial, is_value_code, pips_assert, value_code, and value_tag.

Referenced by AddEntityToDeclarations(), append_data_current_stmt_buffer_to_declarations(), check_first_statement(), ComputeAddresses(), EndOfProcedure(), gfc2pips_computeAdressesOfArea(), gfc2pips_namespace(), gfc2pips_shiftAdressesOfArea(), outliner_file(), and outliner_independent_recursively().

+ Here is the caller graph for this function:

◆ explicit_extern_entity_p()

bool explicit_extern_entity_p ( entity  module,
entity  e 
)

There are two cases for "extern"

  • The current module is a compilation unit and the entity is in the ram_shared list of the ram storage of the compilation unit.
  • The current module is a normal function and the entity has a global scope: this is not an explicit extern declaration.
Parameters
moduleodule

Definition at line 2016 of file entity.c.

2017 {
2018  /* There are two cases for "extern"
2019 
2020  - The current module is a compilation unit and the entity is in
2021  the ram_shared list of the ram storage of the compilation unit.
2022 
2023  - The current module is a normal function and the entity has a
2024  global scope: this is not an explicit extern declaration.
2025  */
2028 }
bool compilation_unit_entity_p(entity e)
Check if the given module entity is a compilation unit.
Definition: module.c:87
#define code_externs(x)
Definition: ri.h:790

References code_externs, compilation_unit_entity_p(), entity_initial, gen_in_list_p(), module, and value_code.

+ Here is the call graph for this function:

◆ extern_entity_p()

bool extern_entity_p ( entity  module,
entity  e 
)

There are two cases for "extern"

  • The current module is a compilation unit and the entity is in the ram_shared list of the ram storage of the compilation unit.
  • The current module is a normal function and the entity has a global scope.

bool isbelong = true; list ld = entity_declarations(m); ifdebug(1) { pips_assert("e is visible in module",gen_in_list_p(e,ld)); pips_assert("module is a module or compilation unit",entity_module_p(m)||compilation_unit_entity_p(m)); pips_assert("e is either variable or function", variable_entity_p(e),functional_entity_p(e)); } if(variable_entity_p(e)) { if (compilation_unit_entity_p(m){ return(strstr(entity_name(e), } else { return(strstr(entity_name(e),TOP_LEVEL_MODULE_NAME) != NULL); } } else return(static_module_name_p(e));

return ((compilation_unit_entity_p(module) && gen_in_list_p(e,ram_shared(storage_ram(entity_storage(module))))) ||(!compilation_unit_entity_p(module) && (strstr(entity_name(e),TOP_LEVEL_MODULE_NAME) != NULL)));

Parameters
moduleodule

Definition at line 1977 of file entity.c.

1978 {
1979  /* There are two cases for "extern"
1980 
1981  - The current module is a compilation unit and the entity is in
1982  the ram_shared list of the ram storage of the compilation unit.
1983 
1984  - The current module is a normal function and the entity has a
1985  global scope.
1986 */
1987  // Check if e belongs to module
1988  /* bool isbelong = true;
1989  list ld = entity_declarations(m);
1990  //ifdebug(1) {
1991  pips_assert("e is visible in module",gen_in_list_p(e,ld));
1992  // pips_assert("module is a module or compilation unit",entity_module_p(m)||compilation_unit_entity_p(m));
1993  pips_assert("e is either variable or function", variable_entity_p(e),functional_entity_p(e));
1994  //}
1995  if(variable_entity_p(e))
1996  //{
1997  if (compilation_unit_entity_p(m){
1998  // return(strstr(entity_name(e),
1999  //}
2000  //else
2001  {
2002  //return(strstr(entity_name(e),TOP_LEVEL_MODULE_NAME) != NULL);
2003  //}
2004  //}
2005  //else
2006  //return(static_module_name_p(e));
2007  */
2008  /* return ((compilation_unit_entity_p(module) && gen_in_list_p(e,ram_shared(storage_ram(entity_storage(module)))))
2009  ||(!compilation_unit_entity_p(module) && (strstr(entity_name(e),TOP_LEVEL_MODULE_NAME) != NULL)));
2010  */
2012  ||(!compilation_unit_entity_p(module) && (strstr(entity_name(e),TOP_LEVEL_MODULE_NAME) != NULL)));
2013 
2014 }

References code_externs, compilation_unit_entity_p(), entity_initial, entity_name, gen_in_list_p(), module, TOP_LEVEL_MODULE_NAME, and value_code.

Referenced by inline_expression_call().

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

◆ extract_references_from_declarations()

list extract_references_from_declarations ( list  decls)

FI: this function has not yet been extended for C types!!!

Parameters
declsecls

Definition at line 2834 of file entity.c.

2835 {
2836  list arrays = NIL;
2837  deux_listes lref = { NIL, NIL };
2838 
2839  FOREACH(ENTITY,e,decls) {
2840  type t = entity_type(e);
2841 
2843  arrays = CONS(VARIABLE,type_variable(t), arrays);
2844  }
2845 
2846  FOREACH(VARIABLE,v,arrays)
2847  {
2848  list ldim = variable_dimensions(v);
2849  while (!ENDP(ldim))
2850  {
2851  dimension d = DIMENSION(CAR(ldim));
2853  ldim=CDR(ldim);
2854  }
2855  }
2856  gen_free_list(lref.le);
2857 
2858  return(lref.lr);
2859 }
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
Definition: genC.h:285
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
Definition: genClib.c:2785
static void make_uniq_reference_list(reference r, deux_listes *l)
Definition: entity.c:2818
#define VARIABLE(x)
VARIABLE.
Definition: ri.h:3089
#define reference_domain
newgen_range_domain_defined
Definition: ri.h:338
list lr
Definition: entity.c:2816
list le
Definition: entity.c:2816

References CAR, CDR, CONS, DIMENSION, ENDP, ENTITY, entity_type, FOREACH, gen_context_recurse, gen_free_list(), gen_true2(), deux_listes::le, deux_listes::lr, make_uniq_reference_list(), NIL, reference_domain, type_variable, type_variable_p, VARIABLE, and variable_dimensions.

Referenced by UpdateEntity().

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

◆ find_enum_of_member()

entity find_enum_of_member ( entity  m)

if m was declared in the compilation unit cu and used elsewhere, cu may not be parsed yet.

Not good in general, but should work for compilation units...

No, it does not...

Definition at line 2713 of file entity.c.

2714 {
2717  list sdl = list_undefined;
2718  list fdl = list_undefined;
2719 
2720  if(compilation_unit_entity_p(mod)) {
2721  /* if m was declared in the compilation unit cu and used elsewhere, cu may not be parsed yet. */
2722  sdl = NIL;
2723  }
2724  else {
2725  /* Not good in general, but should work for compilation units... */
2726  /* No, it does not... */
2727  sdl = entity_declarations(mod);
2728  }
2729  fdl = gen_nconc(gen_copy_seq(dl), gen_copy_seq(sdl));
2730 
2731  entity ee = entity_undefined;
2732 
2733  ifdebug(8) {
2734  pips_debug(8, "Declarations for enclosing module \"\%s\": \"", entity_name(mod));
2735  print_entities(dl);
2736  //print_entities(sdl);
2737  fprintf(stderr, "\"\n");
2738  }
2739 
2740  FOREACH(ENTITY, e,fdl) {
2741  if(entity_enum_p(e)) {
2742  list ml = type_enum(entity_type(e));
2743 
2744  pips_debug(8, "Checking enum \"\%s\"\n", entity_name(e));
2745 
2746  if(gen_in_list_p((void *) m, ml)) {
2747  ee = e;
2748  break;
2749  }
2750  ifdebug(8) {
2751  if(entity_undefined_p(ee)) {
2752  pips_debug(8, "Member \"\%s\" not found in enum \"\%s\"\n",
2753  entity_name(m), entity_name(e));
2754  }
2755  else {
2756  pips_debug(8, "Member \"\%s\" found in enum \"\%s\"\n",
2757  entity_name(m), entity_name(e));
2758  }
2759  }
2760  }
2761  }
2762 
2763  pips_assert("enum entity is found", !entity_undefined_p(ee));
2764  gen_free_list(fdl);
2765 
2766  return ee;
2767 }
#define entity_declarations(e)
MISC: newgen shorthands.
entity entity_to_module_entity(entity e)
Find the enclosing module of an entity.
Definition: entity.c:2053
void print_entities(list l)
Definition: entity.c:167
#define code_declarations(x)
Definition: ri.h:784
#define type_enum(x)
Definition: ri.h:2970
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47

References code_declarations, compilation_unit_entity_p(), ENTITY, entity_declarations, entity_enum_p(), entity_initial, entity_name, entity_to_module_entity(), entity_type, entity_undefined, entity_undefined_p, FOREACH, fprintf(), gen_copy_seq(), gen_free_list(), gen_in_list_p(), gen_nconc(), ifdebug, list_undefined, NIL, pips_assert, pips_debug, print_entities(), type_enum, and value_code.

Referenced by constant_expression_supporting_references(), and generic_constant_expression_supporting_entities().

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

◆ find_ith_formal_parameter()

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 subroutine.

Parameters
the_fncthe_fnct
rankank

Definition at line 1863 of file entity.c.

1864 {
1865  list ldecl = code_declarations(value_code(entity_initial(the_fnct)));
1867 
1868  while (ldecl != NULL)
1869  {
1870  current = ENTITY(CAR(ldecl));
1871  ldecl = CDR(ldecl);
1873  return current;
1874  }
1875 
1876  pips_internal_error("cannot find the %d dummy argument of %s",
1877  rank, entity_name(the_fnct));
1878 
1879  return entity_undefined;
1880 }
#define declaration_formal_p(E)
Definition: entity.c:1857
#define entity_to_offset(E)
Definition: entity.c:1858
static size_t current
Definition: string.c:115

References CAR, CDR, code_declarations, current, declaration_formal_p, ENTITY, entity_initial, entity_name, entity_to_offset, entity_undefined, pips_internal_error, rank, and value_code.

Referenced by add_aliases_for_current_call_site(), check_call_one_mode(), compare_formal_parameters(), interprocedural_mapping(), real_regions_forward_translation(), same_or_equivalence_argument_add_aliases(), xml_Arguments(), xml_FormalVariables(), xml_ParameterUseToArrayBound(), and xml_TaskParameters().

+ Here is the caller graph for this function:

◆ FindEntity()

entity FindEntity ( const char *  package,
const char *  name 
)

Retrieve an entity from its package/module name and its local name.

Returns
the entity if found, else entity_undefined
Parameters
packageackage
nameame

Definition at line 1503 of file entity.c.

1503  {
1506  name,
1507  NULL ),
1508  entity_domain );
1509 }
static char * package
The package name in which functions will be defined.
Definition: genLisp.c:59

References concatenate(), entity_domain, gen_find_tabulated(), MODULE_SEP_STRING, and package.

Referenced by abstract_locations_max(), add_entity_to_declarations(), add_new_compilation_unit(), add_new_module_from_text(), alloc_instrumentation(), c_return_to_transformer(), c_user_function_call_to_transformer(), clean_up_sequences_rewrite(), create_private_integer_variable_for_new_module(), create_private_variable_for_new_module(), CreateAbstractStateVariable(), CreateLogicalUnits(), cstr_args_check(), do_split_structure(), entity_all_module_locations(), entity_in_module(), entity_locations_max(), entity_more_or_less_minimal_name(), find_or_create_allocatable_struct(), FindEntityFromLocalName(), FindEntityFromUserName(), FindOrCreateEntity(), FindOrMakeDefaultIntrinsic(), FindOrMakeIntrinsic(), fortran_user_function_call_to_transformer(), generate_compact(), generic_function_to_return_value(), generic_make_entity_copy_with_new_name(), GenericAddLocalEntityToDeclarations(), get_typedefed_array(), GetFullyDefinedReturnCodeVariable(), GetReturnCodeVariable(), gfc2pips_symbol2entity(), heap_effect(), inline_expression_call(), intrinsic_name_p(), io_comp_regions(), local_name_to_top_level_entity(), make_array_entity(), make_C_print_statement(), make_check_io_statement(), make_data_field(), make_emulated_shared_variable(), make_get_rc_statement(), make_global_entity_from_local(), make_new_entity(), make_new_local_variables(), make_return_statement(), make_scalar_entity(), make_scalar_integer_entity(), make_stderr_variable(), MakeCurrentFunction(), MakeDataStatement(), MakeDataValueSet(), MakeIoFileArray(), module_to_dynamic_area(), module_to_heap_area(), mpi_make_ctx(), NameToCommon(), new_label_local_name(), new_synonym(), outliner_independent(), rename_op(), RenameFunctionEntity(), replace_expression_similar_to_pattern(), replace_indices_region(), replace_indices_region_com(), retype_formal_parameters(), SafeFindOrCreateEntity(), sesam_buffer_to_server_entity(), set_rc_function(), set_std_static_entities(), sprintf_check_expression(), std_file_entity_to_pointed_file_entity(), string_to_entity(), and UpdateEntity2().

+ Here is the call graph for this function:

◆ FindEntityFromUserName()

entity FindEntityFromUserName ( const char *  package,
const char *  name 
)
Parameters
packageackage
nameame

Definition at line 1520 of file entity.c.

1520  {
1521  entity e = FindEntity(package, name);
1522  if ( entity_undefined_p(e) ) {
1525  name,
1526  NULL ),
1527  entity_domain );
1528  }
1529  if ( entity_undefined_p(e) ) {
1532  name,
1533  NULL ),
1534  entity_domain );
1535  }
1536  return e;
1537 }
#define BLOCK_SEP_STRING
Scope separator.
Definition: naming-local.h:50
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
Definition: entity.c:1503

References BLOCK_SEP_STRING, concatenate(), entity_domain, entity_undefined_p, FindEntity(), gen_find_tabulated(), MODULE_SEP_STRING, and package.

Referenced by normalize_microcode_anotate(), sesam_buffer_to_server_entity(), and terapix_optimize_accumulator().

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

◆ FindOrCreateEntity()

entity FindOrCreateEntity ( const char *  package,
const char *  local_name 
)

Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a function or subroutine call.

See SafeFindOrCreateEntity().

Parameters
packagepackage name
local_nameentity name

Definition at line 1586 of file entity.c.

1588 {
1589  entity e;
1592  }
1593  return e;
1594 }
entity CreateEntity(const char *package_name, const char *local_name)
BEGIN_EOLE.
Definition: entity.c:1572

References CreateEntity(), entity_undefined_p, FindEntity(), local_name(), and package.

Referenced by AddVariableToCommon(), adg_get_integer_entity(), adg_rename_entities(), cast_STEP_ARG(), CheckLeftHandSide(), CleanUpEntity(), create_pointer_to_array_stub_points_to(), create_stub_entity(), create_stub_points_to(), CreateEntityFromLocalNameAndPrefix(), CreateIntrinsic(), CreateReturnEntity(), entity_all_module_xxx_locations(), entity_all_module_xxx_locations_typed(), entity_all_xxx_locations(), entity_all_xxx_locations_typed(), entity_flow_or_context_sentitive_heap_location(), entity_null_locations(), expression_try_find_size(), FindOrCreateCurrentEntity(), FindOrCreateTopLevelEntity(), FixCInternalLabels(), freia_data2d_field(), get_current_compilation_unit_entity(), get_top_level_entity(), get_typedefed_array(), get_use_entities_list(), GetReturnCodeVariable(), gfc2pips_char2entity(), gfc2pips_expr2entity(), gfc2pips_expr2expression(), gfc2pips_exprIO3(), gfc2pips_getTypesDeclared(), gfc2pips_namespace(), gfc2pips_parameters(), gfc2pips_symbol2data_instruction(), gfc2pips_symbol2entity(), gfc2pips_symbol2top_entity(), gfc2pips_vars_(), IdentifierToExpression(), init_c_areas(), init_c_implicit_variables(), InitAreas(), inline_expression_call(), inlining_regenerate_labels(), make_C_or_Fortran_constant_entity(), make_empty_module(), make_get_rc_statement(), make_global_entity_from_local(), make_label(), make_movements_loop_body_wp65(), make_new_common(), make_new_simd_vector_with_prefix(), make_nlc_entity(), make_nsp_entity(), make_nub_entity(), make_predefined_C_entities(), make_stderr_variable(), MakeCLabel(), MakeCompilationUnitEntity(), MakeCurrentFunction(), MakeEntryCommon(), MakeIoFileArray(), MakeLabel(), MakeParameterList(), MakeStorageRam(), MakeTopLevelEntity(), module_initial_parameter_pv(), mpi_initialize(), mpi_make_ctx(), mpi_type_mpi_comm(), mpi_type_mpi_request(), mpi_type_mpi_status(), NameToCommon(), NameToFunctionalEntity(), outliner_parameters(), overlap_redefine_expression(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), reference_to_address_entity(), RenameFunctionEntity(), SafeLocalToGlobal(), safescale_distributor(), same_or_equivalence_argument_add_aliases(), set_internal_static_entities(), set_rc_function(), simd_replace_parameters(), std_file_entity_to_pointed_file_entity(), step_local_RT_Integer(), step_parameter(), string_to_entity_list(), SubstituteDummyParameters(), TranslateEntryFormals(), UpdateEntity2(), and UseFormalArguments().

+ Here is the call graph for this function:

◆ FindOrCreateEntityLikeModel()

entity FindOrCreateEntityLikeModel ( const char *  package,
const char *  name,
entity  model 
)

hmmm...

Parameters
packageackage
nameame
modelodel

Definition at line 3136 of file entity.c.

3140 {
3141  string new_name = concatenate(package, MODULE_SEP_STRING, name, NULL);
3142  entity new = gen_find_tabulated(new_name, entity_domain);
3143  area tmp_area = area_undefined;
3144 
3145  pips_debug(8, "entity %s to be made after %s\n",
3146  new_name, entity_name(model));
3147 
3148  ifdebug(9)
3149  pips_assert("consistent model", entity_consistent_p(model));
3150 
3151  return(!entity_undefined_p(new) ? new :
3152  make_entity(copy_string(new_name),
3153  /*
3154  * ??? some bug in copy_type disable the possibility
3155  * of copying area for instance...
3156  *
3157  * moreover I do not wish to copy the layout list
3158  * for commons.
3159  */
3160  (!type_area_p(entity_type(model)) ?
3161  copy_type(entity_type(model)) :
3163  (tmp_area = type_area(entity_type(model)),
3164  make_area(area_size(tmp_area), NIL)))),
3165  copy_storage(entity_storage(model)),
3166  copy_value(entity_initial(model))));
3167 }
type copy_type(type p)
TYPE.
Definition: ri.c:2655
value copy_value(value p)
VALUE.
Definition: ri.c:2784
area make_area(intptr_t a1, list a2)
Definition: ri.c:98
storage copy_storage(storage p)
STORAGE.
Definition: ri.c:2228
bool entity_consistent_p(entity p)
Definition: ri.c:2530
type make_type(enum type_utype tag, void *val)
Definition: ri.c:2706
#define copy_string(s)
Definition: newgen_types.h:42
#define area_size(x)
Definition: ri.h:544
#define type_area_p(x)
Definition: ri.h:2944
@ is_type_area
Definition: ri.h:2899
#define area_undefined
Definition: ri.h:520
return(s1)

References area_size, area_undefined, concatenate(), copy_storage(), copy_string, copy_type(), copy_value(), entity_consistent_p(), entity_domain, entity_initial, entity_name, entity_storage, entity_type, entity_undefined_p, gen_find_tabulated(), ifdebug, is_type_area, make_area(), make_entity, make_type(), MODULE_SEP_STRING, NIL, package, pips_assert, pips_debug, type_area, and type_area_p.

Referenced by AddCommonToModule(), AddEntityToModule(), and new_synonym().

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

◆ FindOrCreateTopLevelEntity()

entity FindOrCreateTopLevelEntity ( const char *  name)

Return a top-level entity.

Parameters
nameof the entity to find/construct
Returns
the entity
Parameters
nameame

Definition at line 1603 of file entity.c.

1604 {
1606 }

References FindOrCreateEntity(), and TOP_LEVEL_MODULE_NAME.

Referenced by add_entity_to_declarations(), binary_intrinsic_call_to_points_to_sinks(), find_or_create_allocatable_struct(), intrinsic_call_to_points_to(), make_bound(), make_data_field(), make_strlen_expression(), set_internal_static_entities(), and std_file_entity_to_pointed_file_entity().

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

◆ fortran_module_p()

bool fortran_module_p ( entity  m)

Test if a module is in Fortran.

Could be better factored in with C case

If this alternative did not exist, the source code should be moved to ri-util

Definition at line 2799 of file entity.c.

2800 {
2801  bool fortran_p = false;
2802  value v = entity_initial(m);
2803  if(!value_undefined_p(v)) {
2804  if(value_intrinsic_p(v))
2805  return true;
2806  fortran_p = language_fortran_p(code_language(value_code(v)));
2807  }
2808  else {
2809  /* If this alternative did not exist, the source code should be
2810  moved to ri-util*/
2811  pips_internal_error("Module language should not be unknown.\n");
2812  }
2813  return fortran_p;
2814 }
#define language_fortran_p(x)
Definition: ri.h:1591

References code_language, entity_initial, language_fortran_p, pips_internal_error, value_code, value_intrinsic_p, and value_undefined_p.

Referenced by begin_omp_construct(), bound_to_statement(), call_STEP_subroutine3(), cast_STEP_ARG(), compile_omp(), convex_regions_forward_translation(), create_module_with_statement(), dimensions_to_dma(), do_linearize_array_reference(), do_linearize_type(), do_recompile_module(), emit_message_and_stop(), end_omp_construct(), ensure_comment_consistency(), entity_clean_declarations(), entity_from_user_name(), entity_local_variable_p(), gcd_and_constant_dependence_test(), generate_variable_with_unique_name_to_module(), generic_print_xml_application(), get_current_step_directive(), get_expression_addr(), get_module_name_directive_suffix(), internal_print_icfg(), linearize_array_generic(), loop_normalize_of_loop(), make_any_print_statement(), make_bottom_up_abc_tests(), make_global_entity_from_local(), make_increment_statement(), make_loadsave_statement(), make_new_scalar_variable_with_prefix(), make_scalar_integer_entity(), outline(), outliner_compilation_unit(), outliner_file(), outliner_independent(), outliner_parameters(), outliner_scan(), region_to_address(), region_to_minimal_dimensions(), sequence_rewrite(), simd_memory_packing(), statement_filter(), step_compile(), step_compile_analysed_module(), step_compile_generated_module(), step_directive_parser(), step_directive_print(), step_local_regionArray(), step_parameter(), and text_summary_complexity().

◆ fprint_entity_list()

void fprint_entity_list ( FILE *  fp,
list  l 
)

◆ generic_make_entity_copy_with_new_name()

static entity generic_make_entity_copy_with_new_name ( entity  e,
string  global_new_name,
bool  systematically_add_suffix,
bool  move_initialization_p 
)
static

Create a copy of an entity, with (almost) identical type, storage and initial value if move_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done).

Entity e must be defined or the function core dumps.

Depending on its storage, the new entity might have to be inserted in code_declarations (done) and the memory allocation recomputed (not done).

Depending on the language, the new entity might have to be inserted in statement declarations. This is left up to the user of this function.

For C, name collisions with the compilation unit are not checked here. They are unlikely, but should be checked by the caller.

/param e entity to copy /param global_new_name new name wished /param systematically_add_suffix if true, automatically add a suffix number /param move_initialization_p if true, also copy the initial value

Returns
the new entity.

Find the first matching non-already existent variable name:

Free the already allocated name in the previous iteration that was conflicting:

We are in trouble. Up to now, we have created a static alias of the variable e (it's a variable entity because of its storage). Note that static aliases do not exist in C.

FI: It would be better to perform the memory allocation right away, instead of waiting for a later core dump in chains or ricedg, but I'm in a hurry. -> fixed, BC.

I don't know if this can happen, and what we should do in such case. BC.

Definition at line 2341 of file entity.c.

2345 {
2346  entity ne = entity_undefined;
2347  char * variable_name = strdup(global_new_name);
2348  int number = 0;
2349 
2350  if (systematically_add_suffix) {
2352  asprintf(&variable_name, "%s_%d", global_new_name, number++);
2353  }
2354 
2355  /* Find the first matching non-already existent variable name: */
2357  != entity_undefined)
2358  {
2359  if (variable_name != NULL)
2360  /* Free the already allocated name in the previous iteration that
2361  was conflicting: */
2363  asprintf(&variable_name, "%s_%d", global_new_name, number++);
2364  }
2365 
2366  //extended_integer_constant_expression_p(e)
2367 
2369  copy_type(entity_type(e)),
2371  move_initialization_p? copy_value(entity_initial(e)) :
2373  );
2374 
2375  if(storage_ram_p(entity_storage(ne))) {
2376  /* We are in trouble. Up to now, we have created a static alias of
2377  * the variable e (it's a variable entity because of its
2378  * storage). Note that static aliases do not exist in C.
2379  */
2380  ram r = storage_ram(entity_storage(ne));
2381  entity m = ram_function(r);
2382 
2383  /* FI: It would be better to perform the memory allocation right
2384  away, instead of waiting for a later core dump in chains or
2385  ricedg, but I'm in a hurry. -> fixed, BC.
2386  */
2387  //ram_offset(r) = UNKNOWN_RAM_OFFSET;
2388 
2389  const char * module_name = entity_module_name(ne);
2393  int offset = 0;
2394  if (basic_undefined_p(b)) /* I don't know if this can happen, and what we should do in such case. BC. */
2396  else
2397  {
2400  (add_C_variable_to_area(a, ne)):(0);
2401  else
2403  (add_variable_to_area(a, ne)):(0);
2404  }
2405 
2406  ram_offset(r) = offset;
2407 
2408  AddEntityToDeclarations(ne, m);
2409  }
2410  return ne;
2411 }
value make_value_unknown(void)
Definition: ri.c:2847
#define DYNAMIC_AREA_LOCAL_NAME
Definition: naming-local.h:69
#define UNKNOWN_RAM_OFFSET
bool c_module_p(entity m)
Test if a module "m" is written in C.
Definition: entity.c:2777
int add_C_variable_to_area(entity, entity)
Definition: variable.c:1381
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
Definition: type.c:3677
int add_variable_to_area(entity, entity)
Definition: variable.c:1376
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73

References add_C_variable_to_area(), add_variable_to_area(), AddEntityToDeclarations(), asprintf, basic_tag, basic_undefined, basic_undefined_p, c_module_p(), copy_storage(), copy_type(), copy_value(), DYNAMIC_AREA_LOCAL_NAME, entity_basic_concrete_type(), entity_domain, entity_initial, entity_module_name(), entity_storage, entity_type, entity_undefined, FindEntity(), free(), gen_find_tabulated(), is_basic_overloaded, make_entity, make_value_unknown(), module_name(), module_name_to_entity(), offset, ram_function, ram_offset, storage_ram, storage_ram_p, strdup(), type_variable, type_variable_p, UNKNOWN_RAM_OFFSET, variable_basic, and variable_name().

Referenced by make_entity_copy(), make_entity_copy_with_new_name(), and make_entity_copy_with_new_name_and_suffix().

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

◆ get_continue_entity()

entity get_continue_entity ( void  )

true if continue.

See also macro ENTITY_CONTINUE_P

Definition at line 1726 of file entity.c.

1727 {
1729  return continue_ent;
1730 }
static entity continue_ent
continue statement
Definition: entity.c:62
void set_internal_static_entities()
beware: cannot be called on creating the database
Definition: entity.c:92

References continue_ent, and set_internal_static_entities().

Referenced by entity_continue_p().

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

◆ get_declared_entities()

set get_declared_entities ( void *  elem)

retrieves the set of entities declared in elem

Returns
set of referenced entities
Parameters
elemlem

Definition at line 3086 of file entity.c.

3086  {
3087  set the_set = set_make(set_pointer);
3089  return the_set;
3090 }
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
Definition: genClib.c:2758
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.
Definition: entity.c:3074
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362

References do_get_declared_entities(), gen_context_recurse, gen_null2(), set_make(), set_pointer, and statement_domain.

+ Here is the call graph for this function:

◆ get_referenced_entities()

set get_referenced_entities ( void *  elem)

retrieves the set of entities used in elem beware that this entities may be formal parameters, functions etc so consider filter this set depending on your need, using get_referenced_entities_filtered

Parameters
elemelement to check (any gen_recursifiable type is allowded)
Returns
set of referenced entities
Parameters
elemlem

Definition at line 3063 of file entity.c.

3064 {
3065  return get_referenced_entities_filtered(elem,(bool (*)(void*))gen_true,
3067 
3068 }
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
bool entity_not_constant_or_intrinsic_p(entity e)
Default entity filter for get_referenced_entities()
Definition: entity.c:3050

References entity_not_constant_or_intrinsic_p(), gen_true(), and get_referenced_entities_filtered().

Referenced by C_loop_range(), check_private_variables_call_walker(), do_group_statement_constant_filter(), do_loop_expansion(), do_loop_nest_unswitching(), do_remove_redundant_communications_in_anyloop(), do_terapix_pointer_initialized_from_a_mask_p(), do_terapix_warmup(), entity_generate_missing_declarations(), fix_loop_index_sign(), for_to_do_loop_conversion(), gather_local_indices(), get_loop_locals_and_remove_walker(), get_private_entities(), guard_expanded_statement_if_needed(), inline_expression_call(), promote_local_entities(), prune_non_constant(), solve_name_clashes(), statements_conflict_p(), terapix_loop_handler(), terapix_loop_optimizer(), terapixify_loop_purge(), and terapixify_loops().

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

◆ get_referenced_entities_filtered()

set get_referenced_entities_filtered ( void *  elem,
bool(*)(void *)  chunk_filter,
bool(*)(entity entity_filter 
)

Same as get_referenced_entities, but will only consider entities that fulfills entity_filter and will only enter consider entities directly involved in object matching chunk_filter \/!\ if you strip out statements, it will not consider declared entities, but it will consider their initial value.

if elem is an entity it self, add it

gather entities from elem

gather all entities referenced by referenced entities

not merged with earlier test to avoid infinite recursion

Parameters
elemlem

Definition at line 2982 of file entity.c.

2984 {
2985  set referenced_entities = set_make(set_pointer);
2986  if(!gen_chunk_undefined_p(elem)) {
2988  referenced_entities,
2989  chunk_filter,
2990  entity_filter
2991  };
2992 
2993  /* if elem is an entity it self, add it */
2994  if(INSTANCE_OF(entity,(gen_chunkp)elem)) {
2995  entity e = (entity)elem;
2996  if(!entity_module_p(e)) {
2997  if(chunk_filter(entity_type(e)))
3001  NULL);
3002  if(!value_undefined_p(entity_initial(e)) && // struct fields have undefined initial
3003  chunk_filter(entity_initial(e)))
3009  NULL);
3010  }
3011  }
3012  else {
3013  /* gather entities from elem */
3014  gen_context_multi_recurse(elem,&p,
3020  NULL);
3021  }
3022 
3023  /* gather all entities referenced by referenced entities */
3024  list ltmp = set_to_list(referenced_entities);
3025  FOREACH(ENTITY,e,ltmp) {
3026  if(e!=elem) {
3027  set tmp = get_referenced_entities_filtered(e,chunk_filter,entity_filter);
3028  set_union(referenced_entities,referenced_entities,tmp);
3029  set_free(tmp);
3030  }
3031  }
3032  gen_free_list(ltmp);
3033 
3034  /* not merged with earlier test to avoid infinite recursion */
3035  if(INSTANCE_OF(entity,(gen_chunkp)elem)) {
3036  entity e = (entity)elem;
3037  set_add_element(referenced_entities,referenced_entities,e);
3038  }
3039  }
3040 
3041  return referenced_entities;
3042 }
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
Definition: genClib.c:3373
list set_to_list(const set)
create a list from a set the set is not freed
Definition: set.c:436
#define INSTANCE_OF(type, value)
polymorhism thanks to newgen !
static void do_get_referenced_entities_on_loop(loop l, get_referenced_entities_t *p)
helper looking in a loop for referenced entities
Definition: entity.c:2917
static void do_get_referenced_entities_on_statement(statement s, get_referenced_entities_t *p)
helper looking in a statement declaration for referenced entities
Definition: entity.c:2956
static void do_get_referenced_entities_on_reference(reference r, get_referenced_entities_t *p)
helper looking in a reference r for referenced entities
Definition: entity.c:2895
static void do_get_referenced_entities_on_area(area a, get_referenced_entities_t *p)
helper looking in an area for referenced entities
Definition: entity.c:2948
static void do_get_referenced_entities_on_ram(ram r, get_referenced_entities_t *p)
helper looking in a ram for referenced entities
Definition: entity.c:2939
static void do_get_referenced_entities_on_call(call c, get_referenced_entities_t *p)
helper looking in a call for referenced entities
Definition: entity.c:2906
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define area_domain
newgen_application_domain_defined
Definition: ri.h:34
#define ram_domain
newgen_qualifier_domain_defined
Definition: ri.h:322
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
A gen_chunk is used to store every object.
Definition: genC.h:58

References area_domain, call_domain, do_get_referenced_entities_on_area(), do_get_referenced_entities_on_call(), do_get_referenced_entities_on_loop(), do_get_referenced_entities_on_ram(), do_get_referenced_entities_on_reference(), do_get_referenced_entities_on_statement(), ENTITY, entity_initial, entity_module_p(), entity_type, FOREACH, gen_chunk_undefined_p, gen_context_multi_recurse(), gen_free_list(), gen_true(), INSTANCE_OF, loop_domain, ram_domain, reference_domain, set_add_element(), set_free(), set_make(), set_pointer, set_to_list(), set_union(), statement_domain, and value_undefined_p.

Referenced by do_get_referenced_entities_on_statement(), do_group_statement_constant_prune(), get_referenced_entities(), module_to_value_mappings(), outliner_independent_recursively(), outliner_statements_referenced_entities(), sort_entities_with_dep(), and statement_clean_declarations_helper().

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

◆ get_stderr_entity()

entity get_stderr_entity ( void  )

Definition at line 1220 of file entity.c.

1221 {
1223  return stderr_ent;
1224 }
void set_std_static_entities()
beware: cannot be called on creating the database
Definition: entity.c:80
static entity stderr_ent
Definition: entity.c:73

References set_std_static_entities(), and stderr_ent.

Referenced by stderr_entity_p().

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

◆ get_stdin_entity()

entity get_stdin_entity ( void  )

Definition at line 1197 of file entity.c.

1198 {
1200  return stdin_ent;
1201 }
static entity stdin_ent
stdio files entities
Definition: entity.c:71

References set_std_static_entities(), and stdin_ent.

Referenced by stdin_entity_p().

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

◆ get_stdout_entity()

entity get_stdout_entity ( void  )

Definition at line 1209 of file entity.c.

1210 {
1212  return stdout_ent;
1213 }
static entity stdout_ent
Definition: entity.c:72

References set_std_static_entities(), and stdout_ent.

Referenced by stdout_entity_p().

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

◆ global_name_to_entity()

entity global_name_to_entity ( const char *  name)

Find an entity, if it exists, from its global name, a.k.a.

its entity name.

Let's avoid Newgen interface, gen_find_tabulated(), in PIPS passes.

Parameters
nameame

Definition at line 1516 of file entity.c.

1516  {
1517  return gen_find_tabulated(name, entity_domain );
1518 }

References entity_domain, and gen_find_tabulated().

+ Here is the call graph for this function:

◆ intrinsic_entity_p()

◆ intrinsic_name_p()

bool intrinsic_name_p ( const char *  local_name)
Parameters
local_nameocal_name

Definition at line 1282 of file entity.c.

1282  {
1284  return !entity_undefined_p(e) && intrinsic_entity_p(e);
1285 }

References entity_undefined_p, FindEntity(), intrinsic_entity_p(), local_name(), and TOP_LEVEL_MODULE_NAME.

+ Here is the call graph for this function:

◆ io_entity_p()

bool io_entity_p ( entity  e)

Several implicit entities are declared to define the implicit effects of IO statements.

Definition at line 1139 of file entity.c.

1140 {
1142  return (same_entity_p(e, luns_ent) || same_entity_p(e, io_ptr_ent)
1144 }
static entity io_error_luns_ent
Definition: entity.c:59
static entity io_ptr_ent
Definition: entity.c:57
static entity io_eof_ent
Definition: entity.c:58
static entity luns_ent
Definition: entity.c:56

References io_eof_ent, io_error_luns_ent, io_ptr_ent, luns_ent, same_entity_p(), and set_internal_static_entities().

Referenced by check_io_statement_p(), com_call(), common_region_translation(), effects_package_entity_p(), and text_test().

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

◆ io_intrinsic_p()

bool io_intrinsic_p ( entity  e)

rue is a statement s is an io intrinsic

ool statement_contains_io_intrinsic_call_p(statement s) { IoElementDescriptor *pid = IoElementDescriptorTable; bool found = false;

while ((pid->name != NULL) && (!found)) { if (strcmp(pid->name, s) == 0) { found = true; return true; } } return false; } true if e is an io instrinsic

ortran

Definition at line 1655 of file entity.c.

1656 {
1675 
1676  /*Fortran*/
1678  //entity_intrinsic(PRINT_FUNCTION_NAME),
1688  NULL);
1689  }
1691  return true;
1692  else
1693  return false;
1694 }
#define GETS_FUNCTION_NAME
#define VFPRINTF_FUNCTION_NAME
#define SCANF_FUNCTION_NAME
#define READ_FUNCTION_NAME
#define ENDFILE_FUNCTION_NAME
#define BUFFERIN_FUNCTION_NAME
#define SSCANF_FUNCTION_NAME
#define ISOC99_SSCANF_USER_FUNCTION_NAME
#define FOPEN_FUNCTION_NAME
#define BACKSPACE_FUNCTION_NAME
#define ISOC99_SSCANF_FUNCTION_NAME
#define ISOC99_SCANF_FUNCTION_NAME
#define VFSCANF_FUNCTION_NAME
#define REWIND_FUNCTION_NAME
#define FPRINTF_FUNCTION_NAME
#define OPEN_FUNCTION_NAME
#define SNPRINTF_FUNCTION_NAME
#define WRITE_FUNCTION_NAME
#define CLOSE_FUNCTION_NAME
#define FORMAT_FUNCTION_NAME
#define INQUIRE_FUNCTION_NAME
#define PUTS_FUNCTION_NAME
#define ISOC99_SCANF_USER_FUNCTION_NAME
#define PRINTF_FUNCTION_NAME
include<stdio.h>
#define FCLOSE_FUNCTION_NAME
static set io_functions_set
Definition: entity.c:164

References BACKSPACE_FUNCTION_NAME, BUFFERIN_FUNCTION_NAME, CLOSE_FUNCTION_NAME, ENDFILE_FUNCTION_NAME, entity_intrinsic(), FCLOSE_FUNCTION_NAME, FOPEN_FUNCTION_NAME, FORMAT_FUNCTION_NAME, FPRINTF_FUNCTION_NAME, GETS_FUNCTION_NAME, INQUIRE_FUNCTION_NAME, io_functions_set, ISOC99_SCANF_FUNCTION_NAME, ISOC99_SCANF_USER_FUNCTION_NAME, ISOC99_SSCANF_FUNCTION_NAME, ISOC99_SSCANF_USER_FUNCTION_NAME, OPEN_FUNCTION_NAME, PRINTF_FUNCTION_NAME, PUTS_FUNCTION_NAME, READ_FUNCTION_NAME, REWIND_FUNCTION_NAME, SCANF_FUNCTION_NAME, set_add_elements(), set_belong_p(), set_make(), set_pointer, set_undefined_p, SNPRINTF_FUNCTION_NAME, SSCANF_FUNCTION_NAME, VFPRINTF_FUNCTION_NAME, VFSCANF_FUNCTION_NAME, and WRITE_FUNCTION_NAME.

Referenced by cse_atom_call_flt(), icm_atom_call_flt(), only_io_call(), static_controlize_statement(), and xml_Arguments().

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

◆ io_luns_entity_p()

bool io_luns_entity_p ( entity  e)

Definition at line 1146 of file entity.c.

1147 {
1149  return (same_entity_p(e, luns_ent));
1150 }

References luns_ent, same_entity_p(), and set_internal_static_entities().

Referenced by io_effect_entity_p().

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

◆ label_defined_in_current_module_p()

bool label_defined_in_current_module_p ( entity  l)

Definition at line 399 of file entity.c.

400 {
402  bool defined_p = label_defined_in_statement_p(l, s);
403 
404  return defined_p;
405 }
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
bool label_defined_in_statement_p(entity l, statement s)
Definition: entity.c:388

References get_current_module_statement(), and label_defined_in_statement_p().

+ Here is the call graph for this function:

◆ label_defined_in_statement_p()

bool label_defined_in_statement_p ( entity  l,
statement  s 
)

Definition at line 388 of file entity.c.

389 {
392 
395 
397 }
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
static bool check_statement_for_label(statement s)
Definition: entity.c:380

References check_statement_for_label(), entity_undefined, gen_null(), gen_recurse, label_defined_in_statement, label_searched_in_statement, and statement_domain.

Referenced by label_defined_in_current_module_p(), label_string_defined_in_current_module_p(), and label_string_defined_in_statement_p().

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

◆ label_local_name()

◆ label_name_conflict_with_labels()

bool label_name_conflict_with_labels ( const char *  n,
list  ll 
)
Parameters
lll

Definition at line 610 of file entity.c.

611 {
612  bool conflict_p = false;
613  if(!empty_label_p(n)) {
614  FOREACH(ENTITY, l, ll) {
615  if(strcmp(label_local_name(l), n) == 0)
616  conflict_p = true;
617  }
618  }
619  return conflict_p;
620 }
const char * label_local_name(entity e)
END_EOLE.
Definition: entity.c:604

References empty_label_p(), ENTITY, FOREACH, and label_local_name().

Referenced by FixCInternalLabels().

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

◆ label_string_defined_in_current_module_p()

bool label_string_defined_in_current_module_p ( string  ls)
Parameters
lss

Definition at line 407 of file entity.c.

408 {
410  pips_assert("entity defined",!entity_undefined_p(l));
412  bool defined_p = label_defined_in_statement_p(l, s);
413 
414  return defined_p;
415 }
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
entity find_label_entity(const char *, const char *)
util.c
Definition: util.c:43

References entity_undefined_p, find_label_entity(), get_current_module_name(), get_current_module_statement(), label_defined_in_statement_p(), and pips_assert.

Referenced by words_regular_call().

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

◆ label_string_defined_in_statement_p()

bool label_string_defined_in_statement_p ( string  ls,
statement  s 
)
Parameters
lss

Definition at line 417 of file entity.c.

418 {
420 
421  bool defined_p = label_defined_in_statement_p(l, s);
422 
423  return defined_p;
424 }

References find_label_entity(), get_current_module_name(), and label_defined_in_statement_p().

+ Here is the call graph for this function:

◆ lexicographic_order_p()

bool lexicographic_order_p ( entity  var1,
entity  var2 
)

true if var1 <= var2

TCST is before anything else

else there are two entities

Parameters
var1ar1
var2ar2

Definition at line 1365 of file entity.c.

1366 {
1367  /* TCST is before anything else
1368  */
1369  if ((Variable) var1==TCST) return(true);
1370  if ((Variable) var2==TCST) return(false);
1371 
1372  /* else there are two entities
1373  */
1374 
1375  return(strcmp(entity_local_name(var1), entity_local_name(var2))<=0);
1376 }
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.

References entity_local_name(), and TCST.

+ Here is the call graph for this function:

◆ local_entity_of_module_p()

bool local_entity_of_module_p ( entity  e,
entity  module 
)

This test shows that "e" has been declared in "module".

Well, "e" may not be declared in "module". For instance, "e" may be a value of a variable declared in "module".

This does not show in Fortran that e is a variable with effects local to the module because e can be allocated in a common. Variables with local effects are allocated either in the static or the dynamic or the stack area.

Variables with effects lost on return are allocated either in the dynamic or stack areas. Effects on static variables may or not escape.

Of course, this predicate returns false for some variables declared in "module", extern variables for instance.

Parameters
moduleodule

Definition at line 1069 of file entity.c.

1070 {
1071  bool
1072  result = same_string_p(entity_module_name(e),
1074 
1075  debug(6, "local_entity_of_module_p",
1076  "%s %s %s\n",
1077  entity_name(e), result ? "in" : "not in", entity_name(module));
1078 
1079  return(result);
1080 }
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189

References debug(), entity_module_name(), entity_name, module, module_local_name(), and same_string_p.

Referenced by AddCommonToModule(), array_bound_check_instrumentation(), do_linearize_prepatch(), do_scalar_renaming(), fix_loop_index_sign(), precondition_intra_to_inter(), promote_local_entities(), and simplify_dg().

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

◆ local_name_to_scope()

string local_name_to_scope ( const char *  ln)

allocates a new string

Parameters
lnn

Definition at line 563 of file entity.c.

564 {
565  string ns = strrchr(ln, BLOCK_SEP_CHAR);
566  string s = string_undefined;
567 
568  if(ns==NULL)
569  s = empty_scope();
570  else
571  s = strndup(ln, ns-ln+1);
572 
573  pips_debug(8, "local name = \"%s\", scope: \"%s\"\n",
574  ln, s);
575 
576  return s;
577 }
string empty_scope()
Functions used to manage the block scoping in conjunction with ContextStack and yco ntext.
Definition: entity.c:498
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
Definition: strndup.c:26

References BLOCK_SEP_CHAR, empty_scope(), pips_debug, string_undefined, and strndup().

Referenced by eov_add_entity_to_eliminate(), flatten_code(), make_statement_copy_i(), RenameFunctionEntity(), replicate_declaration(), and statement_flatten_declarations().

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

◆ local_name_to_top_level_entity()

entity local_name_to_top_level_entity ( const char *  n)

This function try to find a top-level entity from a local name.

@description Because of static C function, the entity returned is not always a top-level entity.

Returns
the entity if found, else entity_undefined

Extension with C: the scope of a module can be its compilation unit if this is a static module, not only TOP-LEVEL.

Definition at line 1450 of file entity.c.

1451 {
1453 
1454  /* Extension with C: the scope of a module can be its compilation unit if this is
1455  a static module, not only TOP-LEVEL. */
1456 
1457  if (static_module_name_p(n)) {
1458  string cun = strdup(n);
1459  string sep = strchr(cun, FILE_SEP);
1460  *(sep+1) = '\0';
1461  module = FindEntity(cun,n);
1462  free(cun);
1463  }
1464  else
1465  {
1466  for(int i=0; i<PREFIXES_SIZE && entity_undefined_p(module); i++)
1469  entity_domain);
1470  }
1471 
1472  return module;
1473 }
bool static_module_name_p(const char *name)
Check if the given name is a static module name.
Definition: entity_names.c:122
#define FILE_SEP
Definition: naming-local.h:39
static string prefixes[]
Definition: entity.c:1433
#define PREFIXES_SIZE
this function maps a local name, for instance P, to the corresponding TOP-LEVEL entity,...
Definition: entity.c:1432

References concatenate(), entity_domain, entity_undefined, entity_undefined_p, FILE_SEP, FindEntity(), free(), gen_find_tabulated(), module, MODULE_SEP_STRING, prefixes, PREFIXES_SIZE, static_module_name_p(), strdup(), and TOP_LEVEL_MODULE_NAME.

Referenced by add_new_module_from_text(), alias_check(), alias_classes(), alias_lists(), alias_pairs(), alias_propagation(), alias_propagation_callers(), aliases_text(), array_bound_check_bottom_up(), array_bound_check_instrumentation(), array_bound_check_interprocedural(), array_bound_check_top_down(), array_dfg(), atomizer(), build_real_resources(), chains(), common_is_visible_p(), comp_regions(), compute_constant(), continuation_conditions(), cumulated_reductions(), dag_normalize(), distributer(), do_it(), do_point_to(), filter_proper_effects(), flinter(), forward_substitute(), freia_copy_image(), freia_create_helper_function(), freia_ok(), freia_trpx_compile_one_dag(), generate_starpu_pragma(), get_any_comp_regions_text(), get_continuation_condition_text(), get_main(), GetFullyDefinedReturnCodeVariable(), global_parallelization(), gpu_promote_sequential(), guard_elimination(), hpfc_common(), ikernel_load_store(), image_free(), impact_check(), initialize_and_verify_common_variable(), insert_common_declaration(), insert_new_declarations(), instruction_selection(), internal_print_icfg(), invariant_code_motion(), kernel_data_mapping(), loop_statistics(), lower_bound_generation(), main(), make_array_entity(), make_div_expression(), make_global_entity_from_local(), make_movements_loop_body_wp65(), make_scalar_entity(), make_scalar_integer_entity(), make_scanning_over_tiles(), make_start_ru_module(), MakeComplexConstantExpression(), MakeEntryCommon(), missing_file_initializer(), module_entity_to_compilation_unit_entity(), module_name_to_entity(), module_to_callees(), mpi_task_generation(), mppa_call_helper(), new_local_image_variable(), old_array_bound_check_instrumentation(), opencl_compile_mergeable_dag(), opencl_generate_special_kernel_ops(), optimize_expressions(), partial_eval(), pocc_prettyprinter(), pragma_outliner(), prgm_mapping(), print_any_reductions(), print_code_points_to(), print_code_static_control(), print_dependence_or_chains_graph(), print_dot_dependence_or_chains_graph(), print_filtered_dg_or_dvdg(), print_loopnest_dependence_cone(), print_module_name_to_toposorts(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), print_statement_of_module(), process_reduced_loops(), proper_reductions(), put_summary(), regions_to_loops(), reindexing(), remove_ghost_variable_entities(), remove_module_entity(), remove_variable_entity(), restructure_control(), rice(), rice_dependence_graph(), rstream_interface(), SaveEntity(), sc_delimiter(), scalopify(), scheduling(), sctc_call_rwt(), sesamify(), set_aipo_call(), set_resources_for_module(), single_assign(), spaghettify(), static_controlize(), step_analyse(), step_compile(), step_compile_analysed_module(), step_compile_generated_module(), step_parser(), string_to_user_modules(), summary_reductions(), switch_vertex_to_assign(), taskify(), test_bound_generation(), tiling_sequence(), transformer_add_any_relation_information(), unspaghettify(), UpdateFormalStorages(), upper_bound_generation(), used_before_set(), and wrap_kernel_argument().

+ Here is the call graph for this function:

◆ make_empty_blockdata()

entity make_empty_blockdata ( const char *  name,
language  l 
)
Parameters
nameame

Definition at line 290 of file entity.c.

291 {
293  BLOCKDATA_PREFIX, name, NULL);
295 }
type make_type_void(list _field_)
Definition: ri.c:2727
#define full_name(dir, name)
Definition: compile.c:414
entity make_empty_module(const char *full_name, type r, language l)
The source language is not specified.
Definition: entity.c:197

References BLOCKDATA_PREFIX, concatenate(), full_name, make_empty_module(), make_type_void(), MODULE_SEP_STRING, NIL, and TOP_LEVEL_MODULE_NAME.

Referenced by gfc2pips_symbol2entity().

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

◆ make_empty_f95module()

entity make_empty_f95module ( const char *  name,
language  l 
)
Parameters
nameame

Definition at line 275 of file entity.c.

276 {
277  pips_assert("Module are only defined in Fortran95",language_fortran95_p(l));
279  MODULE_SEP_STRING, F95MODULE_PREFIX, name, NULL);
281 }
#define language_fortran95_p(x)
Definition: ri.h:1597

References concatenate(), F95MODULE_PREFIX, full_name, language_fortran95_p, make_empty_module(), make_type_void(), MODULE_SEP_STRING, NIL, pips_assert, and TOP_LEVEL_MODULE_NAME.

Referenced by gfc2pips_symbol2entity().

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

◆ make_empty_function()

entity make_empty_function ( const char *  name,
type  r,
language  l 
)
Parameters
nameame

Definition at line 283 of file entity.c.

284 {
286  MODULE_SEP_STRING, name, NULL);
287  return make_empty_module(full_name, r,l);
288 }

References concatenate(), full_name, make_empty_module(), MODULE_SEP_STRING, and TOP_LEVEL_MODULE_NAME.

Referenced by atomic_function_of_operation(), freia_create_helper_function(), gfc2pips_symbol2entity(), MakeEntityFunction(), and MakeRunTimeSupportFunction().

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

◆ make_empty_module()

entity make_empty_module ( const char *  full_name,
type  r,
language  l 
)

The source language is not specified.

Might not work with C because of module_local_name. Also, the compilation unit is undefined.

It might be necessary to declare the four areas in code_declarations.

See also InitAreas() and init_c_areas(), which use global variables and hence cannot be used outside of the parsers. Beware of the consistency between this function and those two.

See also MakeCurrentFunction(), which is part of the Fortran parser.

FC: added to allow reintrance in HPFC

Parameters
full_nameull_name

Definition at line 197 of file entity.c.

199 {
200  const char* name;
203 
204  /* FC: added to allow reintrance in HPFC */
205  if (e!=entity_undefined)
206  {
207  pips_debug(1,"module %s already exists, returning it\n", full_name);
208  return e;
209  }
210 
211  pips_assert("undefined", e == entity_undefined);
212 
213  e = make_entity
214  (strdup(full_name),
216  make_functional(NIL, r)),
220  l)));
221 
222  name = module_local_name(e);
229 
236 
243 
250 
252  entity_type(PointerArea) = make_type_area(make_area(0, NIL));
253  entity_storage(PointerArea) = make_storage_rom();
254  entity_initial(PointerArea) = make_value_unknown();
256  AddEntityToDeclarations(PointerArea, e);
257 
258  return(e);
259 }
functional make_functional(list a1, type a2)
Definition: ri.c:1109
value make_value_code(code _field_)
Definition: ri.c:2835
storage make_storage_rom(void)
Definition: ri.c:2285
type make_type_functional(functional _field_)
Definition: ri.c:2718
type make_type_area(area _field_)
Definition: ri.c:2712
code make_code(list a1, string a2, sequence a3, list a4, language a5)
Definition: ri.c:353
sequence make_sequence(list a)
Definition: ri.c:2125
entity DynamicArea
These global variables are declared in ri-util/util.c.
Definition: area.c:57
entity HeapArea
Definition: area.c:59
entity StaticArea
Definition: area.c:58
entity StackArea
Definition: area.c:60
#define STACK_AREA_LOCAL_NAME
Definition: naming-local.h:72
#define POINTER_DUMMY_TARGETS_AREA_LOCAL_NAME
Definition: naming-local.h:77
#define STATIC_AREA_LOCAL_NAME
Definition: naming-local.h:70
#define HEAP_AREA_LOCAL_NAME
Definition: naming-local.h:71
@ ENTITY_POINTER_DUMMY_TARGETS_AREA
@ ENTITY_STATIC_AREA
@ ABSTRACT_LOCATION
@ ENTITY_DYNAMIC_AREA
@ ENTITY_STACK_AREA
@ ENTITY_HEAP_AREA

References ABSTRACT_LOCATION, AddEntityToDeclarations(), DYNAMIC_AREA_LOCAL_NAME, DynamicArea, entity_domain, ENTITY_DYNAMIC_AREA, ENTITY_HEAP_AREA, entity_initial, entity_kind, ENTITY_POINTER_DUMMY_TARGETS_AREA, ENTITY_STACK_AREA, ENTITY_STATIC_AREA, entity_storage, entity_type, entity_undefined, FindOrCreateEntity(), full_name, gen_find_tabulated(), HEAP_AREA_LOCAL_NAME, HeapArea, make_area(), make_code(), make_entity, make_functional(), make_sequence(), make_storage_rom(), make_type_area(), make_type_functional(), make_value_code(), make_value_unknown(), module_local_name(), NIL, pips_assert, pips_debug, POINTER_DUMMY_TARGETS_AREA_LOCAL_NAME, STACK_AREA_LOCAL_NAME, StackArea, STATIC_AREA_LOCAL_NAME, StaticArea, and strdup().

Referenced by make_empty_blockdata(), make_empty_f95module(), make_empty_function(), make_empty_program(), and make_empty_subroutine().

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

◆ make_empty_program()

entity make_empty_program ( const char *  name,
language  l 
)
Parameters
nameame

Definition at line 261 of file entity.c.

262 {
264  MODULE_SEP_STRING MAIN_PREFIX, name, NULL);
266 }
#define MAIN_PREFIX
Definition: naming-local.h:32

References concatenate(), full_name, MAIN_PREFIX, make_empty_module(), make_type_void(), MODULE_SEP_STRING, NIL, and TOP_LEVEL_MODULE_NAME.

Referenced by gfc2pips_symbol2entity(), hpfc_init(), and make_complexity_unknown().

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

◆ make_empty_subroutine()

◆ make_entity_copy()

entity make_entity_copy ( entity  e)

Create a copy of an entity, with (almost) identical type, storage and initial value if move_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done).

Entity e must be defined or the function core dumps.

Depending on its storage, the new entity might have to be inserted in code_declarations (done) and the memory allocation recomputed (not done).

Depending on the language, the new entity might have to be inserted in statement declarations. This is left up to the user of this function.

For C, name collisions with the compilation unit are not checked here. They are unlikely, but should be checked by the caller.

/param e entity to copy

Returns
the new entity.

Definition at line 2433 of file entity.c.

2434 {
2436  entity_name(e),
2437  false,
2438  true);
2439 }
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...
Definition: entity.c:2341

References entity_name, and generic_make_entity_copy_with_new_name().

Referenced by make_shuffle_statement().

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

◆ make_entity_copy_with_new_name()

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_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done).

Entity e must be defined or the function core dumps.

Depending on its storage, the new entity might have to be inserted in code_declarations (done) and the memory allocation recomputed (not done).

Depending on the language, the new entity might have to be inserted in statement declarations. This is left up to the user of this function.

For C, name collisions with the compilation unit are not checked here. They are unlikely, but should be checked by the caller.

/param e entity to copy /param global_new_name new name wished /param move_initialization_p if true, also copy the initial value

Returns
the new entity.
Parameters
global_new_namelobal_new_name
move_initialization_pove_initialization_p

Definition at line 2463 of file entity.c.

2466 {
2468  global_new_name,
2469  false,
2470  move_initialization_p);
2471 }

References generic_make_entity_copy_with_new_name().

Referenced by clean_up_sequences_rewrite(), do_split_structure(), do_terapix_argument_handler(), outliner_patch_parameters(), recursive_rename_types(), redeclaration_enter_statement(), replace_indices_region(), replace_indices_region_com(), replicate_declaration(), and terapix_loop_handler().

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

◆ make_entity_copy_with_new_name_and_suffix()

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_initialization_p is false, but with a slightly different name as entities are uniquely known by their names, and a different offset if the storage is ram (still to be done).

Entity e must be defined or the function core dumps.

Depending on its storage, the new entity might have to be inserted in code_declarations (done) and the memory allocation recomputed (not done).

Depending on the language, the new entity might have to be inserted in statement declarations. This is left up to the user of this function.

For C, name collisions with the compilation unit are not checked here. They are unlikely, but should be checked by the caller.

/param e entity to copy /param global_new_name new name wished /param move_initialization_p if true, also copy the initial value

Returns
the new entity.
Parameters
global_new_namelobal_new_name
move_initialization_pove_initialization_p

Definition at line 2495 of file entity.c.

2498 {
2500  global_new_name,
2501  true,
2502  move_initialization_p);
2503 }

References generic_make_entity_copy_with_new_name().

Referenced by clean_up_sequences_rewrite().

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

◆ make_label()

entity make_label ( const char *  module_name,
const char *  local_name 
)
Parameters
module_nameodule_name
local_nameocal_name

Definition at line 308 of file entity.c.

309 {
311  if( type_undefined_p(entity_type(l)) ) {
315  }
316  return l;
317 }
value make_value_constant(constant _field_)
Definition: ri.c:2841
constant make_constant_litteral(void)
Definition: ri.c:418
type MakeTypeStatement(void)
Definition: type.c:92

References entity_initial, entity_storage, entity_type, FindOrCreateEntity(), local_name(), make_constant_litteral(), make_storage_rom(), make_value_constant(), MakeTypeStatement(), module_name(), and type_undefined_p.

Referenced by Generate_C_ReturnLabel(), gfc2pips_int2label(), make_new_label(), and make_return_statement().

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

◆ make_loop_label()

entity make_loop_label ( int __attribute__((unused))  desired_number,
entity  module 
)

Definition at line 370 of file entity.c.

372 {
374  return e;
375 }
entity make_new_label(entity module)
This function returns a new label.
Definition: entity.c:357

References make_new_label(), and module.

Referenced by array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), bound_generation(), loop_nest_to_wp65_code(), make_scanning_over_one_tile(), and make_scanning_over_tiles().

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

◆ make_new_common()

entity make_new_common ( string  name,
entity  mod 
)

This function creates a common for a given name in a given module.

This is an entity with the following fields : Example: SUBROUTINE SUB1 COMMON /FOO/ W1,V1

name = top_level:~name (TOP-LEVEL:~FOO) type = area with size = 8 [2*8], layout = NIL [SUB1:W,SUB1:V] storage = ram with function = module (TOP-LEVEL:SUB1) (first occurence ? SUB2,SUB3,..) section = TOP-LEVEL:~FOO (recursive ???) offset = undefined shared = NIL initial = unknown

The area size and area layout must be updated each time when a common variable is added to this common

Parameters
nameame
modod

Definition at line 1806 of file entity.c.

1807 {
1808  string common_global_name = strdup(concatenate(TOP_LEVEL_MODULE_NAME,
1810  COMMON_PREFIX,name,NULL));
1811  type common_type = make_type(is_type_area, make_area(8, NIL));
1812  entity StaticArea =
1814  storage common_storage = make_storage(is_storage_ram,
1815  (make_ram(mod,StaticArea, 0, NIL)));
1816  value common_value =
1819  make_sequence(NIL),
1820  NIL,
1822 
1823  return make_entity(common_global_name,
1824  common_type,
1825  common_storage,
1826  common_value);
1827 }
language make_language_fortran(void)
Definition: ri.c:1250
storage make_storage(enum storage_utype tag, void *val)
Definition: ri.c:2273
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
Definition: ri.c:1999
@ is_storage_ram
Definition: ri.h:2492

References COMMON_PREFIX, concatenate(), FindOrCreateEntity(), is_storage_ram, is_type_area, make_area(), make_code(), make_entity, make_language_fortran(), make_ram(), make_sequence(), make_storage(), make_type(), make_value_code(), MODULE_SEP_STRING, NIL, STATIC_AREA_LOCAL_NAME, StaticArea, strdup(), string_undefined, and TOP_LEVEL_MODULE_NAME.

Referenced by create_externalized_function_common(), gfc2pips_namespace(), and make_global_common_and_initialize().

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

◆ make_new_integer_scalar_common_variable()

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.

This is an entity with the following fields : name = module_name:name (SUB1:W1) type = variable with basic = int, dimension = NIL storage = ram with function = module (TOP-LEVEL:SUB1) section = common (TOP-LEVEL:~FOO) offset = 0 shared = initial = unknown

The common must be updated with new area size and area layout

Parameters
nameame
modod
comom

Definition at line 1843 of file entity.c.

1844 {
1845  string var_global_name = strdup(concatenate(module_local_name(mod),MODULE_SEP_STRING,
1846  name,NULL));
1848  storage var_storage = make_storage(is_storage_ram,
1849  (make_ram(mod,com,0,NIL)));
1850  value var_value = make_value_unknown();
1851  entity e = make_entity(var_global_name,var_type,var_storage,var_value);
1852  //area_layout(type_area(entity_type(com))) = CONS(ENTITY,e,NIL);
1853  return e;
1854 }
basic make_basic_int(intptr_t _field_)
Definition: ri.c:158
variable make_variable(basic a1, list a2, list a3)
Definition: ri.c:2895
@ is_type_variable
Definition: ri.h:2900

References concatenate(), is_storage_ram, is_type_variable, make_basic_int(), make_entity, make_ram(), make_storage(), make_type(), make_value_unknown(), make_variable(), module_local_name(), MODULE_SEP_STRING, NIL, and strdup().

+ Here is the call graph for this function:

◆ make_new_label()

entity make_new_label ( entity  module)

This function returns a new label.

FI: do labels have to be declared?

FI: it's crazy; the name is usually derived from the entity by the caller and here the entity is retrieved from its name!

Parameters
moduleodule

Definition at line 357 of file entity.c.

358 {
359  /* FI: do labels have to be declared?*/
360  /* FI: it's crazy; the name is usually derived from the entity
361  by the caller and here the entity is retrieved from its name! */
363  const char * module_name = entity_undefined_p(module)?
367 
368 }
#define GENERATED_LABEL_MODULE_NAME
char * new_label_local_name(entity module)
Definition: entity.c:326
entity make_label(const char *module_name, const char *local_name)
Definition: entity.c:308

References entity_undefined_p, GENERATED_LABEL_MODULE_NAME, local_name(), make_label(), module, module_local_name(), module_name(), and new_label_local_name().

Referenced by do_clone_label(), do_loop_unroll_with_prologue(), flag_loop(), inline_expression_call(), inlining_regenerate_labels(), make_loop_label(), and MakeEntry().

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

◆ make_uniq_reference_list()

static void make_uniq_reference_list ( reference  r,
deux_listes l 
)
static

Add reference r only once

Definition at line 2818 of file entity.c.

2819 {
2820  entity e = reference_variable(r);
2821  if (! (storage_rom_p(entity_storage(e)) &&
2825 
2826  /* Add reference r only once */
2827  if (l->le ==NIL || !gen_in_list_p(e, l->le)) {
2828  l->le = CONS(ENTITY,e, l->le);
2829  l->lr = CONS(REFERENCE,r,l->lr);
2830  }
2831  }
2832 }
#define REFERENCE(x)
REFERENCE.
Definition: ri.h:2296
#define storage_rom_p(x)
Definition: ri.h:2525

References CONS, ENTITY, entity_initial, entity_storage, entity_type, gen_in_list_p(), deux_listes::le, deux_listes::lr, NIL, REFERENCE, reference_variable, storage_rom_p, type_functional_p, value_symbolic_p, and value_undefined_p.

Referenced by extract_references_from_declarations().

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

◆ MakeCompilationUnitEntity()

entity MakeCompilationUnitEntity ( const char *  name)

This is useful for the C language only.

Normally, the storage must be rom but in order to store the list of entities declared with extern, we use the ram storage to put this list in ram_shared

Parameters
nameame

Definition at line 1954 of file entity.c.

1955 {
1957 
1958  pips_assert("name is a compilation unit name", compilation_unit_p(name));
1959 
1960  /* Normally, the storage must be rom but in order to store the list of entities
1961  declared with extern, we use the ram storage to put this list in ram_shared*/
1965 
1966  if(!type_undefined_p(entity_type(e)))
1967  free_type(entity_type(e));
1969 
1973 
1974  return e;
1975 }
value make_value(enum value_utype tag, void *val)
Definition: ri.c:2832
void free_storage(storage p)
Definition: ri.c:2231
language make_language_c(void)
Definition: ri.c:1253
type make_type_unknown(void)
Definition: ri.c:2724
void free_type(type p)
Definition: ri.c:2658
void free_value(value p)
Definition: ri.c:2787
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
Definition: entity_names.c:56
#define UU
Definition: newgen_types.h:98
@ is_storage_rom
Definition: ri.h:2494
#define storage_undefined_p(x)
Definition: ri.h:2477

References compilation_unit_p(), entity_initial, entity_storage, entity_type, FindOrCreateEntity(), free_storage(), free_type(), free_value(), is_storage_rom, is_value_code, make_code(), make_functional(), make_language_c(), make_sequence(), make_storage(), make_type_functional(), make_type_unknown(), make_value(), NIL, pips_assert, storage_undefined_p, strdup(), TOP_LEVEL_MODULE_NAME, type_undefined_p, UU, and value_undefined_p.

Referenced by add_new_compilation_unit(), add_new_module_from_text(), MakeCurrentCompilationUnitEntity(), and outliner_independent().

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

◆ malloc_effect_entity_p()

bool malloc_effect_entity_p ( entity  e)

Definition at line 1158 of file entity.c.

1159 {
1161  return (same_entity_p(e, malloc_effect_ent));
1162 
1163 }
static entity malloc_effect_ent
Definition: entity.c:53

References malloc_effect_ent, same_entity_p(), and set_internal_static_entities().

Referenced by effects_package_entity_p(), malloc_cell_p(), malloc_effect_p(), and malloc_reference_p().

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

◆ member_entity_p()

bool member_entity_p ( entity  e)

Its name must contain the MEMBER_PREFIX after the MODULE_SEP_STRING

Definition at line 1921 of file entity.c.

1922 {
1923  /* Its name must contain the MEMBER_PREFIX after the MODULE_SEP_STRING */
1924  string en = entity_name(e);
1925  string ms = strchr(en, MODULE_SEP);
1926  bool is_member = false;
1927 
1928  if(ms!=NULL)
1929  is_member = (strchr(ms, MEMBER_SEP_CHAR)!=NULL);
1930 
1931  return is_member;
1932 }

References entity_name, MEMBER_SEP_CHAR, and MODULE_SEP.

Referenced by FindOrCreateCurrentEntity(), skip_constants_intrinsics_members(), and update_unstructured_declarations().

+ Here is the caller graph for this function:

◆ memmove_effect_entity_p()

bool memmove_effect_entity_p ( entity  e)

Definition at line 1165 of file entity.c.

1165  {
1167  return (same_entity_p(e, memmove_effect_ent));
1168 }
static entity memmove_effect_ent
Definition: entity.c:54

References memmove_effect_ent, same_entity_p(), and set_internal_static_entities().

Referenced by effects_package_entity_p().

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

◆ module_local_name()

const char* module_local_name ( entity  e)

Returns the module local user name.

No difference between modules and other entities, except for prefixes

Definition at line 582 of file entity.c.

583 {
584  /* No difference between modules and other entities, except for prefixes */
585  const char* name = local_name(entity_name(e));
586 
587  return (name
589 }

References BLOCKDATA_PREFIX, COMMON_PREFIX, entity_name, F95MODULE_PREFIX, local_name(), and MAIN_PREFIX.

Referenced by add_alias_pairs_for_this_caller(), add_common_variables_to_hash_table(), add_declaration_information(), add_entity_to_declarations(), add_formal_parameters_to_hash_table(), add_formal_to_actual_bindings(), add_module_call_site_precondition(), add_non_declared_reference_to_declaration(), add_symbolic_constant_to_declaration(), AddEntityToCompilationUnit(), AddEntityToModule(), AddVariableToCommon(), alias_check_two_variables(), alias_propagation_callers(), allocatable_area_p(), AnalyzeData(), argument_bound_entity(), c_convex_effects_on_actual_parameter_forward_translation(), c_data_to_prec_for_variables(), c_user_function_call_to_transformer(), call_flt(), call_site_to_module_precondition_text(), call_to_complexity(), call_to_polynome(), cell_reference_compare(), check_call_mode_consistency(), check_one_common(), check_overlap_in_common(), common_is_visible_p(), common_region_translation(), comp_regions_of_call(), comp_regions_of_instruction(), compile_a_pure_function(), compile_a_special_io_function(), complexity_sigma(), constant_entity_to_float(), constant_to_transformer(), create_init_common_param_for_arrays(), create_local_index(), create_local_index2(), create_new_common_variable(), create_parameters_h(), create_tile_basis(), declare_common_variables_in_module(), DeclareExternalFunction(), DeclareVariable(), delay_communications_init(), delay_communications_interprocedurally(), do_kernelize(), do_linearize_array_manage_callers(), do_recompile_module(), dynamic_area_p(), EndOfProcedure(), entity_more_or_less_minimal_name(), evaluate_var_to_complexity(), external_statement_identification(), external_value_name(), find_operator(), fix_storage(), float_constant_to_double(), formal_and_actual_parameters_association(), formal_area_p(), fortran_data_to_prec_for_variables(), fortran_user_call_to_transformer(), fortran_user_function_call_to_transformer(), fprint_any_environment(), generate_variable_with_unique_name_to_module(), generic_module_name_to_transformers(), generic_program_pointer_values(), GenericAddLocalEntityToDeclarations(), get_current_module_name(), get_module_precondition(), get_symbol_table(), gfc2pips_namespace(), heap_area_p(), hpfc_common_hook(), hpfc_entity_reduction_p(), hpfc_main_entity_name(), impact_check_two_variables(), in_regions_of_external(), initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), inlining_regenerate_labels(), insert_check_alias_before_statement(), insert_common_declaration(), insert_flag_before_call_site(), insert_test_before_caller(), insert_test_before_statement(), instruction_to_wp65_code(), is_must_be_written_var(), kernel_load_store_generator(), language_module_p(), live_out_paths_from_caller_to_callee(), live_out_summary_paths_engine(), load_body_effects(), load_summary_effects(), load_summary_precondition(), load_summary_reductions(), load_summary_total_postcondition(), load_summary_transformer(), local_entity_of_module_p(), loop_to_complexity(), main_summary_precondition(), make_empty_module(), make_emulated_shared_variable(), make_new_array_variable_with_prefix(), make_new_derived_entity_with_prefix(), make_new_entity(), make_new_integer_scalar_common_variable(), make_new_label(), make_new_local_variables(), make_new_module_variable(), make_new_scalar_variable_with_prefix(), make_nlc_entity(), make_nsp_entity(), make_nub_entity(), make_scanning_over_one_tile(), make_scanning_over_tiles(), MakeCurrentFunction(), MakeEntry(), MakeEntryCommon(), MakeEquivAtom(), MakeVariableStatic(), module_entity_to_compilation_unit_entity(), module_is_called_by_main_program_p(), module_name_to_total_preconditions(), module_to_value_mappings(), module_to_wp65_modules(), mpi_make_ctx(), new_add_formal_to_actual_bindings(), new_label_local_name(), new_local_image_variable(), noms_var(), old_name(), out_regions_from_caller_to_callee(), parser_macro_expansion(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), pointer_dummy_targets_area_p(), precondition_intra_to_inter(), print_call_path(), print_common_layout(), print_module_icfg(), print_program_precondition(), process_call_for_summary_precondition(), ProcessEntries(), ProcessEntry(), program_points_to(), program_postcondition(), program_precondition(), put_generated_resources_for_common(), put_generated_resources_for_module(), pvecteur_to_polynome(), reduction_parameters(), reference_to_complexity(), reference_to_polynome(), regions_of_external(), relation_to_transformer(), remove_common_variables_from_hash_table(), remove_formal_parameters_from_hash_table(), remove_from_called_modules(), RemoveEntityFromCompilationUnit(), replace_indices_region(), replace_indices_region_com(), retype_formal_parameters(), safescale_distributor(), sc_add_new_variable_name(), sentence_area(), sentence_data_statement(), set_control_to_label(), set_current_function(), set_resources_for_module(), simplify_sc_to_complexity(), stack_area_p(), statement_identification(), statement_to_complexity(), static_area_p(), string_to_entity(), stub_head(), substitute_ghost_variable_in_expression(), text_area_included(), text_complexity(), text_summary_complexity(), Tiling_buffer_allocation(), transformer_add_call_condition_information_updown(), translate_global_value(), translate_to_module_frame(), TranslateEntryFormals(), unique_entity_name_p(), update_common_layout(), update_common_sizes(), update_functional_type_with_actual_arguments(), update_precondition_with_call_site_preconditions(), update_summary_precondition(), update_user_common_layouts(), UpdateFunctionalType(), user_call_to_points_to_fast_interprocedural(), user_call_to_points_to_interprocedural(), user_call_to_points_to_interprocedural_binding_set(), variable_in_module_p(), variable_in_module_p2(), verify_used_before_set_expression(), verify_used_before_set_statement_flt(), and wrap_call_argument().

+ Here is the call graph for this function:

◆ module_name_to_entity()

entity module_name_to_entity ( const char *  mn)

This is an alias for local_name_to_top_level_entity.

Returns
the entity if found, else entity_undefined
Parameters
mnn

Definition at line 1479 of file entity.c.

1479  {
1480  return local_name_to_top_level_entity(mn);
1481 }
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

References local_name_to_top_level_entity().

Referenced by actual_symbol_table_dump(), add_control_counters(), add_new_module_from_text(), any_complexities(), array_expansion(), bdsc_code_instrumentation(), build_new_top_level_module_name(), clean_declarations(), clean_labels(), clear_pragma(), clone_variable_with_new_name(), common_region_translation(), compilation_unit_of_module(), computation_intensity(), compute_distribution_controlization_context(), controlize_distribution(), controlizer(), copy_value_of_write(), copy_value_of_write_with_cumulated_regions(), create_HRE_module(), create_state_variable(), create_stub_entity(), deatomizer(), delay_communications(), delay_communications_interprocedurally(), delay_load_communications(), delay_store_communications(), dimensions_to_dma(), do_gpu_qualify_pointers(), do_inlining(), dowhile_to_while(), dprint(), dsc_code_parallelization(), eliminate_original_variables(), entity_to_callees(), entity_to_module_entity(), expression_substitution(), fetch_callees_complexities(), flag_loops(), flatten_code(), for_loop_to_do_loop(), for_loop_to_while_loop(), formal_array_resizing_bottom_up(), freia_compiler(), freia_remove_scalar_ww_deps(), freia_unroll_while(), fsm_generation(), fsm_merge_states(), fsm_split_state(), full_fsm_generation(), full_spaghettify(), full_unroll(), full_unroll_pragma(), gen_multi_recurse_explorer(), generate_two_addresses_code(), generic_make_entity_copy_with_new_name(), generic_module_initial_pointer_values(), generic_module_name_to_transformers(), generic_module_pointer_values(), generic_points_to_analysis(), generic_print_code_pv(), generic_print_xml_application(), generic_program_pointer_values(), get_loop_execution_parallel(), get_module_language(), get_semantic_text(), get_text_complexities(), gpu_qualify_pointers(), gpu_xml_dump(), group_constants(), hbdsc_parallelization(), hpfc_compile(), hpfc_directives_handler(), html_prettyprint(), if_conversion(), if_conversion_compact(), if_conversion_init(), init_convex_in_out_regions(), init_convex_rw_regions(), init_convex_summary_in_out_regions(), init_convex_summary_rw_regions(), init_points_to_analysis(), initial_points_to(), initial_precondition(), inline_calls(), inline_expression_call(), interactive_loop_transformation(), isolate_statement(), kernel_load_store_engine(), kernelize(), linearize_array_generic(), live_in_summary_paths_engine(), live_out_region_engine(), live_out_summary_paths_engine(), live_paths_engine(), loop_auto_unroll(), loop_expansion(), loop_expansion_init(), loop_nest_unswitching(), loop_pragma(), make_dma_transfert(), make_location_entity(), make_new_index_entity(), make_scalar_entity(), MakeRunTimeSupportSubroutine(), module_is_called_by_main_program_p(), module_loops(), module_name_to_input_file_name(), module_name_to_preconditions(), module_name_to_runtime_entity(), module_name_to_total_preconditions(), module_to_value_mappings(), mpi_conversion(), mpi_task_generation(), new_atomizer(), new_controlizer(), normalize_microcode(), omp_loop_parallel_threshold_set(), omp_merge_pragma(), one_thread_parallelize(), openmp_task_generation(), ordinary_summary_precondition(), outline(), outliner_independent(), outliner_independent_recursively(), outliner_scan(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), phrase_distributor_init(), phrase_remove_dependences(), print_code_or_source(), print_code_or_source_comp(), print_code_semantics(), print_code_smalltalk(), print_crough(), print_decorated_call_graph(), print_initial_precondition(), print_interface(), print_loops(), print_or_dump_points_to(), print_parallelized_code_common(), print_points_to_cells(), print_program_precondition(), print_xml_code(), print_xml_code_with_explicit_motif(), program_points_to(), program_postcondition(), program_precondition(), recompile_module(), reduction_atomization(), reduction_detection(), reduction_propagation(), redundant_load_store_elimination(), remove_simple_scalar_pointers(), rename_operator(), run_inlining(), safescale_distributor(), safescale_distributor_init(), safescale_module_analysis(), scalar_renaming(), sequence_dependence_graph(), sesamify(), set_loop_execution_parallel(), simd_atomizer(), simd_memory_packing(), simd_remove_reductions(), simdizer(), simdizer_auto_tile(), simdizer_auto_unroll(), simdizer_init(), simplify_complex(), simplify_constant_address_expressions(), simplify_subscripts(), solve_hardware_constraints(), spire_distributed_unstructured_to_structured(), spire_shared_unstructured_to_structured(), split_initializations(), split_structures(), split_update_operator(), statement_insertion(), statement_insertion_fix_access_in_callers(), static_controlize(), step_compile_generated_module(), strip_mine(), summary_precondition(), summary_total_postcondition(), symbolic_tiling(), task_mapping(), terapix_remove_divide(), terapix_warmup(), type_checker(), unroll(), update_referenced_entities(), variable_replication(), wp65(), wrap_kernel_argument(), xml_Application(), xml_Boxes(), and xml_Task().

+ Here is the call graph for this function:

◆ module_name_to_runtime_entity()

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

Parameters
nameame

Definition at line 1485 of file entity.c.

1486 {
1487  entity e = module_name_to_entity(name);
1488  if ( entity_undefined_p( e ) )
1489  {
1490  pips_user_warning("entity %s not defined, pips is likely to crash soon\n"
1491  "Please feed pips with its definition and source\n",name);
1493  }
1494 
1495  return e;
1496 }
language copy_language(language p)
LANGUAGE.
Definition: ri.c:1202
#define pips_user_warning
Definition: misc-local.h:146
#define module_language(e)
implemented as a macro to allow lhs
entity make_empty_subroutine(const char *name, language l)
Definition: entity.c:268

References copy_language(), entity_undefined_p, get_current_module_entity(), make_empty_subroutine(), module_language, module_name_to_entity(), and pips_user_warning.

Referenced by comEngine_generate_procCode(), generate_fifo_stat(), make_exec_mmcd(), make_exec_statement_from_name(), make_mmcd_load_store_stat(), make_phi_assign_instruction(), make_read_write_fifo_stat(), make_shuffle_statement(), and make_wait_step_statement().

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

◆ module_resource_name()

const char* module_resource_name ( entity  e)

Returns a pointer towards the resource name.

The resource name is the module local name: it may include the

Definition at line 593 of file entity.c.

594 {
595  const char* rn = entity_local_name(e);
596 
598 
599  return rn;
600 }

References BLOCKDATA_PREFIX, COMMON_PREFIX, entity_local_name(), F95MODULE_PREFIX, and MAIN_PREFIX.

Referenced by callgraph_module_name(), and module_to_callgraph().

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

◆ new_label_local_name()

char* new_label_local_name ( entity  module)

loop

Parameters
moduleodule

Definition at line 326 of file entity.c.

327 {
328  string local_name;
329  const char *module_name ;
330  const char * format;
331 
332  pips_assert( "module != 0", module != 0 ) ;
333 
334  if( module == entity_undefined ) {
336  format = "%d";
337  }
338  else {
340  format = c_module_p(module)?LABEL_PREFIX "l%d":LABEL_PREFIX "%d";
341  }
342  --init;
343  for(asprintf(&local_name, format, init);
345  free(local_name);
346  --init;
347  asprintf(&local_name, format, init);
348  /* loop */
349  }
350  if(init == 0) {
351  pips_internal_error("no more available labels");
352  }
353  return local_name;
354 }
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320

References asprintf, c_module_p(), entity_undefined, entity_undefined_p, FindEntity(), free(), GENERATED_LABEL_MODULE_NAME, init, LABEL_PREFIX, local_name(), module, module_local_name(), module_name(), pips_assert, and pips_internal_error.

Referenced by make_new_label(), set_control_to_label(), and text_io_block_if().

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

◆ operator_neutral_element()

entity operator_neutral_element ( entity  op)
Parameters
opp

Definition at line 2593 of file entity.c.

2594 {
2595  const char * en = entity_user_name(op);
2596 
2597  const char * one_neutral []= {
2603  NULL
2604  };
2605  for(int i=0;one_neutral[i];i++)
2606  if(same_string_p(one_neutral[i],en)) return make_integer_constant_entity(1);
2607 
2608  const char * plus_inf_neutral[] = {
2612  NULL
2613  };
2614  for(int i=0;plus_inf_neutral[i];i++)
2615  if(same_string_p(plus_inf_neutral[i],en)) {
2616  pips_user_warning("assuming reduction on integer\n");
2617  return make_integer_constant_entity(UINT_MAX);
2618  }
2619 
2620  const char * minus_inf_neutral[] = {
2622  NULL
2623  };
2624  for(int i=0;minus_inf_neutral[i];i++)
2625  if(same_string_p(minus_inf_neutral[i],en)){
2626  pips_user_warning("assuming reduction on integer\n");
2627  return make_integer_constant_entity(INT_MIN);
2628  }
2629 
2630  const char * zero_neutral [] ={
2640  NULL
2641  };
2642  for(int i=0;zero_neutral[i];i++)
2643  if(same_string_p(zero_neutral[i],en)) return make_integer_constant_entity(0);
2644 
2645  return entity_undefined;
2646 }
#define BITWISE_OR_OPERATOR_NAME
#define MAX_OPERATOR_NAME
#define BITWISE_OR_UPDATE_OPERATOR_NAME
#define DIVIDE_UPDATE_OPERATOR_NAME
#define LEFT_SHIFT_UPDATE_OPERATOR_NAME
#define MULTIPLY_UPDATE_OPERATOR_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 RIGHT_SHIFT_UPDATE_OPERATOR_NAME
#define PLUS_UPDATE_OPERATOR_NAME
#define BITWISE_AND_UPDATE_OPERATOR_NAME
#define BITWISE_AND_OPERATOR_NAME
#define OR_OPERATOR_NAME
#define MIN_OPERATOR_NAME
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
Definition: variable.c:1345

References AND_OPERATOR_NAME, BITWISE_AND_OPERATOR_NAME, BITWISE_AND_UPDATE_OPERATOR_NAME, BITWISE_OR_OPERATOR_NAME, BITWISE_OR_UPDATE_OPERATOR_NAME, DIVIDE_UPDATE_OPERATOR_NAME, entity_undefined, entity_user_name(), LEFT_SHIFT_UPDATE_OPERATOR_NAME, make_integer_constant_entity(), MAX_OPERATOR_NAME, MIN_OPERATOR_NAME, MINUS_UPDATE_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, MULTIPLY_UPDATE_OPERATOR_NAME, OR_OPERATOR_NAME, pips_user_warning, PLUS_C_OPERATOR_NAME, PLUS_OPERATOR_NAME, PLUS_UPDATE_OPERATOR_NAME, RIGHT_SHIFT_UPDATE_OPERATOR_NAME, and same_string_p.

Referenced by partial_eval_binary_operator().

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

◆ parameter_passing_by_reference_p()

bool parameter_passing_by_reference_p ( entity  f)

Definition at line 2121 of file entity.c.

2122 {
2124 }
bool parameter_passing_mode_p(entity f, int tag)
Returns true when f has no parameters.
Definition: entity.c:2089
@ is_mode_reference
Definition: ri.h:1676

References f(), is_mode_reference, and parameter_passing_mode_p().

+ Here is the call graph for this function:

◆ parameter_passing_by_value_p()

bool parameter_passing_by_value_p ( entity  f)

Definition at line 2116 of file entity.c.

2117 {
2119 }
@ is_mode_value
Definition: ri.h:1675

References f(), is_mode_value, and parameter_passing_mode_p().

+ Here is the call graph for this function:

◆ parameter_passing_mode_p()

bool parameter_passing_mode_p ( entity  f,
int  tag 
)

Returns true when f has no parameters.

Calls thru pointers require syntax_application

It is assumed that all parameters are passed the same way, either by valule or by reference

We are in trouble... because we have to call a higher-level function from the preprocessor library.

Definition at line 2089 of file entity.c.

2090 {
2092 
2093  /* Calls thru pointers require syntax_application */
2094  pips_assert("call to a function", type_functional_p(ft));
2095 
2096  functional ftf = type_functional(ft);
2097  bool mode_p = true;
2098 
2099 
2100  if(!ENDP(functional_parameters(ftf))) {
2101  /* It is assumed that all parameters are passed the same way,
2102  either by valule or by reference */
2104  mode_p = (((int)mode_tag(parameter_mode(p)))==tag);
2105  }
2106  else {
2107  /* We are in trouble... because we have to call a higher-level
2108  function from the preprocessor library. */
2109  if(c_module_p(f))
2110  mode_p = (tag==is_mode_value);
2111  else
2112  mode_p = (tag==is_mode_reference);
2113  }
2114  return mode_p;
2115 }
void const char const char const int
int tag
TAG.
Definition: newgen_types.h:92
#define parameter_mode(x)
Definition: ri.h:1821
#define functional_parameters(x)
Definition: ri.h:1442
#define PARAMETER(x)
PARAMETER.
Definition: ri.h:1788
#define mode_tag(x)
Definition: ri.h:1693

References c_module_p(), CAR, ENDP, entity_type, f(), functional_parameters, int, is_mode_reference, is_mode_value, mode_tag, PARAMETER, parameter_mode, pips_assert, type_functional, type_functional_p, and ultimate_type().

Referenced by parameter_passing_by_reference_p(), and parameter_passing_by_value_p().

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

◆ pointer_type_array_p()

bool pointer_type_array_p ( entity  e)

return true if e has a pointer-type array declarator (the upper bound of the last dimension is equal to 1: REAL A(1) )

Definition at line 826 of file entity.c.

827 {
828  /* return true if e has a pointer-type array declarator
829  (the upper bound of the last dimension is equal to 1: REAL A(1) )*/
830  if (entity_variable_p(e))
831  {
833  list l_dims = variable_dimensions(v);
834  if (l_dims != NIL)
835  {
836  int length = gen_length(l_dims);
837  dimension last_dim = find_ith_dimension(l_dims,length);
838  expression exp = dimension_upper(last_dim);
840  return true;
841  }
842  }
843  return false;
844 }
bool expression_equal_integer_p(expression exp, int i)
================================================================
Definition: expression.c:1977
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References dimension_upper, entity_type, entity_variable_p, exp, expression_equal_integer_p(), find_ith_dimension(), gen_length(), NIL, type_variable, and variable_dimensions.

Referenced by array_size_stride(), and unnormalized_array_p().

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

◆ print_entities()

void print_entities ( list  l)

Definition at line 167 of file entity.c.

168 {
169  FOREACH(ENTITY, e, l) {
170  fprintf(stderr, "%s ", entity_name(e));
171  }
172 }

References ENTITY, entity_name, FOREACH, and fprintf().

Referenced by actual_c_parser(), add_prettyprint_control_list_to_declaration_statement(), alias_propagation(), basic_supporting_entities(), basic_supporting_types(), c_code_string(), clean_up_sequences_rewrite(), compilation_unit_text(), controlize(), controlize_list(), copy_from_call(), copy_from_test(), cusq_ctxt_init(), enum_supporting_entities(), filtered_declaration_list(), find_enum_of_member(), generic_constant_expression_supporting_entities(), initialized_by_equivalent_variable_p(), insert_common_declaration(), kernel_data_mapping(), loop_nest_to_local_variables(), loop_private_variables_as_entites(), MakeBlock(), merge_on_outer(), module_declarations(), outliner_scan(), outliner_statements_referenced_entities(), recursive_functional_type_supporting_entities(), recursive_functional_type_supporting_types(), recursive_type_supporting_entities(), recursive_type_supporting_types(), redeclaration_enter_statement(), region_dynamic_var_elim(), region_exact_projection_along_parameters(), region_exact_projection_along_variables(), region_non_exact_projection_along_parameters(), region_non_exact_projection_along_variables(), regions_transformer_apply(), sesamify(), smalltalk_code_string(), TakeDerivedEntities(), transformer_formal_parameter_projection(), transformer_projection_with_redundancy_elimination_and_check(), transformer_return_value_projection(), update_referenced_entities(), update_unstructured_declarations(), UseFormalArguments(), variable_private_to_loop_p(), variable_type_supporting_entities(), variable_type_supporting_types(), and xml_code_string().

+ Here is the call graph for this function:

◆ print_entity_set()

void print_entity_set ( set  s)

For some reason, here entity is not capitalized.

Definition at line 174 of file entity.c.

175 {
176  /* For some reason, here entity is not capitalized. */
177  SET_FOREACH(entity, e, s) {
178  fprintf(stderr, "%s ", entity_name(e));
179  }
180 }
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
Definition: newgen_set.h:78

References entity_name, fprintf(), and SET_FOREACH.

+ Here is the call graph for this function:

◆ rand_effects_entity_p()

bool rand_effects_entity_p ( entity  e)

Definition at line 1152 of file entity.c.

1153 {
1155  return (same_entity_p(e, rand_gen_ent));
1156 }
static entity rand_gen_ent
effects package entities
Definition: entity.c:52

References rand_gen_ent, same_entity_p(), and set_internal_static_entities().

Referenced by common_region_translation(), and effects_package_entity_p().

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

◆ register_static_entity()

void register_static_entity ( entity e)

add given entity to the set of entities that must reset upon workspace deletion practically, all static entities should be stored that way

Definition at line 156 of file entity.c.

156  {
158  pips_assert("static entity cache is large enough",static_entity_size<STATIC_ENTITY_CACHE_SIZE);
159 }
static size_t static_entity_size
Definition: entity.c:77
static entity * static_entity_cache[STATIC_ENTITY_CACHE_SIZE]
Definition: entity.c:76
#define STATIC_ENTITY_CACHE_SIZE
Definition: entity.c:75

References pips_assert, static_entity_cache, STATIC_ENTITY_CACHE_SIZE, and static_entity_size.

Referenced by entity_nowhere_locations(), and entity_null_locations().

+ Here is the caller graph for this function:

◆ reset_internal_static_entities()

void reset_internal_static_entities ( void  )

Definition at line 119 of file entity.c.

120 {
121 
130 
132  for(size_t i =0;i< static_entity_size;i++)
136 }
static entity time_effect_ent
Definition: entity.c:55
static bool internal_static_entities_initialized_p
Functions closely related to the entity class, constructors, predicates,...
Definition: entity.c:50

References continue_ent, entity_undefined, internal_static_entities_initialized_p, io_eof_ent, io_error_luns_ent, io_ptr_ent, luns_ent, malloc_effect_ent, memmove_effect_ent, rand_gen_ent, static_entity_cache, static_entity_size, and time_effect_ent.

Referenced by reset_static_entities().

+ Here is the caller graph for this function:

◆ reset_label_counter()

void reset_label_counter ( void  )

Definition at line 322 of file entity.c.

323 {
324  init = 100000;
325 }

References init.

Referenced by close_workspace(), ensure_comment_consistency(), fprint_statement(), print_statement_of_module(), and statement_to_text().

+ Here is the caller graph for this function:

◆ reset_static_entities()

void reset_static_entities ( void  )

Definition at line 146 of file entity.c.

147 {
150 }
void reset_internal_static_entities()
Definition: entity.c:119
void reset_std_static_entities()
Definition: entity.c:138

References reset_internal_static_entities(), and reset_std_static_entities().

Referenced by close_workspace(), create_workspace(), and open_workspace().

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

◆ reset_std_static_entities()

void reset_std_static_entities ( void  )

Definition at line 138 of file entity.c.

139 {
144 }
static bool std_static_entities_initialized_p
variables to store entities from standard includes
Definition: entity.c:69

References entity_undefined, std_static_entities_initialized_p, stderr_ent, stdin_ent, and stdout_ent.

Referenced by reset_current_phase_context(), reset_static_entities(), and set_current_phase_context().

+ Here is the caller graph for this function:

◆ safe_entity_name()

string safe_entity_name ( entity  e)

predicates and functions for entities

BEGIN_EOLE

  • please do not remove this line Lines between BEGIN_EOLE and END_EOLE tags are automatically included in the EOLE project (JZ - 11/98)

Definition at line 433 of file entity.c.

434 {
435  string sn = string_undefined;
436 
437  if(entity_undefined_p(e))
438  sn = "undefined object, entity assumed";
439  else if(entity_domain_number(e)!= entity_domain)
440  sn = "not an entity";
441  else
442  sn = entity_name(e);
443  return sn;
444 }

References entity_domain, entity_domain_number, entity_name, entity_undefined_p, and string_undefined.

Referenced by dag_compute_outputs(), dagvtx_dump(), entity_list_dump(), entity_list_p(), IdentifierToExpression(), print_dependence_cone(), and print_loopnest_dependence_cone().

+ Here is the caller graph for this function:

◆ same_entity_name_p()

bool same_entity_name_p ( entity  e1,
entity  e2 
)

compare entity names

Parameters
e1first entity
e2second entity
Returns
true if e1 and e2 have the same name
Parameters
e11
e22

Definition at line 2208 of file entity.c.

2209 {
2210  return same_string_p(entity_name(e1), entity_name(e2));
2211 }

References entity_name, and same_string_p.

Referenced by has_entity_with_same_name().

+ Here is the caller graph for this function:

◆ same_entity_p()

bool same_entity_p ( entity  e1,
entity  e2 
)

predicates on entities

Parameters
e11
e22

Definition at line 1321 of file entity.c.

1322 {
1323  return(e1 == e2);
1324 }

Referenced by _expression_similar_p(), abstract_locations_max(), alias_check(), 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_variable_in_caller_flt(), alias_check_scalar_variable_in_module_flt(), apply_farkas(), attach_ref_to_loop(), basic_concrete_types_compatible_for_effects_interprocedural_translation_p(), call_flt(), cell_reference_compare(), check_loop_distribution_feasability(), code_has_write_eff_ref_p(), common_is_visible_p(), compose_vvs(), compute_regions_union(), conflict_is_a_real_conflict_p(), controlize(), convert_pointer_to_array_aux(), convex_cell_reference_preceding_p(), convex_cells_inclusion_p(), convex_in_effect_loop_range_fix(), da_process_list(), di_polynome_var_subst_null(), distance_between_entity(), do_clone_label(), do_delay_communications_interprocedurally(), do_expression_reduction(), do_grouping_filter_out_self(), do_grouping_replace_reference_by_expression_walker(), do_isolate_statement_preconditions_satisified_p(), do_kernelize(), do_linearize_remove_dereferencment_walker(), do_outliner_smart_replacment(), do_reduction_propagation(), do_remove_entity_from_private(), do_scalar_renaming_in_successors(), do_split_structure_return_hook_walker(), do_terapix_argument_handler(), do_terapix_loop_optimizer(), do_terapix_pointer_initialized_from_a_mask_p(), do_terapix_warmup_patching(), dynamic_alias_check_flt(), effect_may_read_or_write_memory_paths_from_entity_p(), effects_to_dma(), entities_maymust_conflict_p(), entity_anywhere_locations_p(), entity_clean_declarations(), entity_continue_p(), entity_in_ref_list(), entity_local_variable_p(), entity_nowhere_locations_p(), entity_null_locations_p(), entity_used_in_calls_walker(), entity_used_in_reference_walker(), entity_written_p(), expand_reference(), expr_has_write_eff_ref_p(), find_calls_to_function_walker(), find_effect_actions_for_entity(), find_entity_macro(), find_region_on_entity(), find_statements_with_label_walker(), first_reference_certainly_includes_second_reference_p(), formal_variable_add_aliases(), free_to_post_pv(), gather_call_sites(), generic_basic_equal_p(), generic_effect_find_aliases_with_simple_pointer_values(), guess_loop_increment_walker(), guess_loop_lower_bound(), guess_write_effect_on_entity_walker(), impact_check(), index_of_a_loop_p(), indice_p(), interprocedural_mapping(), io_entity_p(), io_luns_entity_p(), is_entity_in_list_p(), isolate_patch_reference(), kill_pointer_value(), list_of_same_or_equivalence_arguments(), loadstore_type_conversion_string(), make_send_receive_conversion(), malloc_effect_entity_p(), memmove_effect_entity_p(), offset_of_struct(), old_prototype_factorize(), outline_remove_duplicates(), outliner_smart_references_computation(), partial_eval_binary_operator(), phrase_check_reference(), pointer_values_remove_var(), process_ref_list(), prototype_factorize(), prototype_var_subst(), rand_effects_entity_p(), real_regions_forward_translation(), references_may_conflict_p(), replace_entity_by_expression_expression_walker(), replace_field_by_reference_walker(), same_call_site_p(), same_callst_p(), same_entities(), same_section_common_variable_in_list_p(), same_section_formal_variable_in_list_p(), same_struct_entity_p(), sc_to_vvs(), set_array_dimension_checked(), simple_cell_reference_preceding_p(), simple_cells_inclusion_p(), simple_pv_translate(), simplify_complex_expression(), stat_has_write_eff_ref_p(), statement_has_omp_parallel_directive_p(), statement_phi_function_p(), std_file_entity_p(), stderr_entity_p(), stdin_entity_p(), stdout_entity_p(), storage_formal_offset(), substitute_entity_in_call(), substitute_expressions(), substitute_variable_in_reference(), successor_conflicts_on_entity_p(), terapix_loop_handler(), terapix_optimize_accumulator(), test_dependence_using_regions(), time_effect_entity_p(), top_down_abc_array(), top_down_abc_call(), translate_to_module_frame(), true_dependence_with_entity_p(), undo_rename_reference(), variable_entities_may_conflict_p(), variable_in_list_p(), variable_is_written_by_statement_flt(), variable_references_may_conflict_p(), vecteur_mult(), verify_formal_and_common_variables(), verify_used_before_set_call(), verify_used_before_set_expression(), verify_used_before_set_statement_flt(), vvs_on_polynome(), vvs_on_vvs(), words_points_to_reference(), xml_Pattern_Paving(), and xml_TaskParameter().

◆ same_field_entity_p()

bool same_field_entity_p ( const entity  f1,
const entity  f2 
)
Parameters
f11
f22

Definition at line 1019 of file entity.c.

1020 {
1021  bool same_p = false;
1022  type t1 = entity_type(f1);
1023  type t2 = entity_type(f2);
1024  if(type_structurally_equal_p(t1,t2)) {
1025  string n1 = (string) entity_user_name(f1);
1026  string n2 = (string) entity_user_name(f2);
1027  if(same_string_p(n1, n2))
1028  same_p = true;
1029  }
1030 
1031  return same_p;
1032 }
char * string
STRING.
Definition: newgen_types.h:39
int f2(int off1, int off2, int w, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:1
bool type_structurally_equal_p(type, type)
Type t1 and t2 are equal if their basic concrete components are equal.
Definition: type.c:586

References entity_type, entity_user_name(), f2(), same_string_p, and type_structurally_equal_p().

Referenced by reference_equal_p().

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

◆ same_struct_entity_p()

bool same_struct_entity_p ( const entity  e0,
const entity  e1 
)
Parameters
e00
e11

Definition at line 1012 of file entity.c.

1013 {
1016  return same_entity_p(s0,s1);
1017 }
entity entity_field_to_entity_struct(entity f)
Definition: entity.c:905
s1
Definition: set.c:247

References entity_field_to_entity_struct(), s1, and same_entity_p().

Referenced by distance_between_entity().

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

◆ set_internal_static_entities()

void set_internal_static_entities ( void  )

beware: cannot be called on creating the database

Definition at line 92 of file entity.c.

93 {
95  {
112 
114 
116  }
117 }
#define IO_EFFECTS_PTR_NAME
To express C IO intrinsics effects.
#define RAND_GEN_EFFECTS_NAME
variable name for random unit
#define RAND_EFFECTS_PACKAGE_NAME
package name for random routines
#define TIME_EFFECTS_PACKAGE_NAME
package name for time routines
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
#define IO_EFFECTS_ARRAY_NAME
array of Logical UNits; it is more or less handled as the current file pointer; in C,...
#define MEMMOVE_EFFECTS_PACKAGE_NAME
package name for memmove routines
#define MALLOC_EFFECTS_NAME
variable name for heap effects
#define CONTINUE_FUNCTION_NAME
#define MEMMOVE_EFFECTS_NAME
variable name for memmove unit
#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 IO_ERROR_ARRAY_NAME
array of error codes for LUNs
#define TIME_EFFECTS_VARIABLE_NAME
variable holding time effects
entity FindOrCreateTopLevelEntity(const char *name)
Return a top-level entity.
Definition: entity.c:1603

References continue_ent, CONTINUE_FUNCTION_NAME, FindOrCreateEntity(), FindOrCreateTopLevelEntity(), internal_static_entities_initialized_p, IO_EFFECTS_ARRAY_NAME, IO_EFFECTS_PACKAGE_NAME, IO_EFFECTS_PTR_NAME, IO_EOF_ARRAY_NAME, io_eof_ent, IO_ERROR_ARRAY_NAME, io_error_luns_ent, io_ptr_ent, luns_ent, malloc_effect_ent, MALLOC_EFFECTS_NAME, MALLOC_EFFECTS_PACKAGE_NAME, memmove_effect_ent, MEMMOVE_EFFECTS_NAME, MEMMOVE_EFFECTS_PACKAGE_NAME, RAND_EFFECTS_PACKAGE_NAME, RAND_GEN_EFFECTS_NAME, rand_gen_ent, time_effect_ent, TIME_EFFECTS_PACKAGE_NAME, and TIME_EFFECTS_VARIABLE_NAME.

Referenced by get_continue_entity(), io_entity_p(), io_luns_entity_p(), malloc_effect_entity_p(), memmove_effect_entity_p(), rand_effects_entity_p(), and time_effect_entity_p().

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

◆ set_register_qualifier()

void set_register_qualifier ( entity  v)

Assuming that v is of type variable, add a qualifier register.

Definition at line 778 of file entity.c.

779 {
780  if(!entity_register_p(v)) {
781  //type uvt = ultimate_type(entity_type(v))
782  type vt = entity_type(v);
783  if(type_variable_p(vt)) {
786  *ql = gen_nconc(*ql, CONS(QUALIFIER, q , NIL));
787  }
788  else
789  pips_internal_error("Improper argument\n");
790  }
791 }
qualifier make_qualifier_register(void)
Definition: ri.c:1933
bool entity_register_p(entity e)
Definition: entity.c:766
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106

References CONS, entity_register_p(), entity_type, gen_nconc(), make_qualifier_register(), NIL, pips_internal_error, QUALIFIER, type_variable, type_variable_p, and variable_qualifiers.

+ Here is the call graph for this function:

◆ set_std_static_entities()

void set_std_static_entities ( void  )

beware: cannot be called on creating the database

entity.c

Definition at line 80 of file entity.c.

References FindEntity(), std_static_entities_initialized_p, stderr_ent, stdin_ent, stdout_ent, and TOP_LEVEL_MODULE_NAME.

Referenced by get_stderr_entity(), get_stdin_entity(), get_stdout_entity(), and std_file_entity_p().

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

◆ sort_list_of_entities()

void sort_list_of_entities ( list  l)

sorted in place.

Definition at line 1358 of file entity.c.

1359 {
1361 }
void gen_sort_list(list l, gen_cmp_func_t compare)
Sorts a list of gen_chunks in place, to avoid allocations...
Definition: list.c:796
int(* gen_cmp_func_t)(const void *, const void *)
Definition: newgen_types.h:114
int compare_entities(const entity *pe1, const entity *pe2)
Comparison function for qsort.
Definition: entity.c:1328

References compare_entities(), and gen_sort_list().

Referenced by dump_common_layout(), entity_generate_missing_declarations(), loop_private_variables_as_entites(), loop_sort_locals(), print_C_common_layout(), print_common_layout(), update_common_sizes(), and update_user_common_layouts().

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

◆ std_file_entity_p()

bool std_file_entity_p ( entity  e)

◆ std_file_entity_to_pointed_file_entity()

entity std_file_entity_to_pointed_file_entity ( entity  e)

Dummy standard files targets.

Definition at line 1243 of file entity.c.

1244 {
1245  string std_file_name;
1246  static string std_file_target_suffix = "";
1247  if (stdin_entity_p(e)) std_file_name = "stdin";
1248  else if (stdout_entity_p(e)) std_file_name = "stdout";
1249  else std_file_name = "stderr";
1250 
1251  string target_name;
1252  asprintf(&target_name,"__%s__%s", std_file_name, std_file_target_suffix);
1253 
1255  target_name);
1256 
1257  if (type_undefined_p(entity_type(target)))
1258  {
1259  type t = entity_type(e);
1265  0, NIL));
1266  entity_kind(target) = EFFECTS_PACKAGE;
1267  }
1268 
1269  return target;
1270 }
bool stdout_entity_p(entity e)
Definition: entity.c:1215
bool stdin_entity_p(entity e)
Definition: entity.c:1203
#define basic_pointer(x)
Definition: ri.h:637

References asprintf, basic_pointer, EFFECTS_PACKAGE, entity_kind, entity_storage, entity_type, FindEntity(), FindOrCreateEntity(), FindOrCreateTopLevelEntity(), IO_EFFECTS_PACKAGE_NAME, is_storage_ram, make_ram(), make_storage(), NIL, STATIC_AREA_LOCAL_NAME, stdin_entity_p(), stdout_entity_p(), type_undefined_p, type_variable, and variable_basic.

Referenced by declaration_to_post_pv().

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

◆ stderr_entity_p()

bool stderr_entity_p ( entity  e)

Definition at line 1226 of file entity.c.

1227 {
1228  return same_entity_p(e, get_stderr_entity());
1229 }
entity get_stderr_entity()
Definition: entity.c:1220

References get_stderr_entity(), and same_entity_p().

+ Here is the call graph for this function:

◆ stdin_entity_p()

bool stdin_entity_p ( entity  e)

Definition at line 1203 of file entity.c.

1204 {
1205  return same_entity_p(e, get_stdin_entity());
1206 }
entity get_stdin_entity()
Definition: entity.c:1197

References get_stdin_entity(), and same_entity_p().

Referenced by com_call(), and std_file_entity_to_pointed_file_entity().

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

◆ stdout_entity_p()

bool stdout_entity_p ( entity  e)

Definition at line 1215 of file entity.c.

1216 {
1217  return same_entity_p(e, get_stdout_entity());
1218 }
entity get_stdout_entity()
Definition: entity.c:1209

References get_stdout_entity(), and same_entity_p().

Referenced by std_file_entity_to_pointed_file_entity().

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

◆ storage_to_string()

string storage_to_string ( storage  s)

Definition at line 2030 of file entity.c.

2031 {
2032  string desc = string_undefined;
2033 
2034  if(storage_undefined_p(s))
2035  desc = "storage_undefined";
2036  else if(storage_return_p(s))
2037  desc = "return";
2038  else if(storage_ram_p(s))
2039  desc = "ram";
2040  else if(storage_formal_p(s))
2041  desc = "formal";
2042  else if(storage_rom_p(s))
2043  desc = "rom";
2044  else
2045  pips_internal_error("Unknown storage tag");
2046 
2047  return desc;
2048 }
#define storage_return_p(x)
Definition: ri.h:2516

References pips_internal_error, storage_formal_p, storage_ram_p, storage_return_p, storage_rom_p, storage_undefined_p, and string_undefined.

Referenced by add_or_kill_equivalenced_variables(), and UpdateEntity().

+ Here is the caller graph for this function:

◆ string_block_scope_p()

bool string_block_scope_p ( string  s)

Definition at line 511 of file entity.c.

512 {
513  // A block scope string is empty or made of numbers each terminated by BLOCK_SEP_STRING
514  char valid[12] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', BLOCK_SEP_CHAR, '\0'};
515  bool is_block_scope = false;
516  string cs = s;
517  bool is_number = false;
518 
519  pips_debug(10, "Potential block scope string = \"%s\"\n", s);
520 
521  if(strspn(s, valid) == strlen(s)) {
522  for(cs=s; *cs!='\0'; cs++) {
523  if(is_number && isdigit(*cs))
524  ;
525  else if(is_number && *cs==BLOCK_SEP_CHAR)
526  is_number = false;
527  else if(!is_number && isdigit(*cs))
528  is_number = true;
529  else if(!is_number && *cs==BLOCK_SEP_CHAR) {
530  is_block_scope = false;
531  break;
532  }
533  }
534  is_block_scope = !is_number;
535  }
536 
537  pips_debug(10, "String = \"%s\" is %sa block scope string\n", s, is_block_scope?"":"not ");
538 
539  return is_block_scope;
540 }

References BLOCK_SEP_CHAR, and pips_debug.

Referenced by CreateEntityFromLocalNameAndPrefix(), CreateMemberScope(), EnterScope(), FindEntityFromLocalNameAndPrefix(), FindOrCreateCurrentEntity(), FindOrCreateEntityFromLocalNameAndPrefixAndScope(), pop_block_scope(), and scope_to_block_scope().

+ Here is the caller graph for this function:

◆ string_struct_scope_p()

bool string_struct_scope_p ( string  s)

same kind of testing required for union as well

Full testing would require a module_name, a block_scope and a struct name

Just lookup the struct identifier

Definition at line 503 of file entity.c.

504 {
505  /* Full testing would require a module_name, a block_scope and a struct name */
506  /* Just lookup the struct identifier*/
507  string ss = strchr(s, MEMBER_SEP_CHAR);
508  return ss != NULL;
509 }

References MEMBER_SEP_CHAR.

◆ string_to_entity_list()

list string_to_entity_list ( string  module,
string  names 
)

of entity

Returns
the list of entities in module the name of which is given warning: the entity is created if it does not exist!
Parameters
modulethe name of the module for the entities
namesa string of comma-separated of entity names
Parameters
moduleodule
namesames

Definition at line 1887 of file entity.c.

1888 {
1889  list le = NIL;
1890  string s, next_comma = (char*) 1;
1891  for (s = names; s && *s && next_comma;)
1892  {
1893  next_comma = strchr(s, ',');
1894  if (next_comma) *next_comma = '\0';
1895  le = CONS(ENTITY, FindOrCreateEntity(module, s), le);
1896  s += strlen(s)+1;
1897  if (next_comma) *next_comma = ',';
1898  }
1899  return le;
1900 }

References CONS, ENTITY, FindOrCreateEntity(), module, and NIL.

+ Here is the call graph for this function:

◆ symbolic_entity_p()

bool symbolic_entity_p ( entity  e)

Definition at line 1277 of file entity.c.

1278 {
1280 }

References entity_initial, value_symbolic_p, and value_undefined_p.

◆ thread_safe_variable_p()

bool thread_safe_variable_p ( entity  v)

Definition at line 2539 of file entity.c.

2540 {
2541  bool thread_safe_p = gen_in_list_p(v, thread_safe_entities);
2542 
2543  return thread_safe_p;
2544 }

References gen_in_list_p(), and thread_safe_entities.

Referenced by AK_ignore_this_successor().

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

◆ time_effect_entity_p()

bool time_effect_entity_p ( entity  e)

Definition at line 1170 of file entity.c.

1170  {
1172  return (same_entity_p(e, time_effect_ent));
1173 }

References same_entity_p(), set_internal_static_entities(), and time_effect_ent.

Referenced by effects_package_entity_p().

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

◆ top_level_entity_p()

bool top_level_entity_p ( entity  e)

Check if the scope of entity e is global.

People are likely to look for global_entity_p(), entity_global_p() or, slightly different, global_variable_p(), variable_global_p(), or still slightly different, global_function_p(),...

Definition at line 1130 of file entity.c.

1131 {
1132  bool top = (strcmp(TOP_LEVEL_MODULE_NAME, entity_module_name(e)) == 0);
1133 
1134  return top;
1135 }

References entity_module_name(), and TOP_LEVEL_MODULE_NAME.

Referenced by add_any_variable_to_area(), CCompilationUnitMemoryAllocations(), cell_out_of_scope_p(), cell_reference_compare(), common_region_translation(), ComputeAddresses(), create_stub_entity(), cumul_and_update_effects_of_statement(), CurrentOffsetOfArea(), dead_fcd_directive_p(), entity_to_module_entity(), fcd_directive_p(), fortran_library_entity_p(), generate_starpu_pragma(), hpf_directive_entity_p(), interprocedural_mapping(), match_call(), new_add_any_variable_to_area(), normalize_intrinsic(), NormalizeIntrinsic(), outliner_independent_recursively(), outliner_scan(), points_to_set_block_projection(), potential_out_effects_p(), realign_directive_p(), redistribute_directive_p(), SafeLocalToGlobal(), set_current_function(), source_to_sinks(), statements_localize_declarations(), translate_global_value(), update_common_layout(), update_referenced_entities(), UseFormalArguments(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_GlobalVariables(), and xml_Region_Parameter().

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

◆ type_used_in_type_declarations_p()

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

Parameters
eentity to check
ldecllist of entities whose declaration may use e
Returns
true if e appears in one of the declaration in ldecl

The dummy declaration may be hidden in a struct or a union declaration. Maybe it could also be hidden in a function declaration.

Parameters
ldecldecl

Definition at line 2289 of file entity.c.

2290 {
2291  bool found_p = false;
2292 
2293  FOREACH(ENTITY, d, ldecl) {
2294  /* The dummy declaration may be hidden in a struct or a union
2295  declaration. Maybe it could also be hidden in a function
2296  declaration. */
2297  type dt = entity_type(d);
2298  if(entity_struct_p(d) || entity_union_p(d) || type_functional_p(dt)) {
2299  list stl = type_supporting_types(dt);
2300 
2301  if(gen_in_list_p(e, stl)) {
2302  pips_debug(8, "entity \"%s\" is used to declare entity \"%s\"\n",
2303  entity_name(e), entity_name(d));
2304  found_p = true;
2305  gen_free_list(stl);
2306  break;
2307  }
2308  else {
2309  gen_free_list(stl);
2310  }
2311  }
2312  }
2313 
2314  return found_p;
2315 }
list type_supporting_types(type)
Return the list of types used to define type t.
Definition: type.c:5203

References ENTITY, entity_name, entity_struct_p(), entity_type, entity_union_p(), FOREACH, gen_free_list(), gen_in_list_p(), pips_debug, type_functional_p, and type_supporting_types().

Referenced by c_text_entities().

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

◆ typedef_entity_p()

bool typedef_entity_p ( entity  e)

Its name must contain the TYPEDEF_PREFIX just after the MODULE_SEP_STRING and the scope information

If there is no scope information, use the module separator

Definition at line 1902 of file entity.c.

1903 {
1904  /* Its name must contain the TYPEDEF_PREFIX just after the
1905  MODULE_SEP_STRING and the scope information */
1906  string en = entity_name(e);
1907  string ms = strrchr(en, BLOCK_SEP_CHAR);
1908  bool is_typedef = false;
1909 
1910  /* If there is no scope information, use the module separator */
1911  if(ms==NULL)
1912  ms = strchr(en, MODULE_SEP);
1913 
1914 
1915  if(ms!=NULL)
1916  is_typedef = (*(ms+1)==TYPEDEF_PREFIX_CHAR);
1917 
1918  return is_typedef;
1919 }
#define TYPEDEF_PREFIX_CHAR
Definition: naming-local.h:63

References BLOCK_SEP_CHAR, entity_name, MODULE_SEP, and TYPEDEF_PREFIX_CHAR.

Referenced by add_prettyprint_control_list_to_declaration_statement(), AddEntityToCompilationUnit(), analyzable_scalar_entity_p(), declarable_type_p(), declaration_to_post_pv(), do_clone_entity(), entity_for_value_mapping_p(), entity_module_p(), FindOrCreateCurrentEntity(), get_symbol_table(), outliner_independent_recursively(), RemoveDummyArguments(), RenameFunctionEntity(), this_entity_cdeclaration(), UpdateEntity(), UseDummyArguments(), UseFormalArguments(), and wipeout_entity().

+ Here is the caller graph for this function:

◆ unnormalized_array_p()

bool unnormalized_array_p ( entity  e)

return true if e is an assumed-size array or a pointer-type array

Definition at line 846 of file entity.c.

847 {
848  /* return true if e is an assumed-size array or a pointer-type array*/
850  return true;
851  return false;
852 }
bool assumed_size_array_p(entity e)
Definition: entity.c:807
bool pointer_type_array_p(entity e)
Definition: entity.c:826

References assumed_size_array_p(), and pointer_type_array_p().

Referenced by formal_array_resizing_bottom_up().

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

◆ update_dummy_parameter()

void update_dummy_parameter ( parameter  p,
entity  ep 
)

Note that free_entity(dummy_identifier(d)) should be performed...

Parameters
epp

Definition at line 2072 of file entity.c.

2073 {
2077  }
2078  else {
2079  dummy d = parameter_dummy(p);
2080 
2081  pips_debug(8, "Dummy identifier changed from \"\%s\" to \"\%s\"\n",
2083  /* Note that free_entity(dummy_identifier(d)) should be performed... */
2084  dummy_identifier(d) = ep;
2085  }
2086 }
dummy make_dummy_identifier(entity _field_)
Definition: ri.c:620
void free_dummy(dummy p)
Definition: ri.c:574
#define dummy_identifier(x)
Definition: ri.h:1033
#define parameter_dummy(x)
Definition: ri.h:1823
#define dummy_unknown_p(x)
Definition: ri.h:1028

References dummy_identifier, dummy_unknown_p, entity_name, free_dummy(), make_dummy_identifier(), parameter_dummy, and pips_debug.

Referenced by RemoveDummyArguments().

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

◆ update_operator_to_regular_operator()

entity update_operator_to_regular_operator ( entity  op)

Returns the binary operator associated to a C update operator such as +=.

If the operator is unknown, an undefined entity is returned.

Parameters
opp

Definition at line 2154 of file entity.c.

2155 {
2156  entity sop = entity_undefined;
2157 
2158  if(ENTITY_PLUS_UPDATE_P(op))
2160  else if(ENTITY_MINUS_UPDATE_P(op))
2162  else if(ENTITY_MULTIPLY_UPDATE_P(op))
2164  else if(ENTITY_DIVIDE_UPDATE_P(op))
2166  else if(ENTITY_MODULO_UPDATE_P(op))
2168  else if(ENTITY_LEFT_SHIFT_UPDATE_P(op))
2170  else if(ENTITY_RIGHT_SHIFT_UPDATE_P(op))
2172  else if(ENTITY_BITWISE_AND_UPDATE_P(op))
2174  else if(ENTITY_BITWISE_XOR_UPDATE_P(op))
2176  else if(ENTITY_BITWISE_OR_UPDATE_P(op))
2178 
2179  return sop;
2180 }
#define ENTITY_PLUS_UPDATE_P(e)
#define ENTITY_MODULO_UPDATE_P(e)
#define BITWISE_XOR_OPERATOR_NAME
#define ENTITY_BITWISE_AND_UPDATE_P(e)
#define C_MODULO_OPERATOR_NAME
#define ENTITY_RIGHT_SHIFT_UPDATE_P(e)
#define LEFT_SHIFT_OPERATOR_NAME
#define ENTITY_BITWISE_OR_UPDATE_P(e)
#define ENTITY_MULTIPLY_UPDATE_P(e)
#define ENTITY_DIVIDE_UPDATE_P(e)
#define ENTITY_BITWISE_XOR_UPDATE_P(e)
#define ENTITY_MINUS_UPDATE_P(e)
#define ENTITY_LEFT_SHIFT_UPDATE_P(e)
#define RIGHT_SHIFT_OPERATOR_NAME

References BITWISE_AND_OPERATOR_NAME, BITWISE_OR_OPERATOR_NAME, BITWISE_XOR_OPERATOR_NAME, C_MODULO_OPERATOR_NAME, DIVIDE_OPERATOR_NAME, ENTITY_BITWISE_AND_UPDATE_P, ENTITY_BITWISE_OR_UPDATE_P, ENTITY_BITWISE_XOR_UPDATE_P, ENTITY_DIVIDE_UPDATE_P, entity_intrinsic(), ENTITY_LEFT_SHIFT_UPDATE_P, ENTITY_MINUS_UPDATE_P, ENTITY_MODULO_UPDATE_P, ENTITY_MULTIPLY_UPDATE_P, ENTITY_PLUS_UPDATE_P, ENTITY_RIGHT_SHIFT_UPDATE_P, entity_undefined, LEFT_SHIFT_OPERATOR_NAME, MINUS_C_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, PLUS_C_OPERATOR_NAME, and RIGHT_SHIFT_OPERATOR_NAME.

Referenced by any_update_to_transformer_list(), call_flt(), split_update_call(), update_operation_to_transformer(), and update_reflhs_with_rhs_to_transformer().

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

Variable Documentation

◆ abstract_state_entities

list abstract_state_entities = NIL
static

FI: hidden variables added to take into account the side effects in the libc.

Without them, dead code elimination would remove calls to rand or malloc. However, there is no useful information to be computed about them. Except perhard, the number of frees wrt the number of malloc. Hence, they are not taken into account by the semantics analysis.

This set may not be a superset of the set of thread-safe variables.

Definition at line 2555 of file entity.c.

Referenced by abstract_state_variable_p(), and add_abstract_state_variable().

◆ arithmetic_functions_set

set arithmetic_functions_set = set_undefined
static

Definition at line 165 of file entity.c.

Referenced by arithmetic_intrinsic_p().

◆ continue_ent

entity continue_ent = entity_undefined
static

continue statement

Definition at line 62 of file entity.c.

Referenced by get_continue_entity(), reset_internal_static_entities(), and set_internal_static_entities().

◆ init

◆ internal_static_entities_initialized_p

bool internal_static_entities_initialized_p = false
static

Functions closely related to the entity class, constructors, predicates,...

Static variable to memoïze some entities for performance reasons variables to store internal entities created at bootstrap beware: these variables are intialized during the parser phase

Definition at line 50 of file entity.c.

Referenced by reset_internal_static_entities(), and set_internal_static_entities().

◆ io_eof_ent

entity io_eof_ent = entity_undefined
static

◆ io_error_luns_ent

entity io_error_luns_ent = entity_undefined
static

◆ io_functions_set

set io_functions_set = set_undefined
static

Definition at line 164 of file entity.c.

Referenced by io_intrinsic_p().

◆ io_ptr_ent

entity io_ptr_ent = entity_undefined
static

◆ label_defined_in_statement

bool label_defined_in_statement = false
static

Definition at line 377 of file entity.c.

Referenced by check_statement_for_label(), and label_defined_in_statement_p().

◆ label_searched_in_statement

entity label_searched_in_statement = entity_undefined
static

Definition at line 378 of file entity.c.

Referenced by check_statement_for_label(), and label_defined_in_statement_p().

◆ luns_ent

◆ malloc_effect_ent

entity malloc_effect_ent = entity_undefined
static

◆ memmove_effect_ent

entity memmove_effect_ent = entity_undefined
static

◆ prefixes

string prefixes[]
static

◆ rand_gen_ent

entity rand_gen_ent = entity_undefined
static

effects package entities

Definition at line 52 of file entity.c.

Referenced by rand_effects_entity_p(), reset_internal_static_entities(), and set_internal_static_entities().

◆ static_entity_cache

entity* static_entity_cache[STATIC_ENTITY_CACHE_SIZE]
static

Definition at line 76 of file entity.c.

Referenced by register_static_entity(), and reset_internal_static_entities().

◆ static_entity_size

size_t static_entity_size =0
static

Definition at line 77 of file entity.c.

Referenced by register_static_entity(), and reset_internal_static_entities().

◆ std_static_entities_initialized_p

bool std_static_entities_initialized_p = false
static

variables to store entities from standard includes

As they are not created at bootstrap as the internal entities, they cannot be initialized at the same time because the corresponding entities may not have been already created

Definition at line 69 of file entity.c.

Referenced by reset_std_static_entities(), and set_std_static_entities().

◆ stderr_ent

◆ stdin_ent

entity stdin_ent = entity_undefined
static

stdio files entities

Definition at line 71 of file entity.c.

Referenced by get_stdin_entity(), reset_std_static_entities(), set_std_static_entities(), and std_file_entity_p().

◆ stdout_ent

◆ thread_safe_entities

list thread_safe_entities = NIL
static

FI: it is assumed that thread safe entities are invariant with respect to workspaces.

Another mechanism will be needed if user variables updated within a critical section also are added to the thread safe variable set.

Thread safe entities are supposed to be updated within critical sections. Hence their dependence arcs may be ignored during parallelization. There is not gaurantee that the semantics is unchanged, for isntance pointer values are likely to differ, but havoc should be avoided and the semantics of programs that are not dependent on pointer values should be preserved.

For the time begin, the set is implemented as a list because very few libc hidden variables are added.

Definition at line 2523 of file entity.c.

Referenced by add_thread_safe_variable(), and thread_safe_variable_p().

◆ time_effect_ent

entity time_effect_ent = entity_undefined
static