PIPS
NewGen functions dealing with list objects

The following functions implement a small library of utilities in the Lisp tradition. More...

Data Structures

struct  cons
 The structure used to build lists in NewGen. More...
 

Macros

#define NEXT(cp)   (((cp) == NIL) ? NIL : (cp)->cdr)
 
#define NIL   ((list)NULL)
 The empty list (nil in Lisp) More...
 
#define POP(l)   ((l)=(l)->cdr)
 Modify a list pointer to point on the next element of the list. More...
 
#define ENDP(l)   ((l)==NIL)
 Test if a list is empty. More...
 
#define list_undefined   ((cons *)-3)
 Undefined list definition :-) More...
 
#define list_undefined_p(c)   ((c)==list_undefined)
 Return if a list is undefined. More...
 
#define CAR(pcons)   ((pcons)->car)
 Get the value of the first element of a list. More...
 
#define CDR(pcons)   ((pcons)->cdr)
 Get the list less its first element. More...
 
#define REFCAR(pc)   (&(CAR(pc).p))
 Get the adress of the first element of a list. More...
 
#define CONS(_t_, _i_, _l_)   gen_##_t_##_cons((_i_),(_l_))
 List element cell constructor (insert an element at the beginning of a list) More...
 
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
 Apply/map an instruction block on all the elements of a list. More...
 
#define VOLATILE_FOREACH(_fe_CASTER, _fe_item, _fe_list)
 
#define MAPL(_map_list_cp, _code, _l)
 Apply some code on the addresses of all the elements of a list. More...
 
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
 Apply/map an instruction block on all the elements of a list (old fashioned) More...
 
#define gen_BOOL_cons   gen_bool_cons
 Another name to the funtion to insert a bool element at the start of a list. More...
 
#define gen_INT_cons   gen_int_cons
 Another name to the funtion to insert an integer element at the start of a list. More...
 
#define gen_LIST_cons   gen_list_cons
 Another name to the funtion to insert a list element at the start of a list. More...
 
#define gen_CONSP_cons   gen_list_cons
 Another name to the funtion to insert a list element at the start of a list. More...
 
#define gen_STRING_cons   gen_string_cons
 Another name to the funtion to insert a string element at the start of a list. More...
 

Typedefs

typedef struct cons cons
 The structure used to build lists in NewGen. More...
 

Functions

bool gen_eq (const void *obj1, const void *obj2)
 
bool gen_list_cyclic_p (const list ml)
 
size_t gen_length (const list l)
 
size_t list_own_allocated_memory (const list l)
 
void gen_mapl (gen_iter_func_t fp, const list l)
 MAP. More...
 
void gen_map (gen_iter_func_t fp, const list l)
 
void * gen_reduce (void *r, void *(*fp)(void *, const list), const list l)
 
bool gen_equals (const list l0, const list l1, gen_eq_func_t equals)
 compares two lists using the functor given in parameters returns true if for all n, the n'th element of first list is equals to the n'th element of the second list More...
 
list gen_some (gen_filter_func_t fp, const list l)
 
static bool cons_of_gen_chunk (const list cp)
 
void gen_insert_after (const void *no, const void *o, list l)
 
list gen_insert_before (const void *no, const void *o, list l)
 
list gen_insert_list (list nl, const void *item, list l, bool before)
 insert nl before or after item in list l, both initial lists are consumed More...
 
list gen_nreverse (list cp)
 reverse a list in place More...
 
void gen_free_list (list l)
 free the spine of the list More...
 
list gen_nconc (list cp1, list cp2)
 physically concatenates CP1 and CP2 but do not duplicates the elements More...
 
void gen_copy (void *a, void *b)
 #define CONS(type,x,l) gen_cons((void*) (x), (l)) More...
 
void * gen_car (list l)
 
void * gen_find_if (gen_filter_func_t test, const list l, gen_extract_func_t extract)
 
void * gen_find_if_from_end (gen_filter_func_t test, const list l, gen_extract_func_t extract)
 the last match is returned More...
 
void * gen_find (const void *item, const list seq, gen_filter2_func_t test, gen_extract_func_t extract)
 
void * gen_find_from_end (const void *item, const list seq, gen_filter2_func_t test, gen_extract_func_t extract)
 
void * gen_find_eq (const void *item, const list seq)
 
list gen_concatenate (const list l1x, const list l2x)
 concatenate two lists. More...
 
list gen_append (list l1, const list l2)
 
list gen_copy_seq (list l)
 Copy a list structure. More...
 
list gen_full_copy_list (list l)
 Copy a list structure with element copy. More...
 
list gen_copy_string_list (list ls)
 of string More...
 
void gen_free_string_list (list ls)
 
list gen_last (list l)
 Return the last element of a list. More...
 
void gen_substitute_chunk_by_list (list *pl, const void *o, list sl)
 substitute item o by list sl in list *pl, which is modified as a side effect. More...
 
bool gen_replace_in_list (list l, const void *s, const void *t)
 substitute all item s by t in list l More...
 
void gen_exchange_in_list (list l, const void *i1, const void *i2)
 exchange items i1 & i2 in the list More...
 
static void gen_remove_from_list (list *pl, const void *o, bool once)
 remove item o from list *pl which is modified as a side effect. More...
 
void gen_remove (list *cpp, const void *o)
 remove all occurences of item o from list *cpp, which is thus modified. More...
 
void gen_remove_once (list *pl, const void *o)
 Remove the first occurence of o in list pl: More...
 
list gen_nthcdr (int n, const list lx)
 caution: the first item is 0! was: return( (n<=0) ? l : gen_nthcdr( n-1, CDR( l ))) ; if n>gen_length(l), NIL is returned. More...
 
gen_chunk gen_nth (int n, const list l)
 to be used as ENTITY(gen_nth(3, l))... More...
 
list gen_once (const void *vo, list l)
 Prepend an item to a list only if it is not already in the list. More...
 
bool gen_in_list_p (const void *vo, const list lx)
 tell whether vo belongs to lx More...
 
int gen_occurences (const void *vo, const list l)
 count occurences of vo in l More...
 
bool gen_once_p (list l)
 FC: ARGH...O(n^2)! More...
 
void gen_free_area (void **p, int size)
 free an area. More...
 
void gen_sort_list (list l, gen_cmp_func_t compare)
 Sorts a list of gen_chunks in place, to avoid allocations... More...
 
void gen_closure (list(*iterate)(), list(*initial)())
 void gen_closure(iterate, initial) list [of X] (*iterate)([ X, list of X ]), initial; More...
 
list gen_make_list (int domain,...)
 
void gen_fprint (FILE *out, string name, const list l, gen_string_func_t item_name)
 
list gen_cons (const void *item, const list next)
 
list gen_typed_cons (_int type, const void *item, const list next)
 CONS a list with minimal type checking this cannot be done within the CONS macro because possible functions calls must not be replicated. More...
 
list gen_bool_cons (bool b, const list l)
 typed cons for "basic" types More...
 
list gen_int_cons (_int i, const list l)
 
list gen_string_cons (string s, const list l)
 
list gen_list_cons (const list i, const list l)
 
list gen_CHUNK_cons (const gen_chunk *c, const list l)
 
list gen_VOID_STAR_cons (const void *e, const list l)
 
void gen_list_and (list *a, const list b)
 Compute A = A inter B: complexity in O(n2) More...
 
void gen_list_and_not (list *a, const list b)
 Compute A = A inter non B: More...
 
void gen_list_patch (list l, const void *x, const void *y)
 Replace all the reference to x in list l by a reference to y: More...
 
int gen_position (const void *item, const list l)
 Element ranks are strictly positive as for first, second, and so on. More...
 
list gen_list_head (list *lp, int n)
 
list gen_common_prefix (const list l1, const list l2)
 return the common list prefix of lists l1 and l2. More...
 

Variables

static gen_chunkgen_chunk_of_cons_of_gen_chunk = gen_chunk_undefined
 SPECIAL INSERTION. More...
 

Detailed Description

The following functions implement a small library of utilities in the Lisp tradition.

Lists are pointers to chunk objects that are linked together in a single forward way.

. GEN_EQ is pointer comparison, . GEN_LENGTH returns the length of the list CP, if it is not cyclic, or loop forever . GEN_MAPL applies (*FP) to every CDR of CP. . GEN_MAP applies (*FP) to every item of the list. . GEN_REDUCE successively applies (*FP) on R adn every CRD of CP. . GEN_SOME aplies (*FP) to every CDR of CP and returns the first sublist whose CAR verifies (*FP). . GEN_INSERT_AFTER inster a new object after a specified object in the list . GEN_MAPC_TABULATED applies (*FP) on every non null element of the domain BINDING. . GEN_FIND_TABULATED retrieves the object of KEY in the tabulated DOMAIN. . GEN_FILTER_TABULATED returns a list of objects from DOMAIN that verify the FILTER. . GEN_FREE_LIST frees the spine of the list L. . GEN_FULL_FREE_LIST frees the whole list L. . GEN_NCONC physically concatenates CP1 and CP2 (returns CP1). . GEN_COPY copies one gen_chunks in another. . GEN_FIND_IF returns the leftmost element (extracted from the cons cell by EXTRACT) of the sequence SEQ that satisfies TEST. EXTRACT should be one of the car_to_domain function that are automatically generated by Newgen. . GEN_FIND_IF_FROM_END is equivalent to GEN_FIND_IF but returns the rightmost element of SEQ. . GEN_FIND returns the leftmost element (extracted from the cons cell by EXTRACT) of the sequence SEQ such that TEST returns true when applied to ITEM and this element. EXTRACT should be one of the car_to_domain function that are automatically generated by Newgen. . GEN_FIND_FROM_END is equivalent to GEN_FIND but returns the rightmost element of SEQ. . GEN_FIND_EQ . GEN_CONCATENATE concatenates two lists. the structures of both lists are duplicated. . GEN_APPEND concatenates two lists. the structure of the first list is duplicated. . GEN_COPY_SEQ . GEN_FULL_COPY_LIST . GEN_COPY_STRING_LIST . GEN_FREE_STRING_LIST . GEN_LAST returns the last cons of a list. . gen_substitute_chunk_by_list . GEN_REMOVE updates the list (pointer) CPP by removing (and freeing) any ocurrence of the gen_chunk OBJ. . GEN_REMOVE_ONCE : Remove the first occurence of obj in list l. . GEN_NTHCDR returns the N-th (beginning at 1) CDR element of L. CDR(L) = GEN_NTHCDR(1,L). . GEN_NTH returns the N-th (beginning at 0) car of L. CAR(L) = GEN_NTH(0,L). . GEN_SORT_LIST(L, compare) sorts L in place with compare (see man qsort) . GEN_ONCE(ITEM, L) prepends ITEM to L if not already there. . GEN_IN_LIST_P(ITEM, L) checks that item ITEM appears in list L . GEN_OCCURENCES(ITEM, L) returns the number of occurences of item ITEM in list L . GEN_ONCE_P(L) checks that each item in list L appears only once . GEN_CLOSURE() . GEN_MAKE_LIST(DOMAIN, ...) makes an homogeneous list of the varargs (but homogeneity is not checked) . gen_list_and(list * a, list b) : Compute A = A inter B . gen_list_and_not(list * a, list b) : Compute A = A inter non B . gen_list_patch(list l, gen_chunk * x, gen_chunk * y) : Replace all the reference to x in list l by a reference to y . gen_position(void * item, list l): rank of item in list l, 0 if not present

Macro Definition Documentation

◆ CAR

#define CAR (   pcons)    ((pcons)->car)

Get the value of the first element of a list.

If CAR is applied on an empty list, a segmentation violation will occur.

It is called CAR in the Lisp tradition, dating back to some register names in an old IBM computer where it was implemented.

@paral pcons is the list

Returns
the value of the first element of the list. Since it is gen_chunk NewGen generic container, it is good behaviour to use through a NewGen accessor, such as STATEMENT(CAR(l)) to the first PIPS statement of a list of statements

Definition at line 92 of file newgen_list.h.

◆ CDR

#define CDR (   pcons)    ((pcons)->cdr)

Get the list less its first element.

Note that the list by itself is not modified, only a pointer to the second element is returned. So this pointer represent the original list less the firs element.

If CDR is applied on an empty list, a segmentation violation will occur.

It is called CDR in the Lisp tradition, dating back to some register names in an old IBM computer where it was implemented.

@paral pcons is the list

Returns
a pointer to the second element of the list. list following value of the first element of the list

Definition at line 111 of file newgen_list.h.

◆ CONS

#define CONS (   _t_,
  _i_,
  _l_ 
)    gen_##_t_##_cons((_i_),(_l_))

List element cell constructor (insert an element at the beginning of a list)

Mimmic the cons function in Lisp: construct a list element cell and link it to a list. So the element is the first element of a new list that goes on with the old one.

Parameters
<em>t</em>is the type of the list element cell to construct
<em>i</em>is the element to put in the list element cell
<em>l</em>is the list to linked the element cell with a the beginning
Returns
the new list with the new element cell at the beginning

For example, to insert a PIPS statement s at the beginning of a statement list sl you can write:

list new_list = CONS(statement, s, sl);

Another way is to directly use the specialized NewGen list constructor for the type:

list new_list = gen_statement_cons(s, sl);

Note that it also works with just the type name in upper case, as:

list l = CONS(STATEMENT, s, l);

Definition at line 150 of file newgen_list.h.

◆ ENDP

#define ENDP (   l)    ((l)==NIL)

Test if a list is empty.

Parameters
lthe list to test
Returns
true if the list is the empty list, false else

Definition at line 66 of file newgen_list.h.

◆ FOREACH

#define FOREACH (   _fe_CASTER,
  _fe_item,
  _fe_list 
)
Value:
list NGMID(l) = (_fe_list); \
for( _fe_CASTER##_TYPE _fe_item; \
!ENDP(NGMID(l)) && \
(_fe_item= _fe_CASTER##_CAST(CAR(NGMID(l)) )); \
POP(NGMID(l)))
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define NGMID(f)
Definition: newgen_types.h:126
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

Apply/map an instruction block on all the elements of a list.

FOREACH(T, v, l) { instructions; } iterates on all the elements of the list l of elements of type T by allocating a local element index variable v of type T. Instructions access the list element through variable v.

FOREACH is similar to MAP but is more gdb/emacs/vim... friendly since it remains line oriented like the C99 for() used to implement it and does not choke on some "," in the instruction block.

Parameters
_fe_CASTERis the type of elements, aka the newgen type name or newgen basic types such as int, string, list.
_fe_itemis the variable to allocate and use as an iterator on the list elements
_fe_listis the list parameter to iterate on

Definition at line 179 of file newgen_list.h.

◆ gen_BOOL_cons

#define gen_BOOL_cons   gen_bool_cons

Another name to the funtion to insert a bool element at the start of a list.

Definition at line 239 of file newgen_list.h.

◆ gen_CONSP_cons

#define gen_CONSP_cons   gen_list_cons

Another name to the funtion to insert a list element at the start of a list.

It is to build list of lists

Definition at line 257 of file newgen_list.h.

◆ gen_INT_cons

#define gen_INT_cons   gen_int_cons

Another name to the funtion to insert an integer element at the start of a list.

Definition at line 243 of file newgen_list.h.

◆ gen_LIST_cons

#define gen_LIST_cons   gen_list_cons

Another name to the funtion to insert a list element at the start of a list.

It is to build list of lists

Definition at line 250 of file newgen_list.h.

◆ gen_STRING_cons

#define gen_STRING_cons   gen_string_cons

Another name to the funtion to insert a string element at the start of a list.

Definition at line 261 of file newgen_list.h.

◆ list_undefined

#define list_undefined   ((cons *)-3)

Undefined list definition :-)

Definition at line 69 of file newgen_list.h.

◆ list_undefined_p

#define list_undefined_p (   c)    ((c)==list_undefined)

Return if a list is undefined.

Note it is different than testing for an empty list.

Definition at line 75 of file newgen_list.h.

◆ MAP

#define MAP (   _map_CASTER,
  _map_item,
  _map_code,
  _map_list 
)
Value:
{ \
list _map_item##_list = (_map_list); \
_map_CASTER##_TYPE _map_item; \
for(; _map_item##_list; POP(_map_item##_list)) \
{ \
_map_item = _map_CASTER(CAR(_map_item##_list)); \
_map_code; \
} \
}
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59

Apply/map an instruction block on all the elements of a list (old fashioned)

Now you should use the more modern FOREACH implementation instead.

Parameters
_map_CASTERis the caster of the type of elements, that is the newgen type name in uppercase, such as STATEMENT for a PIPS statement.
_map_itemis the variable to allocate and use as an iterator on the list elements from _map_code
_map_codeis the statement (block) applied on each element in the variable _map_item
_map_listis the list parameter to iterate on

Definition at line 226 of file newgen_list.h.

◆ MAPL

#define MAPL (   _map_list_cp,
  _code,
  _l 
)
Value:
{ \
list _map_list_cp = (_l) ; \
for(; !ENDP(_map_list_cp); POP(_map_list_cp)) \
_code; \
}

Apply some code on the addresses of all the elements of a list.

Parameters
_map_list_cpis the variable that will iterate on the adresses of all the list elements to be accessed in _code
_codeis the statement (block) applied on each element address in the variable _map_list_cp
_lis the list parameter to iterate on

Definition at line 203 of file newgen_list.h.

◆ NEXT

#define NEXT (   cp)    (((cp) == NIL) ? NIL : (cp)->cdr)

Definition at line 298 of file list.c.

◆ NIL

#define NIL   ((list)NULL)

The empty list (nil in Lisp)

Definition at line 47 of file newgen_list.h.

◆ POP

#define POP (   l)    ((l)=(l)->cdr)

Modify a list pointer to point on the next element of the list.

If a list is considered as a stack and elements are pushed by insertion at the list head, popping an element from the stack can be seen as skipping the first one.

Not that the list elements by themself are not modified.

Parameters
lthe list to pop

Definition at line 59 of file newgen_list.h.

◆ REFCAR

#define REFCAR (   pc)    (&(CAR(pc).p))

Get the adress of the first element of a list.

@paral pcons is the list

Returns
a pointer to the value of the first element of the list

Definition at line 119 of file newgen_list.h.

◆ VOLATILE_FOREACH

#define VOLATILE_FOREACH (   _fe_CASTER,
  _fe_item,
  _fe_list 
)
Value:
volatile list NGMID(l) = (_fe_list); \
for( volatile _fe_CASTER##_TYPE _fe_item; \
!ENDP(NGMID(l)) && \
(_fe_item= _fe_CASTER##_CAST(CAR(NGMID(l)) )); \
POP(NGMID(l)))

Definition at line 186 of file newgen_list.h.

Typedef Documentation

◆ cons

typedef struct cons cons

The structure used to build lists in NewGen.

cons is a list element, list is a pointer to these elements

The names are quite related to their Lisp equivalents.

Function Documentation

◆ cons_of_gen_chunk()

static bool cons_of_gen_chunk ( const list  cp)
static

Definition at line 218 of file list.c.

219 {
221 }
#define CHUNK(x)
Definition: genC.h:90
static gen_chunk * gen_chunk_of_cons_of_gen_chunk
SPECIAL INSERTION.
Definition: list.c:217
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Definition: sc_read.c:87

References CAR, CHUNK, cp, and gen_chunk_of_cons_of_gen_chunk.

Referenced by gen_insert_after().

+ Here is the caller graph for this function:

◆ gen_append()

list gen_append ( list  l1,
const list  l2 
)

Definition at line 471 of file list.c.

472 {
473  cons *l = NIL, *q = NIL;
474 
475  if (l1 == NIL)
476  return(l2);
477 
478  l = q = CONS(CHUNK, CHUNK(CAR(l1)), NIL);
479  l1 = CDR(l1);
480 
481  while (l1 != NIL) {
482  CDR(q) = CONS(CHUNK, CHUNK(CAR(l1)), NIL);
483  q = CDR(q);
484 
485  l1 = CDR(l1);
486  }
487 
488  CDR(q) = l2;
489 
490  return(l);
491 }
#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
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111

References CAR, CDR, CHUNK, CONS, and NIL.

Referenced by add_others_variables(), adg_dataflowgraph(), apply_farkas(), better_elim_var_with_eg(), broadcast_conditions(), broadcast_of_dataflow(), complex_translation_array_of_structs(), complex_translation_struct_of_array(), cumul_and_update_effects_of_statement(), cumul_effects_of_statement(), cutting_conditions(), cycle_to_flow_sensitive_preconditions(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), dag_to_flow_sensitive_preconditions(), dependence_of_dependent_type(), dimensions_to_dma(), do_array_to_pointer(), do_brace_expression_to_statements(), do_linearize_array_init(), do_split_decl_block_statements(), do_symbolic_tiling(), extract_lattice(), fait_quast(), for_to_do_loop_conversion(), get_graph_dataflows(), get_list_of_all_param(), get_stmt_index_coeff(), inline_expression_call(), load_statement_effects(), MakeAssignInst(), mapping_on_broadcast(), new_elim_var_with_eg(), outliner_independent_recursively(), outliner_patch_parameters(), partial_broadcast_coefficients(), partition_unknowns(), plc_make_proto(), remove_a_control_from_a_list_and_relink(), simdize_simple_statements(), simdize_simple_statements_pass2(), simplify_bdt(), step_directive_omp_get_private_entities(), store_local_array_declaration(), unify_lists(), update_user_common_layouts(), and wide_forward_control_map_get_blocs().

+ Here is the caller graph for this function:

◆ gen_bool_cons()

list gen_bool_cons ( bool  b,
const list  l 
)

typed cons for "basic" types

Definition at line 909 of file list.c.

910 {
911  return gen_cons((const void *) (intptr_t)b, l);
912 }
list gen_cons(const void *item, const list next)
Definition: list.c:888
#define intptr_t
Definition: stdint.in.h:294

References gen_cons(), and intptr_t.

+ Here is the call graph for this function:

◆ gen_car()

void* gen_car ( list  l)

Definition at line 364 of file list.c.

365 {
366  return CHUNK(CAR(l));
367 }

References CAR, and CHUNK.

Referenced by get_reference_assignments(), regions_to_loops(), scalar_postlude(), and scalar_prelude().

+ Here is the caller graph for this function:

◆ gen_CHUNK_cons()

list gen_CHUNK_cons ( const gen_chunk c,
const list  l 
)

Definition at line 929 of file list.c.

930 {
931  return gen_cons((const void *) c, l);
932 }

References gen_cons().

+ Here is the call graph for this function:

◆ gen_closure()

void gen_closure ( list (*)()  iterate,
list (*)()  initial 
)

void gen_closure(iterate, initial) list [of X] (*iterate)([ X, list of X ]), initial;

what: computes the transitive closure of sg starting from sg. how: iterate till stability. input: an iterate function and an initial list for the closure. the iterate functions performs some computations on X and should update the list of X to be looked at at the next iteration. This list must be returned by the function. output: none. side effects:

  • none on initial...
  • those of iterate. bugs or features:
  • not idiot proof. may run into an infinite execution...
  • a set base implementation would be nicer, but less deterministic.

of X

Parameters
iteratewhat: computes the transitive closure of sg starting from sg. how: iterate till stability. input: an iterate function and an initial list for the closure. the iterate functions performs some computations on X and should update the list of X to be looked at at the next iteration. This list must be returned by the function. output: none. side effects:
  • none on initial...
  • those of iterate. bugs or features:
  • not idiot proof. may run into an infinite execution...
  • a set base implementation would be nicer, but less deterministic. of X X, list of X

Definition at line 839 of file list.c.

841 {
842  list /* of X */ l_next, l_close = gen_copy_seq(initial);
843  while (l_close)
844  {
845  l_next = NIL;
846  MAPL(cc, l_next = iterate(CHUNK(CAR(cc)), l_next), l_close);
847  gen_free_list(l_close), l_close = l_next;
848  }
849 }
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203

References CAR, CHUNK, gen_copy_seq(), gen_free_list(), MAPL, and NIL.

Referenced by simplify_remapping_graph().

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

◆ gen_common_prefix()

list gen_common_prefix ( const list  l1,
const list  l2 
)

return the common list prefix of lists l1 and l2.

Definition at line 1033 of file list.c.

1034 {
1035  list c1 = l1, c2 = l2, prefix = NIL;
1036  // build in reverse order
1037  for (; c1 && c2 && VOID_STAR(CAR(c1)) == VOID_STAR(CAR(c2));
1038  c1 = CDR(c1), c2 = CDR(c2))
1040  // reverse
1041  return gen_nreverse(prefix);
1042 }
#define VOID_STAR(x)
Definition: genC.h:95
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
static const char * prefix

References CAR, CDR, CONS, gen_nreverse(), NIL, prefix, and VOID_STAR.

+ Here is the call graph for this function:

◆ gen_concatenate()

list gen_concatenate ( const list  l1x,
const list  l2x 
)

concatenate two lists.

the structures of both lists are duplicated.

Returns
a new allocated list with duplicated elements
Parameters
l1,thefirst list to concatenate
l2,thesecond list to concatenate

Definition at line 436 of file list.c.

437 {
438  // break const declaration...
439  list l1 = (list) l1x, l2 = (list) l2x;
440  list l = NIL, q = NIL;
441 
442  if (l1 != NIL) {
443  l = q = CONS(CHUNK, CHUNK(CAR(l1)), NIL);
444  l1 = CDR(l1);
445  }
446  else if (l2 != NIL) {
447  l = q = CONS(CHUNK, CHUNK(CAR(l2)), NIL);
448  l2 = CDR(l2);
449  }
450  else {
451  return NIL;
452  }
453 
454  while (l1 != NIL) {
455  CDR(q) = CONS(CHUNK, CHUNK(CAR(l1)), NIL);
456  q = CDR(q);
457 
458  l1 = CDR(l1);
459  }
460 
461  while (l2 != NIL) {
462  CDR(q) = CONS(CHUNK, CHUNK(CAR(l2)), NIL);
463  q = CDR(q);
464 
465  l2 = CDR(l2);
466  }
467 
468  return l;
469 }
struct cons * list
Definition: newgen_types.h:106

References CAR, CDR, CHUNK, CONS, and NIL.

Referenced by adg_path_max_source(), check_call_distribution_feasability(), fill_gRefToEncLoop_call(), free_guards(), generate_code_call(), HRE_distribute_call(), reference_indices_entity_list(), valuer(), and vvs_on_vvs().

+ Here is the caller graph for this function:

◆ gen_cons()

list gen_cons ( const void *  item,
const list  next 
)

Definition at line 888 of file list.c.

889 {
890  list ncons = (list) alloc(sizeof(struct cons));
891  ncons->car.e = (void *) item;
892  ncons->cdr = (list) next;
893  return ncons;
894 }
char * alloc(int size)
ALLOC is an "iron-clad" version of malloc(3).
Definition: build.c:501
struct cons * cdr
The pointer to the next element.
Definition: newgen_list.h:43
gen_chunk car
The data payload of a list element.
Definition: newgen_list.h:42
void * e
For externals (foreign objects)
Definition: genC.h:65

References alloc(), cons::car, cons::cdr, and gen_chunk::e.

Referenced by call_flt(), gen_bool_cons(), gen_CHUNK_cons(), gen_int_cons(), gen_list_cons(), gen_string_cons(), gen_typed_cons(), gen_union(), gen_VOID_STAR_cons(), get_reference_assignments(), getSymbolBy(), gfc2pips_code2instruction_(), gfc2pips_get_list_of_dimensions2(), gfc2pips_namespace(), gfc2pips_push_last_code(), gfc2pips_push_loop(), make_loadsave_statement(), seq_flt(), set_to_list(), and union_list().

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

◆ gen_copy()

void gen_copy ( void *  a,
void *  b 
)

#define CONS(type,x,l) gen_cons((void*) (x), (l))

Definition at line 359 of file list.c.

360 {
361  * (gen_chunk*)a = * (gen_chunk*)b ;
362 }
A gen_chunk is used to store every object.
Definition: genC.h:58

◆ gen_copy_seq()

list gen_copy_seq ( list  l)

Copy a list structure.

It does not copy the list elements, the new list references the elements of the old one.

Returns
the new list

Begin of the new list:

Pointer to the last element of th new list:

While we are not at the end of the list:

Create a new list element with the current element:

If nle is NIL, it is the first element, so keep it as the list beginning:

Append the new element at the end of the new list:

Update the end pointer:

Look for the next element of the list to copy:

Definition at line 501 of file list.c.

501  {
502  /* Begin of the new list: */
503  list nlb = NIL;
504  /* Pointer to the last element of th new list: */
505  list nle = NIL;
506 
507  /* While we are not at the end of the list: */
508  while (! ENDP(l)) {
509  /* Create a new list element with the current element: */
510  list p = CONS(CHUNK, CHUNK(CAR(l)), NIL);
511 
512  if (nle == NIL)
513  /* If nle is NIL, it is the first element, so keep it as the list
514  beginning: */
515  nlb = p;
516  else
517  /* Append the new element at the end of the new list: */
518  CDR(nle) = p;
519  /* Update the end pointer: */
520  nle = p;
521  /* Look for the next element of the list to copy: */
522  l = CDR(l);
523  }
524 
525  return nlb;
526 }

References CAR, CDR, CHUNK, CONS, ENDP, and NIL.

Referenced by add_one_more_expression(), add_remapping_as_computed(), add_type_information(), aliased_translation_p(), all_previous_stats_with_deps_are_computed(), arguments_union(), assign_statement_task_mapping(), bourdoncle_component(), build_first_comb(), build_third_comb(), check_for_effected_statement(), check_new_arc_for_structured_statement(), compile_mpi(), compute_private_entity_list(), compute_regions_union(), context_dup(), control_shallow_copy(), controlize_forloop(), controlize_list(), controlize_loop(), controlize_test(), controlize_whileloop(), copy_statement_attributes(), copy_to_block(), cycle_to_flow_sensitive_preconditions(), cyclic_graph_to_points_to(), dag_computable_vertices(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), dag_remove_vertex(), davinci_print_control_nodes(), davinci_print_non_deterministic_unstructured(), delay_communications_anyloop(), delay_communications_sequence(), delay_communications_statement(), delay_communications_test(), do_group_constants_terapix(), do_isolate_statement_preconditions_satisified_p(), do_loop_nest_unswitching(), do_redundant_load_store_elimination(), do_remove_redundant_communications_in_anyloop(), do_remove_redundant_communications_in_sequence(), dup_arguments(), ensure_comment_consistency(), entity_list_to_base(), extract_lattice(), fill_gRefToEncLoop_call(), fill_gRefToEncLoop_test(), filter_regions(), find_enum_of_member(), find_exit_control_node(), find_points_to_subscript_for_type(), fix_block_statement_declarations(), fprint_any_environment(), freia_cleanup_sequence_rec(), freia_compile(), freia_dag_optimize(), freia_scalar_rw_dep(), freia_spoc_pipeline(), freia_terapix_call(), fsi_seq_flt(), gen_closure(), gen_copy_list(), generate_code_loop(), generate_copy_loop_nest(), generate_deducables(), generate_remapping_code(), genref_loop(), get_log_buffer(), get_symbol_table(), gfc2pips_code2instruction_(), gfc2pips_computeAdressesOfArea(), gfc2pips_parameters(), gfc2pips_shiftAdressesOfArea(), hierarchize_control_list(), include_time_in_base(), init_statement_equivalence_table(), internal_statement_to_direct_declarations(), level_of(), list_diff(), loop_private_variables_as_entites(), make_array_communication_statement(), make_available_scalar(), make_declarations_statement(), MakeLoopAs(), manage_conflicts(), maybe_unroll_while_rwt(), merge_on_outer(), module_all_declarations(), module_declarations(), module_entities(), module_list_sort(), module_to_all_declarations(), move_ahead(), move_declaration_control_node_declarations_to_statement(), mppa_compile_dag(), new_general_merge_sort(), normalize_microcode(), opencl_compile_mergeable_dag(), outline_remove_duplicates(), outliner_scan(), partition_successor_p(), postcondition_filter(), prepare_array_bounds(), prepare_reindexing(), reduce_sequence(), remove_a_control_from_an_unstructured_without_relinking(), remove_from_effective_parameters(), remove_from_entities(), remove_from_formal_parameters(), remove_not_remapped_leavings(), remove_unreachable_following_control(), remove_unused_remappings(), RemoveLocalEntityFromDeclarations(), replace_control_with_unstructured(), replace_indices_region(), replace_indices_region_com(), rice_update_dependence_graph(), rloops_mapping_of_statement(), SaveChains(), scc_to_dag(), sentence_area(), set_dimensions_of_local_variable_family(), simdizer_auto_tile(), split_initializations_in_statement(), statement_arrows(), statement_clean_declarations_helper(), statement_mark(), statement_purge_declarations_walker(), statement_remove_omp_clauses(), step_statement_path_build(), systeme_to_loop_nest(), terapix_loop_optimizer(), terapixify_loops(), topological_sort(), transformer_list_multiple_closure_to_precondition(), translation_transitive_closure(), try_all_permutations(), words_loop_list(), and words_test_list().

◆ gen_copy_string_list()

list gen_copy_string_list ( list  ls)

of string

Parameters
lsof string

Definition at line 556 of file list.c.

557 {
558  list l = NIL;
559  MAP(STRING, s, l = CONS(STRING, strdup(s), l), ls);
560  return gen_nreverse(l);
561 }
#define STRING(x)
Definition: genC.h:87
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
char * strdup()

References CONS, gen_nreverse(), MAP, NIL, strdup(), and STRING.

Referenced by build_real_resources(), and save_active_phases().

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

◆ gen_eq()

bool gen_eq ( const void *  obj1,
const void *  obj2 
)
Returns
true if object are identical
Parameters
obj1,thefirst object to test for equality
obj2,thesecond object to test for equality

Definition at line 111 of file list.c.

112 {
113  return obj1 == obj2;
114 }

Referenced by ChainIntersection(), find_loop_from_label_walker(), and MergeTwoChains().

+ Here is the caller graph for this function:

◆ gen_equals()

bool gen_equals ( const list  l0,
const list  l1,
gen_eq_func_t  equals 
)

compares two lists using the functor given in parameters returns true if for all n, the n'th element of first list is equals to the n'th element of the second list

Definition at line 192 of file list.c.

193 {
194  list iter0=l0,iter1=l1;
195  while(!ENDP(iter0)&&!ENDP(iter1))
196  {
197  if(!equals(CHUNK(CAR(iter0)),CHUNK(CAR(iter1))))
198  return false;
199  POP(iter0);
200  POP(iter1);
201  }
202  return ENDP(iter0)&&ENDP(iter1);
203 
204 }

References CAR, CHUNK, ENDP, and POP.

Referenced by call_equal_p(), dimensions_equal_p(), do_expressions_to_vector(), outliner_smart_references_computation(), qualifiers_equal_p(), reference_equal_p(), and subscript_equal_p().

+ Here is the caller graph for this function:

◆ gen_exchange_in_list()

void gen_exchange_in_list ( list  l,
const void *  i1,
const void *  i2 
)

exchange items i1 & i2 in the list

Definition at line 651 of file list.c.

652 {
653  while (l)
654  {
655  if (CHUNK(CAR(l))==i1) CHUNK(CAR(l)) = (gen_chunk*) i2;
656  else if (CHUNK(CAR(l))==i2) CHUNK(CAR(l)) = (gen_chunk*) i1;
657  l = CDR(l);
658  }
659 }

References CAR, CDR, and CHUNK.

Referenced by freia_compile().

+ Here is the caller graph for this function:

◆ gen_find()

void* gen_find ( const void *  item,
const list  seq,
gen_filter2_func_t  test,
gen_extract_func_t  extract 
)
Returns
the leftmost element (extracted from the cons cell by EXTRACT) of the sequence SEQ such that TEST returns true when applied to ITEM and this element. EXTRACT should be one of the car_to_domain function that are automatically generated by Newgen.

Definition at line 398 of file list.c.

400 {
401  list pc;
402  for (pc = seq; pc != NIL; pc = pc->cdr )
403  if ((*test)(item, (*extract)(CAR(pc))))
404  return (*extract)(CAR(pc));
405  return gen_chunk_undefined;
406 }
#define gen_chunk_undefined
Definition: genC.h:74

References CAR, cons::cdr, gen_chunk_undefined, and NIL.

Referenced by reference_dependence_variable_check_and_add().

+ Here is the caller graph for this function:

◆ gen_find_eq()

void* gen_find_eq ( const void *  item,
const list  seq 
)

◆ gen_find_from_end()

void* gen_find_from_end ( const void *  item,
const list  seq,
gen_filter2_func_t  test,
gen_extract_func_t  extract 
)

Definition at line 408 of file list.c.

410 {
411  list pc;
412  void * e = gen_chunk_undefined ;
413 
414  for (pc = seq; pc != NIL; pc = pc->cdr ) {
415  if ((*test)(item, (*extract)(CAR(pc))))
416  e = (*extract)(CAR(pc));
417  }
418 
419  return e;
420 }

References CAR, cons::cdr, gen_chunk_undefined, and NIL.

◆ gen_find_if()

void* gen_find_if ( gen_filter_func_t  test,
const list  l,
gen_extract_func_t  extract 
)

Definition at line 370 of file list.c.

371 {
372  list pc = (list) l;
373  for (; pc!=NIL; pc=pc->cdr)
374  if ((*test)((*extract)(CAR(pc))))
375  return (*extract)(CAR(pc));
376  return gen_chunk_undefined;
377 }

References CAR, cons::cdr, gen_chunk_undefined, and NIL.

Referenced by step_compute_CHAINS_DG_SENDRECV_regions(), and step_statement_path_first_directive_statement().

+ Here is the caller graph for this function:

◆ gen_find_if_from_end()

void* gen_find_if_from_end ( gen_filter_func_t  test,
const list  l,
gen_extract_func_t  extract 
)

the last match is returned

Definition at line 382 of file list.c.

384 {
385  list pc = (list) l;
386  void * e = gen_chunk_undefined ;
387  for (; pc!=NIL; pc=pc->cdr)
388  if ((*test)((*extract)(CAR(pc))))
389  e = (*extract)(CAR(pc));
390  return e;
391 }

References CAR, cons::cdr, gen_chunk_undefined, and NIL.

◆ gen_fprint()

void gen_fprint ( FILE *  out,
string  name,
const list  l,
gen_string_func_t  item_name 
)

Definition at line 873 of file list.c.

875 {
876  fprintf(out, "%s = ( ", name);
877  bool nitems = 0;
878  list c = l;
879  while (c)
880  {
881  if (nitems++) fprintf(out, ", ");
882  fprintf(out, "%s", item_name(CHUNK(CAR(c))));
883  c = CDR(c);
884  }
885  fprintf(out, " )\n");
886 }
static FILE * out
Definition: alias_check.c:128
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References CAR, CDR, CHUNK, fprintf(), and out.

Referenced by dag_connected_component(), dag_split_connected_components(), opencl_merge_and_compile(), and sort_subsequence().

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

◆ gen_free_area()

void gen_free_area ( void **  p,
int  size 
)

free an area.

Parameters
ppointer to the zone to be freed.
sizesize in bytes.

Why is this function located in list.c?

Definition at line 775 of file list.c.

776 {
777  int n = size/sizeof(void*);
778  int i;
779  for (i=0; i<n; i++) {
780  *(p+i) = NEWGEN_FREED;
781  }
782  free(p);
783 }
void free(void *)
#define NEWGEN_FREED

References free(), and NEWGEN_FREED.

Referenced by free_bucket(), gen_array_free(), gen_sort_list(), hash_enlarge_table(), hash_table_free(), set_free(), and stack_free().

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

◆ gen_free_list()

void gen_free_list ( list  l)

free the spine of the list

Parameters
[in,out]l,thelist to free

clean

Definition at line 327 of file list.c.

328 {
329  list p, nextp ;
330  for( p = l ; p != NIL ; p = nextp ) {
331  nextp = p->cdr ;
332  CAR(p).p = NEWGEN_FREED; /* clean */
333  CDR(p) = (struct cons*) NEWGEN_FREED;
334  free( p );
335  }
336 }

References CAR, cons::cdr, CDR, free(), NEWGEN_FREED, and NIL.

Referenced by AbortEntries(), actual_c_parser(), add_aliases_for_current_call_site(), add_elem_to_list_of_Pvecteur(), add_implicitly_killed_arcs_to_kill_set(), add_loop_parallel_threshold(), add_prettyprint_control_list_to_declaration_statement(), add_proper_successor_to_predecessor(), add_type_information(), AddEntityToModuleCompilationUnit(), AddOnceToIndicesList(), aliased_translation_p(), alive_arrays(), all_data_to_precondition(), all_previous_stats_with_deps_are_computed(), ancestor_map_consistent_p(), apply_eole_on_statement(), atom_cse_expression(), atomize_cse_this_statement_expressions(), atomize_one_message(), atomizer_of_unstructured(), basic_concrete_types_compatible_for_effects_interprocedural_translation_p(), basic_to_string(), bourdoncle_component(), build_creductions_of_statement(), c_convex_effects_on_actual_parameter_forward_translation(), c_convex_effects_on_formal_parameter_backward_translation(), c_io_function_to_post_pv(), c_text_entity(), c_text_entity_simple(), c_unstructured(), c_user_function_call_to_transformer(), call_nary_rwt(), call_proper_reduction_p(), call_rwt(), call_simplify_rwt(), can_terapixify_expression_p(), cast_to_points_to_sinks(), cell_reference_sc_exact_projection_along_variable(), cell_relations_generic_binary_op(), check_call_distribution_feasability(), check_common_inclusion(), check_control_coherency(), check_for_conflict(), check_for_effected_statement(), check_fortran_declaration_dependencies(), check_loop_distribution_feasability(), check_new_arc_for_structured_statement(), check_test_distribution_feasability(), choose_one_syntax_in_references_list(), clean_ctrl_graph(), clean_distributed_io_system(), clean_enclosing_loops(), clean_list_head(), clean_sdg(), clean_up_control_test(), clean_up_embedding_graph(), clean_up_exit_node(), clean_up_points_to_stubs(), clean_up_sequences_rewrite(), clear_pragma_on_statement(), close_dynamic_locals(), cluster_stage_spire_generation(), CodeGenerate(), comEngine_distribute_code(), comEngine_feasability(), comEngine_opt_loop_interchange(), comp_regions_of_implied_do(), comp_regions_of_unstructured(), compare_statements_on_distance_to_origin(), compilation_unit_text(), compile_body(), complete_any_loop_transformer(), compute_cumulated_reductions(), compute_dead_vertices(), compute_one_summary_reduction(), compute_points_to_binded_set(), compute_points_to_gen_set(), concat_new_entities(), conflict_is_a_real_conflict_p(), constraints_to_loop_bound(), contexts_mapping_of_statement(), control_graph_recursive_decomposition(), control_graph_to_interval_graph_format(), controlize_list(), controlize_sequence(), convex_cell_reference_preceding_p(), convex_effect_to_constant_path_effects_with_pointer_values(), create_init_common_param_for_arrays(), create_k_limited_stub_points_to(), create_parameters_h(), create_realFifo_proc(), cusq_ctxt_reset(), da_simple_statements_pass(), dag_computable_vertices(), dag_compute_outputs(), dag_connected_component(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), dag_remove_unused_inputs(), dag_remove_vertex(), dag_simplify(), dag_split_on_scalars(), dag_terapix_measures(), dag_to_flow_sensitive_preconditions(), dagvtx_dot(), data_to_precondition(), davinci_print_control_nodes(), davinci_print_non_deterministic_unstructured(), db_clean_db_resources(), db_delete_obsolete_resources(), db_get_module_list_initial_order(), db_print_all_required_resources(), declaration_with_overlaps_for_module(), defs_elim_of_unstructured(), delay_communications_anyloop(), delay_communications_call(), delay_communications_intraprocedurally(), delay_communications_sequence(), delay_communications_statement(), delay_communications_test(), delete_named_resources(), dependence_of_dependent_type(), dereferencing_subscript_to_points_to(), dereferencing_to_points_to(), dereferencing_to_sinks(), derived_formal_parameter_to_stub_points_to(), discard_an_unstructured_without_its_statements(), discard_statement_to_goto_table(), display_linked_control_nodes(), DistArraysEffects(), do_array_expansion(), do_array_expansion_aux(), do_brace_expression_to_statements(), do_group_constants_terapix(), do_group_statement_constant(), do_isolate_statement_preconditions_satisified_p(), do_loop_nest_unswitching(), do_remove_redundant_communications_in_anyloop(), do_remove_redundant_communications_in_sequence(), do_scalar_renaming_in_graph(), do_solve_hardware_constraints_on_nb_proc(), do_solve_hardware_constraints_on_volume(), do_split_block_statements(), do_split_structure_parameter(), do_split_structures(), do_terapix_remove_divide(), do_terapix_warmup(), do_unfolding(), drop_distributed_arguments(), dump_common_layout(), effects_to_dma(), empty_transformer(), EndOfProcedure(), ensure_comment_consistency(), entity_list_to_base(), entity_module_unambiguous_user_name(), entity_used_in_declarations_p(), expand_reference(), expr_has_write_eff_ref_p(), expression_to_expression_newbase(), expression_to_points_to_sinks_with_offset(), expression_to_post_pv(), expression_to_string(), extended_regions_must_convex_hull(), extract_fist_item(), extract_references_from_declarations(), fcs_call_flt(), fi_points_to_storage(), fill_gRefToEncLoop_call(), fill_gRefToEncLoop_test(), filter_formal_context_according_to_actual_context(), filter_proper_effects(), filtered_declaration_list(), find_enum_of_member(), find_exit_control_node(), FindAndTopSortSccs(), fix_block_statement_declarations(), flatten_block_if_necessary(), flint_unstructured(), flush_statement_comment(), forloop_to_post_pv(), fortran_user_call_to_transformer(), fortran_user_function_call_to_transformer(), forward_substitute_array_location_in_transformer(), fprint_any_environment(), fprint_expression(), fprint_list_of_exp(), fprint_reference(), fprint_statement(), free_a_control_without_its_statement(), free_arguments(), free_glopriv(), free_hpf_object_lists(), free_meaningless_control(), free_simple_out(), free_static_control_mapping(), free_to_post_pv(), free_vector_list(), freeable_points_to_cells(), freed_list_to_points_to(), freed_pointer_to_points_to(), freia_add_image_arguments(), freia_aipo_compile_calls(), freia_allocate_new_images_if_needed(), freia_cleanup_sequence_rec(), freia_close_dep_cache(), freia_compile(), freia_dag_optimize(), freia_migrate_statements(), freia_mppa_compile_calls(), freia_opencl_compile_calls(), freia_shuffle_move_forward(), freia_spoc_pipeline(), freia_terapix_call(), fsi_seq_flt(), full_copy_p(), full_define_p(), fuse_2_control_nodes(), fuse_points_to_sink_cells(), fuse_sequences_in_unstructured(), gen_closure(), gen_free_string_list(), generate_c1_alpha(), generate_c1_beta(), generate_code(), generate_code_call(), generate_deducables(), generate_fifo_stats(), generate_fifo_stats2(), generate_full_copy(), generate_hpf_remapping_file(), generate_mmcd_stats_from_ref(), generate_remapping_code(), generate_return_code_checks(), generate_scalar_variables(), generic_apply_effects_to_transformer(), generic_eval_cell_with_points_to(), generic_points_to_analysis(), generic_points_to_cells_translation(), generic_reference_to_points_to_matching_list(), generic_remove_unreachable_vertices_in_points_to_graph(), generic_transformer_intra_to_inter(), GenericCleanLocalEntities(), genref_loop(), genref_unstructured(), get_log_buffer(), get_referenced_entities_filtered(), get_symbol_table(), gpu_ify(), gpu_loop_nest_annotate_on_statement(), guard_expanded_statement_if_needed(), guess_late_read_effect_on_entity(), handle_hpf_directives(), hierarchize_control_list(), hpf_compile_parallel_body(), hpf_compile_parallel_loop(), hpf_compile_unstructured(), hpf_remapping(), hpfc_check_for_similarities(), hpfc_order_variables(), HRE_distribute_call(), hwac_replace_statement(), icm_codegen(), image_is_needed(), impact_check_two_scalar_variables_in_path(), include_trans_in_poly(), init_statement_equivalence_table(), inline_expression_call(), inline_split_declarations(), inout_control(), inout_unstructured(), insert_common_declaration(), insert_new_declarations(), instruction_rwt(), internal_pointer_assignment_to_points_to(), interprocedural_mapping(), intrinsic_call_condition_to_points_to(), intrinsic_call_to_points_to(), invalidate_expressions_in_statement(), invariant_expression_p(), kill_pointer_value(), last_statement(), level_of(), link_2_control_nodes(), link_3_control_nodes(), list_assignment_to_points_to(), list_diff(), list_of_compatible_reductions(), list_to_array(), live_in_paths_of_loop(), live_paths_from_block_to_statements(), look_for_nested_loops_unstructured(), loop_annotate(), loop_expansion(), loop_fully_unrollable_p(), loop_initialization_to_transformer(), loop_nest_guard(), loop_nest_to_local_variables(), loop_normalize_of_unstructured(), loop_private_variables(), loop_regions_normalize(), loop_rwt(), loop_to_post_pv(), loop_to_transformer(), make_bound_expression(), make_filtered_dg_or_dvdg(), make_guard_expression(), make_loadsave_statement(), make_seqStat(), make_simple_pv_from_simple_effects(), make_statement_from_statement_list_or_empty_block(), MakeEntryCommon(), MakeSwitchStatement(), malloc_to_points_to_sinks(), manage_conflicts(), mapping_to_value_number(), mask_effects(), match_statement(), maxima_simplify(), maybe_unroll_while_rwt(), memory_leak_to_more_memory_leaks(), merge_on_outer(), merge_points_to_cell_lists(), messages_handling(), module_loops(), module_to_all_declarations(), move_ahead(), move_declaration_control_node_declarations_to_statement(), move_declarations(), mppa_compile_dag(), multiple_pointer_assignment_to_post_pv(), my_system_remove_variables(), nary_call_rwt(), new_array_element_backward_substitution_in_transformer(), normal_expression_of_unstructured(), normalize_microcode(), NormalizeCommonVariables(), null_equal_condition_to_points_to(), old__gpu_ify(), omp_merge_pragma(), one_message_guards_and_neighbour(), only_io_unstructured(), opencl_compile_mergeable_dag(), opencl_merge_and_compile(), order_isomorphic_statements_list(), outline_remove_duplicates(), outline_stmts_between_pragmas_in_sequence(), outliner(), outliner_call(), outliner_file(), outliner_independent_recursively(), outliner_parameters(), outliner_scan(), outliner_smart_references_computation(), output_the_attachments_in_a_sorted_order(), Overlap_Analysis(), partition_successor_p(), partition_to_unstructured(), phrase_check_reference(), phrase_remove_dependences_rwt(), points_to_function_projection(), points_to_path_to_k_limited_points_to_path(), points_to_reference_update_final_subscripts(), points_to_set_block_projection(), points_to_storage(), pop_nesting(), postcondition_filter(), potential_out_effects_p(), pragma_to_string(), precondition_intra_to_inter(), precondition_to_abstract_store(), print_C_common_layout(), print_common_layout(), print_crough(), print_embedding_graph(), print_entity_task_buffers(), print_filtered_dg_or_dvdg(), print_graph_daVinci_from_starting_node(), print_loops_list(), print_qualifier(), print_sesam_tasks_buffers_header(), print_syntax(), print_type(), process_opt_replace(), process_ready_node(), process_ref_list(), process_replacement_HRE_OutRef(), process_static_initializations(), process_user_file(), project_regions_along_loop_index(), prune_non_constant(), Psysteme_to_expression(), put_variables_in_ordered_lists(), rdg_unstructured(), recompute_loop_transformer(), rectangularization_region(), recursive_filter_formal_context_according_to_actual_context(), recursive_functional_type_supporting_entities(), ref_to_dist_array_p(), reference_dereferencing_to_points_to(), reference_indices_entity_list(), reference_may_points_to_null_p(), reference_must_points_to_null_p(), reference_to_points_to_translations(), reference_to_string(), regenerate_renamings(), regenerate_toggles(), region_dynamic_var_elim(), region_exact_projection_along_parameters(), region_exact_projection_along_variable(), region_of_statement(), region_remove_beta_variables(), region_remove_phi_variables(), region_remove_psi_variables(), region_remove_rho_variables(), regions_transformer_apply(), reinitialize_reaching_mappings(), remove_a_control_from_a_list_and_relink(), remove_a_control_from_an_unstructured_without_relinking(), remove_all_unreachable_controls_of_an_unstructured(), remove_from_called_modules(), remove_from_effective_parameters(), remove_from_entities(), remove_from_formal_parameters(), remove_impossible_arcs_to_null(), remove_not_remapped_leavings(), remove_simple_scalar_pointers(), remove_some_unreachable_controls_of_an_unstructured(), remove_STEP_pragma(), remove_unreachable_following_control(), remove_unused_remappings(), remove_useless_continue_or_empty_code_in_unstructured(), remove_variable_from_reduction(), remove_variables_from_system(), remove_variables_if_possible(), RemoveDummyArguments(), RemoveLocalEntityFromDeclarations(), rename_statement_declarations(), reorder_pointer_expression(), replace_control_related_to_a_list(), replace_ref_by_ent(), replicate_cycles(), reset_alternate_return_set(), reset_alternate_returns(), reset_converted_in_effects(), reset_converted_rw_effects(), reset_current_loops(), reset_hooks_call(), reset_module_name_list(), reset_substitute_expression_in_expression(), ResetDerivedEntityDeclarations(), ResetEntries(), restructure_if_then_else(), rice_unstructured(), rice_update_dependence_graph(), rloops_mapping_of_statement(), rloops_mapping_of_unstructured(), root_statement_remapping_inits(), safe_c_words_entity(), safe_effects_for_reductions(), safe_transformer_projection(), same_constant_parameters(), sc_delimiter(), scalopify(), scalopragma(), scc_to_dag(), select_independent_dmas(), self_initialization_p(), sentence_area(), Sentence_Variable(), seq_rwt(), sequence_rewrite(), set_aipo_call(), shape_one_message(), simd_reset_finalArgType(), simdize_simple_statements(), simdizer_auto_tile(), similarity(), simple_effect_to_constant_path_effects_with_pointer_values(), simplified_unstructured(), simplify_complex_expression(), simplify_remapping_graph(), SimplifyGraph(), sort_entities_with_dep(), sort_parameters(), sort_subsequence(), split_initializations_in_statement(), statement_arrows(), statement_clean_declarations_helper(), statement_flatten_declarations(), statement_insertion_fix_access(), statement_insertion_fix_access_in_callers(), statement_newbase(), statement_purge_declarations_walker(), statement_to_points_to(), statement_to_postcondition(), statement_to_text(), statement_to_total_precondition(), statements_localize_declarations(), static_controlize(), static_controlize_unstructured(), stco_renumber_code(), step_handle_reduction_clause(), step_print_directives_regions(), step_statement_path_finalize(), step_translate_and_map(), string_of_type(), string_to_entities(), string_to_expressions(), struct_assignment_to_points_to(), struct_reference_assignment_or_equality_to_transformer(), stub_text(), subscript_to_points_to_sinks(), substitute_stubs_in_transformer(), substitute_stubs_in_transformer_with_translation_binding(), summary_to_proper_reference(), supported_ref_p(), SupressDependances(), switch_vertex_to_a_copy(), switch_vertex_to_assign(), systeme_to_loop_nest(), take_out_the_exit_node_if_not_a_continue(), terapix_loop_optimizer(), terapixify_loops(), TestCoupleOfReferences(), TestDependence(), text_common_declaration(), text_declaration(), text_entity_declaration(), text_equivalences(), text_initializations(), text_loop_90(), text_loop_craft(), text_region_no_action(), text_trail(), text_unstructured(), top_down_abc_flt(), top_down_abc_not_exact_case(), transfert_block(), transformer_arguments_projection(), transformer_combine(), transformer_filter(), transformer_filter_subsumed_variables(), transformer_formal_parameter_projection(), transformer_intersect_range_with_domain(), transformer_list_multiple_closure_to_precondition(), transformer_list_safe_variables_projection(), transformer_projection_with_redundancy_elimination_and_check(), transformer_range(), transformer_return_value_projection(), transformer_temporary_value_projection(), transformer_to_domain(), transformer_variables_filter(), transformers_combine(), translate_arguments(), translate_global_value(), translate_reduction(), translation_transitive_closure(), try_all_permutations(), two_addresses_code_generator(), type_to_full_string_definition(), type_used_in_type_declarations_p(), typedef_formal_parameter_to_stub_points_to(), unlink_copy_vertex(), uns_rwt(), unstructured_consistency_p(), unstructured_does_return(), unstructured_reorder(), unstructured_to_direct_declarations(), unstructured_to_effects(), unstructured_to_flow_insensitive_transformer(), unstructured_to_flow_sensitive_postconditions(), unstructured_to_post_pv(), unstructured_to_postconditions(), unstructured_to_transformer(), unstructured_to_transformers(), unstructured_while_p(), update_common_sizes(), update_erosions(), update_operation_to_transformer(), update_partition(), update_reduction_under_effect(), update_statement_instruction(), update_unstructured_declarations(), update_user_common_layouts(), UpdateEntity(), UpdatePointerEntity(), upgrade_approximations_in_points_to_set(), UseDummyArguments(), UseFormalArguments(), user_call_to_points_to_sinks(), value_passing_summary_transformer(), vertex_mergeable_p(), whileloop_to_post_pv(), Words_Any_Reference(), Words_Call(), Words_Regular_Call(), Words_Subexpression(), Words_Syntax(), written_effects_to_dist_arrays_p(), and xml_Region_Parameter().

+ Here is the call graph for this function:

◆ gen_free_string_list()

void gen_free_string_list ( list  ls)
Parameters
lsof string

Definition at line 564 of file list.c.

565 {
566  gen_map(free, ls);
567  gen_free_list(ls);
568 }
void gen_map(gen_iter_func_t fp, const list l)
Definition: list.c:172

References free(), gen_free_list(), and gen_map().

Referenced by build_real_resources(), close_log_buffer(), print_crough(), retrieve_active_phases(), text_pointer_value(), and text_points_to_relation().

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

◆ gen_full_copy_list()

list gen_full_copy_list ( list  l)

Copy a list structure with element copy.

It does copy the list elements.

Returns
the new list

Create a new list element with a copy of the current element:

Definition at line 535 of file list.c.

535  {
536  list nlb = NIL;
537  list nle = NIL;
538 
539  while (! ENDP(l)) {
540  /* Create a new list element with a copy of the current element: */
541  list p = CONS(CHUNK, gen_copy_tree(CHUNK(CAR(l))), NIL);
542 
543  if (nle == NIL)
544  nlb = p;
545  else
546  CDR(nle) = p;
547  nle = p;
548  l = CDR(l);
549  }
550 
551  return nlb;
552 }
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429

References CAR, CDR, CHUNK, CONS, ENDP, gen_copy_tree(), and NIL.

Referenced by add_aliases_for_current_call_site(), array_type_projection(), array_type_to_sub_array_type(), basic_of_intrinsic(), binary_intrinsic_call_to_points_to_sinks(), bound_to_statement(), compute_basic_concrete_type(), compute_points_to_kill_set(), conditional_operator_to_post_pv(), control_to_points_to(), controlize_list(), copy_loops(), create_stub_points_to(), dereferencing_subscript_to_points_to(), dereferencing_to_sinks(), dimension_dup(), dimensions_to_normalized_dimensions(), do_array_expansion(), do_brace_expression_to_statements(), do_clone_entity(), do_outliner_smart_replacment(), effects_to_dma(), expression_to_points_to_sinks_with_offset(), expression_to_type(), fi_points_to_storage(), find_first_written_array(), forloop_to_post_pv(), formal_variable_add_aliases(), forward_substitute_array_location_in_transformer(), free_guards(), freia_transpose_kernel(), generic_module_pointer_values(), generic_points_to_analysis(), generic_program_pointer_values(), inline_expression_call(), intrinsic_call_to_type(), kill_pointer_values(), loop_to_post_pv(), lUpdateExpr(), make_com_loopbody(), make_loadsave_statement(), make_read_loopbody(), make_send_receive_conversion(), make_seqStat(), make_statement_copy_i(), make_temporary_pointer_to_array_entity_with_prefix(), make_write_loopbody(), malloc_arg_to_type(), maybe_unroll_while_rwt(), merge_transformer_lists(), module_initial_parameter_pv(), mppa_helper_args_params(), new_array_element_backward_substitution_in_transformer(), new_points_to_unstructured(), outliner_smart_references_computation(), points_to_binding_arguments(), points_to_expression_to_pointed_type(), points_to_list_sort(), points_to_reference_to_translation(), points_to_storage(), private_ultimate_type(), promote_local_entities(), r_cell_reference_to_type(), reference_to_type(), refine_points_to_cell_subscripts(), regions_to_loops(), replace_entity_by_expression_expression_walker(), replace_indices_region(), replace_indices_region_com(), sc_delimiter(), sequence_to_post_pv(), split_complex_expression(), statement_insertion_fix_access_in_callers(), statement_to_points_to(), statement_to_post_pv(), struct_variable_to_pointer_locations(), subscript_to_points_to_sinks(), subscripted_type_to_type(), test_to_post_pv(), top_down_abc_flt(), transformer_list_closure_to_precondition_depth_two(), transformer_list_closure_to_precondition_max_depth(), translate_IO_ref(), type_to_named_type(), undo_rename_reference(), unstructured_to_effects(), unstructured_to_post_pv(), update_vector_to_expressions(), UpdateType(), user_call_to_points_to_fast_interprocedural(), user_call_to_points_to_interprocedural(), user_call_to_points_to_interprocedural_binding_set(), whileloop_to_post_pv(), and whileloop_to_postcondition().

+ Here is the call graph for this function:

◆ gen_in_list_p()

bool gen_in_list_p ( const void *  vo,
const list  lx 
)

tell whether vo belongs to lx

found!

else no found

Definition at line 734 of file list.c.

735 {
736  list l = (list) lx;
737  gen_chunk * item = (gen_chunk*) vo;
738  for (; !ENDP(l); POP(l))
739  if (CHUNK(CAR(l))==item) return true; /* found! */
740 
741  return false; /* else no found */
742 }

References CAR, CHUNK, ENDP, and POP.

Referenced by abstract_state_variable_p(), add_abstract_state_variable(), add_any_variable_to_area(), add_proper_successor_to_predecessor(), add_thread_safe_variable(), AddToDeclarations(), AddToExterns(), alive_arrays(), backward_control_map_get_blocs_but(), c_text_related_entities(), callnodeclfilter(), CCompilationUnitMemoryAllocations(), check_control_statement(), check_loop_distribution_feasability(), check_way_between_two_statements(), clean_up_points_to_stubs(), CModuleMemoryAllocation(), compilation_unit_text(), controlize_goto(), controlize_sequence(), dag_append_vertex(), dag_dot(), dag_fix_image_reuse(), dag_remove_vertex(), dag_vertex_preds(), dagvtx_get_producer(), davinci_print_non_deterministic_unstructured(), declarable_type_p(), duplicate_regions_referenced_entity(), ensure_comment_consistency(), entity_more_or_less_minimal_name(), entity_used_in_declarations_p(), entry_or_exit_control_p(), erode_alu_shared_p(), explicit_extern_entity_p(), expr_flt(), expr_rwt(), extern_entity_p(), find_a_control_path(), find_enum_of_member(), find_exit_control_node(), FindOrCreateCurrentEntity(), fix_storage(), forward_control_map_get_blocs_but(), freia_dag_optimize(), freia_hack_fix_global_ins_outs(), freia_spoc_pipeline(), freia_terapix_call(), full_define_p(), fuse_sequences_in_unstructured(), gen_list_and(), gen_list_and_not(), gen_once_p(), gen_union(), generate_dynamic_liveness_for_primary(), generate_dynamic_liveness_management(), generic_c_words_simplified_entity(), generic_substitute_formal_array_elements_in_transformer(), generic_transformer_to_analyzed_locations(), handle_independent_directive(), hpf_compile_unstructured(), hpf_pure_p(), hpf_remapping(), hpfc_check_for_similarities(), hpfc_order_specific_variables(), hpfc_order_variables(), hpfc_special_fake(), hpfc_special_io(), image_is_needed(), intersect_successors_with_partition_or_complement(), interval_exit_nodes(), invariant_expression_p(), is_consummed_by_vertex(), make_declarations_statement(), make_filtered_dg_or_dvdg(), make_uniq_reference_list(), MakeFunctionExpression(), MakeStorageRam(), mapping_to_domain_list(), mapping_to_value_number(), mppa_compile_dag(), mppa_dag_split(), new_add_any_variable_to_area(), no_other_effects_on_references(), only_minor_statements_in_between(), opencl_merge_and_compile(), partition_successor_p(), partition_to_unstructured(), points_to_set_block_projection(), print_embedding_graph(), process_static_initialization(), propagation_on_remapping_graph(), ready_to_be_processed_p(), reference_to_points_to_sinks(), referencenodeclfilter(), reinitialize_reaching_mappings(), relevant_translation_pair_p(), remove_module_entity(), remove_not_remapped_leavings(), remove_unused_remappings(), replace_control_related_to_a_list(), replace_reductions_in_statement(), replicate_cycles(), reset_hooks_register(), reset_hooks_unregister(), safe_add_vertex_to_list(), safe_effects_for_reductions(), safe_free_vertex(), sc_delimiter(), sc_kernel_specific_agent(), scanners_then_others(), sigmac_params_decl(), statements_to_direct_declarations(), step_private_p(), subscripted_field_list_to_type(), TakeDerivedEntities(), thread_safe_variable_p(), transformer_list_preserved_variables(), transformer_list_to_argument(), transformer_to_analyzed_arrays(), transformer_to_local_values(), transformer_to_potential_stub_translation(), type_used_in_type_declarations_p(), union_list(), unstructured_to_transformer(), update_partition(), update_predecessors_of_successor(), update_successor_in_copy(), update_successors_of_predecessor(), update_unstructured_declarations(), UpdateEntity(), vertex_mergeable_p(), and written_p().

◆ gen_insert_after()

void gen_insert_after ( const void *  no,
const void *  o,
list  l 
)

Definition at line 223 of file list.c.

224 {
225  gen_chunk * new_obj = (gen_chunk*) no, * obj = (gen_chunk*) o;
226  cons *obj_cons = NIL;
228 
230  assert(!ENDP(obj_cons));
231  CDR(obj_cons) = CONS(CHUNK, new_obj, CDR(obj_cons));
232 }
list gen_some(gen_filter_func_t fp, const list l)
Definition: list.c:206
static bool cons_of_gen_chunk(const list cp)
Definition: list.c:218
#define assert(ex)
Definition: newgen_assert.h:41
bool(* gen_filter_func_t)(const void *)
Definition: newgen_types.h:109

References assert, CDR, CHUNK, CONS, cons_of_gen_chunk(), ENDP, gen_chunk_of_cons_of_gen_chunk, gen_some(), and NIL.

Referenced by insert_endscop_after_stmt(), insert_optional_pragma(), insert_statement_in_block(), and NormalizeCommonVariables().

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

◆ gen_insert_before()

list gen_insert_before ( const void *  no,
const void *  o,
list  l 
)

result

current

previous

search obj in list

obj is not the first object of the list

obj is the first object

Definition at line 238 of file list.c.

239 {
240  gen_chunk * new_obj = (gen_chunk*) no;
241  gen_chunk * obj = (gen_chunk*) o;
242 
243  list r = NIL; /* result */
244  list c = l; /* current */
245  list p = NIL; /* previous */
246 
247  /* search obj in list */
248  for ( ; c!=NIL ; c=c->cdr)
249  if ( CHUNK(CAR(c))==obj )
250  break;
251  else
252  p = c;
253 
254  assert(!ENDP(c));
255 
256  if (p) { /* obj is not the first object of the list */
257  CDR(p) = CONS(CHUNK, new_obj, CDR(p));
258  r = l;
259  }
260  else { /* obj is the first object */
261  r = CONS(CHUNK, new_obj, c);
262  }
263  return r;
264 }

References assert, CAR, cons::cdr, CDR, CHUNK, CONS, ENDP, and NIL.

Referenced by insert_before_current_statement(), insert_endscop_before_stmt(), insert_statement_in_block(), mppa_dag_split(), phrase_check_reference(), pragma_to_string(), and simd_insert_statement().

+ Here is the caller graph for this function:

◆ gen_insert_list()

list gen_insert_list ( list  nl,
const void *  item,
list  l,
bool  before 
)

insert nl before or after item in list l, both initial lists are consumed

Returns
the new list

Definition at line 269 of file list.c.

270 {
271  // fast case
272  if (!nl) return l;
273 
274  // find insertion position in l
275  list p = NIL, c = l, head;
276  while (c && CHUNK(CAR(c))!=item)
277  p = c, c = CDR(c);
278  message_assert("item is in list", c!=NIL);
279 
280  // possibly forward one link if insertion is "after" the item
281  if (!before)
282  p = c, c = CDR(c);
283 
284  // link and set list head
285  if (p) // some previous
286  CDR(p) = nl, head = l;
287  else // no previous
288  p = nl, head = nl;
289 
290  // forward to link the tail, hold by "c"
291  while (CDR(p)) p = CDR(p);
292  CDR(p) = c;
293 
294  // done
295  return head;
296 }
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References CAR, CDR, CHUNK, message_assert, and NIL.

◆ gen_int_cons()

list gen_int_cons ( _int  i,
const list  l 
)

Definition at line 914 of file list.c.

915 {
916  return gen_cons((const void *) i, l);
917 }

References gen_cons().

+ Here is the call graph for this function:

◆ gen_last()

list gen_last ( list  l)

Return the last element of a list.

Parameters
[in]lis the list we want the last element
Returns
the last element. If the list is empty, return an empty element.

NIL case

else go to the last

Definition at line 578 of file list.c.

579 {
580  if (ENDP(l)) return l; /* NIL case */
581  while (!ENDP(CDR(l))) l=CDR(l); /* else go to the last */
582  return l;
583 }

References CDR, and ENDP.

Referenced by adapt_reference_to_type(), add_alias_lists_callee(), add_words_to_text(), any_expressions_to_transformer(), any_user_call_site_to_transformer(), array_type_projection(), attach_ref_to_loop(), attach_to_sentence_up_to_end_of_text(), attach_to_text(), attach_to_words(), basic_of_intrinsic(), binary_arithmetic_operator_to_post_pv(), c_text_related_entities(), check_C_function_type(), check_call_args_number(), check_for_conflict(), CheckExternList(), compute_points_to_binded_set(), condition_to_transformer(), controlize_sequence(), effect_words_reference(), ensure_comment_consistency(), find_a_control_path(), find_aipo_statement(), find_exit_control_node(), find_final_statement_label(), free_guards(), freia_allocate_new_images_if_needed(), freia_reduction_variable(), fsi_seq_flt(), gather_local_indices(), gen_substitute_chunk_by_list(), handle_align_and_realign_directive(), handle_distribute_and_redistribute_directive(), inline_expression_call(), insert_before_current_statement(), intrinsic_call_to_points_to_sinks(), intrinsic_call_to_type(), last_statement(), last_word_of_sentence(), loop_chunk_size_and_strip_mine(), make_simd_statements(), move_declaration_control_node_declarations_to_statement(), phrase_remove_dependences_rwt(), points_to_cell_update_last_subscript(), points_to_path_to_k_limited_points_to_path(), points_to_reference_to_type(), points_to_reference_to_typed_index(), points_to_translation_of_formal_parameters(), pragma_omp_p(), pragma_PRAGMA_DISTRIBUTED_p(), reduce_cell_to_pointer_type(), ref_in_implied_do(), split_initializations_in_statement(), statements_to_declarations(), topological_sort(), type_compatible_super_cell(), type_compatible_with_points_to_cell_p(), typing_arguments_of_user_function(), words_any_reference(), and words_infix_binary_op().

◆ gen_length()

size_t gen_length ( const list  l)
Returns
the length of the list
Parameters
[in]l,thelist to evaluate, assumed to be acyclic

Definition at line 150 of file list.c.

151 {
152  list cp = l;
153  size_t i;
154  for (i = 0; cp != NIL ; cp = cp->cdr, i++) {;}
155  return i;
156 }

References cp, and NIL.

Referenced by __attribute__(), _expression_similar_p(), abc_with_allocation_size(), activate_phase(), adapt_reference_to_type(), add_aliases_for_current_call_site(), add_bound_arguments(), add_conflicts(), add_implicitly_killed_arcs_to_kill_set(), add_prettyprint_control_list_to_declaration_statement(), add_proper_successor_to_predecessor(), add_reference_information(), add_test_successor(), address_of_scalar(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_decreasing_stat_order_sort(), adg_quast_leaf_solution_equal_p(), alias_check(), align_check(), alloc_instrumentation(), allocate_task_to_cluster(), analyze_quast(), AnalyzeData(), any_assign_to_transformer(), any_basic_update_to_transformer(), any_update_to_transformer(), any_user_call_site_to_transformer(), apply_eole_on_statement(), apply_transformer_lists_generic(), array_size_stride(), array_type_dimension(), assign_substring_type(), assumed_size_array_p(), atom_cse_expression(), atomize_call(), atomize_or_associate_for_level(), base_complete(), basic_concrete_types_compatible_for_effects_interprocedural_translation_p(), basic_of_intrinsic(), BDSC(), binary_arithmetic_operator_to_post_pv(), binary_to_normalized(), block_to_complexity(), block_to_transformer_list(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), bound_to_statement(), broadcast_conditions(), build_call_STEP_init_regionArray(), build_creductions_of_statement(), build_first_comb(), build_options_menu_and_panel(), build_third_comb(), build_third_subcomb(), build_trail(), c_convex_effects_on_actual_parameter_forward_translation(), c_convex_effects_on_formal_parameter_backward_translation(), C_pointer_type_p(), c_text_related_entities(), C_type_to_pointed_type(), c_unstructured(), call_count_flt(), call_nary_rwt(), call_rwt(), call_simplify_rwt(), caller_list_of_bounds(), CardinalityOf(), cell_reference_compare(), cells_to_read_or_write_effects(), change_base_in_sc(), check_C_function_type(), check_call_args_number(), check_call_mode_consistency(), check_call_types_compatibility(), check_control_statement(), check_io_list(), check_loop_distribution_feasability(), check_the_call(), check_the_reference(), CheckExternList(), clean_up_control_test(), clean_up_embedding_graph(), clean_up_exit_node(), clean_up_sequences_rewrite(), cluster_stage_spire(), cmf_layout_align(), CodeGenerate(), com_call(), combine_transformer_lists(), communications_construction(), compact_list(), compare_list_from_length(), compile_reduction(), complete_points_to_reference_with_fixed_subscripts(), completer_base(), compute_points_to_binded_set(), compute_points_to_gen_set(), compute_receive_content(), compute_regions_union(), compute_summary_reductions(), connect_unstructured(), consistent_points_to_arc_p(), constant_image_p(), constraint_to_bound(), constraints_to_loop_bound(), continue_propagation_p(), control_graph_recursive_decomposition(), control_propagate(), control_test_p(), controlize(), controlize_distribution(), controlize_repeatloop(), controlize_sequence(), controlize_whileloop(), convert_local_to_pointer_array(), convex_cell_reference_preceding_p(), copy_image_p(), count_element_references_to_v_p(), craft_layout_align(), create_module_with_statement(), create_new_declaration(), create_overlaps(), create_pointer_to_array_stub_points_to(), cstr_args_check(), current_level(), da_process_list(), dag_append_freia_call(), dag_computable_vertices(), dag_dot(), dag_dump(), dag_simplify(), dag_split_connected_components(), dag_terapix_measures(), dag_vertex_preds(), dagvtx_copy_list_dot(), dagvtx_spoc_priority(), dagvtx_terapix_priority(), debug_control(), debug_unstructured(), decorate_trail(), depth_of_parallel_perfect_loop_nest(), depth_of_perfect_loop_nest(), dereference_expression(), dfg_find_sccs(), discard_a_control_sequence_without_its_statements(), display_linked_control_nodes(), distribute(), dmas_invert_p(), do_brace_expression_to_updated_type(), do_check_isolate_statement_preconditions_on_call(), do_gpu_qualify_pointers(), do_linearize_type(), do_loop_nest_unswitching(), do_reduction_propagation(), do_simdizer_init(), do_split_structure_return_hook(), do_terapix_warmup(), DoInvariantsStatements(), DoRedundantsStatements(), drop_distributed_arguments(), DSC(), dump_functional(), dump_sef(), dup_list_of_ranges_list(), edge_weight(), effect_comparable_p(), effect_indices_first_pointer_dimension_rank(), effect_reference_dereferencing_p(), effect_type_depth(), effective_test_true(), end_omp_construct(), entity_flow_or_context_sentitive_heap_location(), entity_list_text_format(), equal_condition_to_points_to(), equal_must_vreference(), erode_alu_shared_p(), EvalConditionalOp(), expression_list_to_binary_operator_call(), expression_list_to_conjonction(), expression_to_points_to(), expression_to_polynome(), expression_verbose_reduction_p_and_return_increment(), expressions_to_vector(), extract_lattice(), extract_the_align(), extract_the_distribute(), fcs_call_flt(), fill_gRefToEncLoop_test(), filter_formal_context_according_to_actual_context(), filtered_declaration_list(), find_aipo_statement(), find_bd_reference(), find_exit_control_node(), find_new_variables(), find_or_create_exit_control_node(), find_target_position(), FindDistributionOfDim(), FindSccs(), fis_call_flt(), flatten_unstructured(), flint_cons_actual_argument(), float_call_expression_to_transformer(), freed_list_to_points_to(), freed_pointer_to_points_to(), freia_aipo_compile_calls(), freia_compile(), freia_convolution_width_height(), freia_dag_optimize(), freia_extract_kernel(), freia_extract_params(), freia_get_params(), freia_hack_fix_global_ins_outs(), freia_is_transpose_call(), freia_migrate_statements(), freia_mppa_compile_calls(), freia_opencl_compile_calls(), freia_shuffle_move_forward(), freia_spoc_pipeline(), freia_statement_aipo_call_p(), freia_statement_to_call(), freia_substitute_by_helper_call(), freia_terapix_call(), fsr_call_flt(), full_copy_p(), full_define_p(), full_spaghettify_statement(), fuse_2_control_nodes(), fuse_sequences_in_unstructured(), gen_may_constant_paths(), gen_may_set(), gen_must_constant_paths(), gen_must_set(), gen_omp_parallel(), gen_openmp(), gen_recv_communications(), gen_send_communications(), gen_sort_list(), gen_synchronization(), generate_a_statement_list_from_a_control_sequence(), generate_code_seq(), generate_copy_loop_nest(), generate_full_copy(), generate_io_wp65_code(), generate_message_from_3_lists(), generate_one_message(), generate_opcode(), generate_parallel_body(), generate_wiring(), generic_c_words_simplified_entity(), generic_effect_find_aliases_with_simple_pointer_values(), generic_eval_cell_with_points_to(), generic_field_list_equal_p(), generic_field_list_names_equal_p(), generic_functional_equal_p(), generic_minmax_to_transformer(), generic_points_to_cells_translation(), generic_reference_to_points_to_matching_list(), generic_substitute_formal_array_elements_in_transformer(), generic_transform_sink_cells_from_matching_list(), generic_type_depth(), generic_unary_operation_to_transformer(), generic_variable_equal_p(), get_a_smem_slot(), get_complement_expression(), get_final_offset(), get_rhs_of_instruction(), gfc2pips_array_ref2indices(), gfc2pips_code2instruction__TOP(), gfc2pips_computeAdressesOfArea(), gfc2pips_get_list_of_dimensions2(), gfc2pips_namespace(), gfc2pips_parameters(), glc_call(), global_source_to_sinks(), gpu_xml_dump(), gram_param(), group_expr_by_level(), handle_align_and_realign_directive(), handle_distribute_and_redistribute_directive(), handle_independent_directive(), handle_set_directive(), hcfg(), hierarchical_com(), hierarchical_schedule(), hierarchical_schedule_step(), host_section_p(), hpf_compile_parallel_body(), hpfc_call_with_distributed_args_p(), hpfc_order_variables(), hpfc_translate_call_with_distributed_args(), hwac_replace_statement(), identify_statements_to_distribute(), if_conv_init_statement(), impact_check(), implied_do_reference_number(), initial_code_abc_reference(), initialization(), initialize_array_variable(), initialized_by_equivalent_variable_p(), initiliaze_marked_list(), inline_expression_call(), insert_control_in_arc(), integer_call_expression_to_transformer(), internal_pointer_assignment_to_points_to(), interprocedural_mapping(), intersect_successors_with_partition_or_complement(), interval_graph(), intrinsic_call_to_points_to(), intrinsic_call_to_points_to_sinks(), intrinsic_call_to_type(), inv_call_flt(), io_efficient_compile(), is_not_trivial_p(), is_this_op(), is_uminus(), iteration_domain_from_statement(), k_limit_points_to(), kill_must_set(), kill_pointer_value(), lexpression_equal_p(), lhs_expression_to_transformer(), list_assignment_to_points_to(), list_commuted_p(), list_of_expressions_to_array(), list_of_same_or_equivalence_arguments(), list_own_allocated_memory(), live_out_summary_paths_engine(), logic_condition_filter(), logical_intrinsic_to_transformer(), loop_annotate(), loop_flt(), loop_private_variables(), lrange_larger_p(), make_address_of_expression(), make_bound_expression(), make_declarations_statement(), make_fsm_transitions_statement(), make_guard_expression(), make_list_of_flags(), make_loadsave_statement(), make_primal(), make_rectangular_area(), make_required(), make_sched_proto(), make_sequence_from_statement_list(), make_shift_subroutine(), make_shuffle_statement(), make_simd_statement(), make_statement_from_statement_list_or_empty_block(), make_transition_statement(), MakeAssignedOrComputedGotoInst(), MakeAtom(), MakeCommaExpression(), MakeForloopWithIndexDeclaration(), MakeFunctionExpression(), MakeNestOfStatementList(), mapping_on_broadcast(), mapping_to_domain_list(), mapping_to_value_number(), MCW(), memory_dereferencing_p(), merge_transformer_lists(), messages_generation(), messages_handling(), module_initial_parameter_pv(), move_declaration_control_node_declarations_to_statement(), move_task_to_cluster(), mpi_initialize(), mppa_dag_maybe_split_instrs_cmd(), mppa_dag_split(), mppa_helper_args_params(), multiple_pointer_assignment_to_post_pv(), negative_expression_p(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), new_filter_formal_context_according_to_actual_context(), new_recursive_filter_formal_context_according_to_actual_context_for_pointer_pair(), new_synonym(), non_equal_condition_to_points_to(), NormalizeIntrinsic(), null_equal_condition_to_points_to(), offset_cells(), omp_append_private_clause(), one_liner_p(), one_to_one_transformers_combine(), only_minor_statements_in_between(), opencl_compile_mergeable_dag(), opencl_generate_special_kernel_ops(), opencl_merge_and_compile(), order_condition_to_points_to(), ordinary_summary_precondition(), other_cool_enough_for_a_last_substitution(), outliner_file(), outliner_smart_references_computation(), output_the_attachments_in_a_sorted_order(), Overlap_Analysis(), parallel_tiling(), parser_macro_expansion(), partial_broadcast_coefficients(), partial_eval_binary_operator(), partial_eval_binary_operator_old(), partial_eval_call(), partial_eval_unary_operator(), partition_to_unstructured(), perfectly_nested_loop_to_body_at_depth(), phrase_check_reference(), plc_make_dim(), plc_make_distance(), plc_make_min_dim(), pointer_arithmetic_to_points_to(), pointer_call_expression_to_transformer(), pointer_reference_to_expression(), pointer_source_to_sinks(), pointer_type_array_p(), points_to_anywhere(), points_to_anywhere_typed(), points_to_array_reference_p(), points_to_binding_arguments(), points_to_cell_translation(), points_to_compare_cell(), points_to_compare_cells(), points_to_compare_location(), points_to_compare_ptr_cell(), points_to_nowhere(), points_to_reference_included_p(), points_to_reference_to_translation(), points_to_reference_to_type(), points_to_reference_to_typed_index(), points_to_reference_update_final_subscripts(), points_to_translation_of_formal_parameters(), points_to_unary_operation_to_transformer(), positive_expression_p(), ppt_assignement(), ppt_binary(), ppt_math(), ppt_unary(), ppt_unary_post(), pragma_parse_PRAGMA_DISTRIBUTED(), precondition_intra_to_inter(), prepare_reindexing(), prettyprint_dependence_graph(), prettyprint_dependence_graph_view(), print_align(), print_and_check_control_node(), print_control_node(), print_control_node_uns(), print_sesam_tasks_buffers_header(), print_step_blocks(), process_ref_list(), process_static_initialization(), propagate_constant_image(), put_variables_in_ordered_lists(), pv_cells_mergeable_p(), r_cell_reference_to_type(), re_do_it(), recover_structured_while(), recursive_filter_formal_context_according_to_actual_context(), recursive_store_independent_points_to_reference_p(), reduce_sequence(), reference_complete_with_zero_subscripts(), reference_dereferencing_to_points_to(), reference_must_points_to_null_p(), reference_to_complexity(), reference_to_points_to_sinks(), reference_to_points_to_translations(), references_aligned_p(), references_do_not_conflict_p(), references_must_conflict_p(), region_range_nul_p(), regions_to_loops(), register_scalar_communications(), remove_a_control_from_an_unstructured(), remove_useless_continue_or_empty_code_in_unstructured(), RemoveDummyArguments(), replace_control_with_unstructured(), replace_indices_region(), replace_indices_region_com(), replace_reductions_in_statement(), restructure_if_then_else(), reuse_pred_slot(), rewrite_modulo_expression(), rssp_ref(), rule_produced_consistent_p(), same_align_p(), same_dimension_p(), same_distribute_p(), same_lexpr_name_p(), same_va_arg_name_p(), sc_delimiter(), schedule_failsafe(), search_scc_bdt(), select_op_rwt(), sentence_data_statement(), seq_rwt(), sequence_rewrite(), sesamify(), sigmac_params_decl(), simd_trace_call(), simdizer_auto_tile(), similarity(), simple_cell_reference_preceding_p(), simple_pv_translate(), simple_pvs_syntactically_equal_p(), simplified_unstructured(), simplify_C_expression(), single_pointer_assignment_to_post_pv(), size_of_actual_array(), size_of_dummy_array(), SizeOfArray(), sort_dfg_node(), sort_eq_in_systems(), sort_list_of_strings(), sort_parameters(), spoc_measure_conf(), spoc_th_conf(), st_compute_current_computer(), st_compute_current_owners(), st_declaration_comment(), st_declaration_init(), st_dim_string(), st_generate_packing(), st_reference(), statement_imbrication_level(), statement_insertion_fix_access_in_callers(), statement_is_reduction(), statement_to_loop_statement_list(), statement_to_transformer_list(), static_controlize_statement(), static_controlize_unstructured(), stats_has_rw_conf_p(), stco_common_loops_of_statements(), step_directive_basic_workchunk(), step_directive_basic_workchunk_index(), step_directive_print(), step_translate_and_map(), string_expression_to_transformer(), struct_initialization_to_points_to(), struct_reference_assignment_or_equality_to_transformer(), stub_head(), subarray_shift_assignment_p(), subscript_value(), subscript_value_stride(), substitute_image_in_statement(), substitute_loop_indices(), substitution_candidate(), substring_type(), summary_total_postcondition(), swap_syntax_in_expression(), swis_call_flt(), symbolic_tiling(), system_inversion_restrict(), tail_call_path_p(), take_out_the_entry_node_of_the_unstructured(), take_out_the_exit_node_if_not_a_continue(), terapix_macro_code(), test_dependence_using_regions(), TestCoupleOfReferences(), text_equivalence_class(), text_loop(), text_loop_craft(), text_trail(), text_unstructured(), tiling_transformation(), topological_sort(), transformer_list_closure_to_precondition_depth_two(), transformer_list_closure_to_precondition_max_depth(), transformer_list_multiple_closure_to_precondition(), translate_arguments(), translate_reduction(), translate_to_module_frame(), type_dereferencement_depth(), typing_arguments_of_user_function(), unary_into_binary_ref(), unary_intrinsic_call_to_points_to_sinks(), undefined_statement_list_p(), unstructured_consistency_p(), unstructured_to_flow_sensitive_postconditions(), unstructured_to_postconditions(), unstructured_to_transformer(), unstructured_while_p(), update_common_references_in_regions(), update_functional_type_with_actual_arguments(), update_operator_to_post_pv(), update_overlaps_in_caller(), update_partition(), update_successors_of_predecessor(), upgrade_approximations_in_points_to_set(), UseFormalArguments(), variable_initial_expression(), variable_references_may_conflict_p(), verify_array_variable(), vertex_mergeable_p(), where_to_perform_operation(), whileloop_to_postcondition(), words_assign_substring_op(), words_nullary_op_c(), words_nullary_op_fortran(), words_parameters(), words_points_to_reference(), words_regular_call(), words_substring_op(), xml_Arguments(), xml_Array(), xml_array_in_task(), xml_Call(), xml_call_from_indice(), xml_Chain_Graph(), xml_FormalVariables(), xml_Full_Type(), xml_GlobalVariables(), xml_LocalVariables(), xml_ParameterUseToArrayBound(), xml_Pattern_Paving(), xml_Region_Range(), xml_TaskParameter(), xml_TaskParameters(), xml_tiling(), xml_Transposition(), and zeroing_multiple_edges().

◆ gen_list_and()

void gen_list_and ( list a,
const list  b 
)

Compute A = A inter B: complexity in O(n2)

This element of a is not in list b: delete it:

Definition at line 941 of file list.c.

942 {
943  if (ENDP(*a))
944  return ;
945 
946  if (!gen_in_list_p(CHUNK(CAR(*a)), b)) {
947  /* This element of a is not in list b: delete it: */
948  cons *aux = *a;
949 
950  *a = CDR(*a);
951  CAR(aux).p = NEWGEN_FREED;
952  CDR(aux) = NEWGEN_FREED;
953  free(aux);
954  gen_list_and(a, b);
955  }
956  else
957  gen_list_and(&CDR(*a), b);
958 }
void gen_list_and(list *a, const list b)
Compute A = A inter B: complexity in O(n2)
Definition: list.c:941
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
Definition: list.c:734
return(s1)
int aux
Definition: solpip.c:104

References aux, CAR, CDR, CHUNK, ENDP, free(), gen_in_list_p(), NEWGEN_FREED, and return().

Referenced by ancestor_map_consistent_p(), hierarchize_control_list(), intersect_successors_with_partition_or_complement(), recompute_loop_transformer(), and scc_to_dag().

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

◆ gen_list_and_not()

void gen_list_and_not ( list a,
const list  b 
)

Compute A = A inter non B:

This element of a is in list b: delete it:

Definition at line 963 of file list.c.

964 {
965  if (ENDP(*a))
966  return ;
967 
968  if (gen_in_list_p(CHUNK(CAR(*a)), b)) {
969  /* This element of a is in list b: delete it: */
970  cons *aux = *a;
971 
972  *a = CDR(*a);
973  CAR(aux).p = NEWGEN_FREED;
974  CDR(aux) = NEWGEN_FREED;
975  free(aux);
976  gen_list_and_not(a, b);
977  }
978  else
979  gen_list_and_not(&CDR(*a), b);
980 }
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
Definition: list.c:963

References aux, CAR, CDR, CHUNK, ENDP, free(), gen_in_list_p(), NEWGEN_FREED, and return().

Referenced by add_node_to_interval(), array_type_projection(), build_omp_pragma_list(), clean_up_points_to_stubs(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), fix_block_statement_declarations(), freeable_points_to_cells(), hierarchize_control_list(), inner_rewrite(), intersect_successors_with_partition_or_complement(), list_assignment_to_points_to(), loop_private_variables_as_entites(), outliner_scan(), partition_to_unstructured(), recompute_loop_transformer(), reduce_cell_to_pointer_type(), remove_impossible_arcs_to_null(), scc_to_dag(), and update_partition().

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

◆ gen_list_cons()

list gen_list_cons ( const list  i,
const list  l 
)

Definition at line 924 of file list.c.

925 {
926  return gen_cons((const void *) i, l);
927 }

References gen_cons().

+ Here is the call graph for this function:

◆ gen_list_cyclic_p()

bool gen_list_cyclic_p ( const list  ml)
Returns
true if the list is cyclic. A list is considered cyclic if at least one element points to a previously visited element.
Parameters
list,thelist to check

a list with 0 or 1 element is not cyclic

it may be cyclic

To ease debugging

Definition at line 120 of file list.c.

121 {
122  /* a list with 0 or 1 element is not cyclic */
123  bool cyclic_p = ! (ENDP(ml) || ENDP(CDR(ml)));
124 
125  if(cyclic_p) { /* it may be cyclic */
126  list cl; /* To ease debugging */
127  int i = 1;
128  set adresses = set_make (set_pointer);
129 
130  for (cl = ml; !ENDP(cl); POP(cl), i++) {
131  if (set_belong_p ( adresses, cl)) {
132  fprintf(stderr, "warning: cycle found");
133  fprintf(stderr, "next elem %d:'%p' already in list\n", i, cl);
134  cyclic_p = true;
135  break;
136  }
137  set_add_element (adresses, adresses, cl);
138  cyclic_p = false;
139  }
140 
141  set_free (adresses);
142  }
143 
144  return cyclic_p;
145 }
void set_free(set)
Definition: set.c:332
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_pointer
Definition: newgen_set.h:44
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59

References CDR, ENDP, fprintf(), POP, set_add_element(), set_belong_p(), set_free(), set_make(), and set_pointer.

Referenced by TakeDerivedEntities().

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

◆ gen_list_head()

list gen_list_head ( list lp,
int  n 
)
Returns
exactly the first n elements from *lp as a list; *lp points to the remaining list, as a side effect. if gen_length(*lp) is less than n, the function aborts.
Parameters
lppointeur to the list.1
nnumber of items to extract.

Definition at line 1015 of file list.c.

1016 {
1017  if (n<=0) return NIL;
1018  // else n>0, something to skip
1019  list head = *lp, last = *lp;
1020  n--;
1021  while (n--) {
1022  message_assert("still some items", last);
1023  last = CDR(last);
1024  }
1025  *lp = CDR(last);
1026  CDR(last) = NIL;
1027  return head;
1028 }

References CDR, message_assert, and NIL.

Referenced by dag_append_freia_call(), and extract_fist_item().

+ Here is the caller graph for this function:

◆ gen_list_patch()

void gen_list_patch ( list  l,
const void *  x,
const void *  y 
)

Replace all the reference to x in list l by a reference to y:

Definition at line 985 of file list.c.

986 {
987  MAPL(pc, {
988  if (CAR(pc).p == (gen_chunk *) x)
989  CAR(pc).p = (gen_chunk *) y;
990  }, l);
991 }
static char * x
Definition: split_file.c:159

References CAR, MAPL, and x.

Referenced by __attribute__(), clean_up_embedding_graph(), control_list_patch(), fsmize_statement(), make_start_ru_module(), scc_to_dag(), spaghettify_statement(), switch_vertex_to_a_copy(), unlink_copy_vertex(), and update_successor_in_copy().

+ Here is the caller graph for this function:

◆ gen_make_list()

list gen_make_list ( int  domain,
  ... 
)

Definition at line 851 of file list.c.

852 {
853  list l, current;
854  gen_chunk *item = NULL;
855  va_list args;
856  va_start(args, domain);
857  item = va_arg(args, gen_chunk*);
858  if( !item ) {
859  va_end(args);
860  return NIL;
861  }
862 
863  NEWGEN_CHECK_TYPE(domain, item);
864  l = CONS(CHUNK, item, NIL), current = l;
865  for(item = va_arg(args, gen_chunk*);item;item = va_arg(args, gen_chunk*)) {
866  NEWGEN_CHECK_TYPE(domain, item);
867  CDR(current) = CONS(CHUNK, item, NIL), POP(current);
868  }
869  va_end(args);
870  return l;
871 }
#define NEWGEN_CHECK_TYPE(dom, item)
this macro does about the same as gen_check, but inlined and safer.
Definition: genC.h:313
static size_t current
Definition: string.c:115
A DOMAIN union describes the structure of a user type.

References CDR, CHUNK, CONS, current, NEWGEN_CHECK_TYPE, NIL, and POP.

Referenced by add_exec_mmcd(), comEngine_generate_procCode(), do_point_to(), generate_fifo_stat(), generate_mmcd_stat_from_ref(), get_fifoExp_from_ref(), make_exec_mmcd(), make_lInitStats(), make_loop_step_stat(), make_lSwitchStats(), make_mmcd_load_store_stat(), make_read_write_fifo_stat(), make_send_receive_conversion(), make_step_inc_statement(), make_toggle_inc_statement(), make_transStat(), new_local_image_variable(), process_innerStat1_proc(), sc_delimiter(), stub_var_decl(), switch_vertex_to_assign(), and update_call().

+ Here is the caller graph for this function:

◆ gen_map()

◆ gen_mapl()

void gen_mapl ( gen_iter_func_t  fp,
const list  l 
)

MAP.

Definition at line 165 of file list.c.

166 {
167  list cp = (list) l;
168  for (; cp != NIL ; cp = cp->cdr)
169  (*fp)(cp);
170 }

References cp, and NIL.

Referenced by flint_call(), flint_instruction(), and flint_reference().

+ Here is the caller graph for this function:

◆ gen_nconc()

list gen_nconc ( list  cp1,
list  cp2 
)

physically concatenates CP1 and CP2 but do not duplicates the elements

Returns
the concatenated list
Parameters
cp1,thefirst list to concatenate
cp2,thesecond list to concatenate

Definition at line 344 of file list.c.

345 {
346  cons *head = cp1 ;
347 
348  if( cp1 == NIL )
349  return( cp2 ) ;
350 
351  //message_assert ("cannot concatenate a cyclic list", gen_list_cyclic_p (cp1) == false);
352 
353  for( ; !ENDP( CDR( cp1 )) ; cp1 = CDR( cp1 ));
354 
355  CDR( cp1 ) = cp2 ;
356  return( head ) ;
357 }

References CDR, ENDP, and NIL.

Referenced by __attribute__(), add_abstract_state_variable(), add_actual_return_code(), add_any_variable_to_area(), add_array_dimension_bound_test(), add_array_test(), add_bound_arguments(), add_conflicts(), add_cycle_dependency(), add_declaration_statement_here(), add_elem_to_list_of_Pvecteur(), add_exec_mmcd(), add_formal_return_code(), add_index_out_effect_proc(), add_index_statements(), add_live_loop_index(), add_node_to_interval(), add_non_declared_reference_to_declaration(), add_proper_successor_to_predecessor(), add_range_in_list(), add_rule(), add_subscript_to_reference(), add_symbolic_constant_to_declaration(), add_test_successor(), add_thread_safe_variable(), add_to_list_of_ranges_list(), add_toggle_inc_statements(), add_words_to_text(), AddCommonToModule(), AddEntryTarget(), AddToDeclarations(), AddToExterns(), AddVariableToCommon(), adg_get_conjonctions(), adg_update_dfg(), alias_classes(), alias_lists(), alias_propagation(), align_check(), AllocateDadStruct(), analyze_quast(), append_reg_if_not_present(), append_statement_to_block_statement(), arguments_add_entity(), array_access_to_array_ranges(), array_bound_check_instrumentation(), array_indices_communication(), array_ranges_to_template_ranges(), array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), atom_cse_expression(), atomize_one_message(), atomizer_of_block(), atomizer_of_expressions(), atomizer_of_external(), attach_ref_to_stat(), base_to_list(), basic_supporting_entities(), bdt_save_exp(), bdt_save_id(), bdt_save_int(), binary_intrinsic_call_to_points_to_sinks(), block_to_transformer_list(), bottom_up_abc_expression_implied_do(), bound_generation(), bourdoncle_visit(), broadcast_conditions(), build_associate_temp(), build_call_STEP_WaitAll(), build_first_comb(), build_options_menu_and_panel(), build_successors_with_rhs(), build_third_comb(), c_convex_effects_on_actual_parameter_forward_translation(), c_convex_effects_on_formal_parameter_backward_translation(), C_loop_range(), c_text_related_entities(), c_user_call_to_transformer(), call_STEP_subroutine(), call_to_wp65_code(), callgraph(), callnodeclfilter(), cell_relations_generic_binary_op(), cells_to_read_or_write_effects(), check_C_function_type(), clean_up_control_test(), clean_up_sequences_rewrite(), cleanup_subscript(), cmf_layout_align(), com_call(), comEngine_generate_code(), comEngine_opt_loop_interchange(), comp_region_add_to_regions(), compact_list(), compare_matched_alias_pairs(), compare_other_list(), compare_unmatched_alias_pairs(), compilation_unit_text(), compile_module(), compile_reduction(), complete_points_to_reference_with_fixed_subscripts(), compose_vvs(), CompRegionsExactUnion(), CompRegionsMayUnion(), compute_basic_concrete_type(), compute_points_to_kill_set(), compute_private_entity_list(), compute_receive_content(), compute_receive_domain(), compute_region(), ComputeAddresses(), ComputeAreaOffset(), concat_drt_clauses(), concat_new_entities(), conditional_operator_to_post_pv(), constant_expression_supporting_references(), constant_symbolic_communication(), contraintes_to_list(), controlize_forloop(), controlize_loop(), convex_effect_to_constant_path_effects_with_points_to(), craft_layout_align(), create_externalized_function_common(), create_new_common_variable(), create_new_ent_list(), create_new_entity(), create_or_get_an_interval_node(), create_pointer_to_array_stub_points_to(), create_scalar_stub_sink_cell(), create_stub_points_to(), current_offset_of_area(), CurrentOffsetOfArea(), dag_split_on_scalars(), dag_vertex_pred_imagelets(), dataflows_on_ref(), declarations_to_post_pv(), declare_common_variables_in_module(), defs_elim_of_statement(), dereferencing_subscript_to_points_to(), dereferencing_to_sinks(), dfg_low_link_compute(), diff_lists(), dims_of_nest(), do_brace_expression_to_statements(), do_clone_statement(), do_gather_all_expressions(), do_gather_all_expressions_perms(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_split_structures(), dup_list_of_Pvecteur(), dup_list_of_ranges_list(), dup_vvs(), ecrit_liste_vecteur(), effect_to_constant_path_effects_with_points_to(), effect_words_reference(), ensure_comment_consistency(), entities_to_expressions2(), entity_generate_missing_declarations(), eole_fmx_specific_op(), eval_var(), expression_to_operand_list(), extended_source_to_sinks(), extended_sources_to_sinks(), external_call_to_post_pv(), fill_gRefToEncLoop_loop(), filter_formal_context_according_to_actual_context(), find_common_loop(), find_enum_of_member(), find_or_create_exit_control_node(), find_points_to_subscript_for_type(), FindRefToDistArrayFromList(), FindRefToDistArrayInStatement_call_filter(), FindRefToDistArrayInStatement_expression_filter(), finish_new_df_source(), finish_new_gd_ins(), flatten_block_if_necessary(), formal_regions_backward_translation(), formal_source_to_sinks(), formal_variable_add_aliases(), freia_add_image_arguments(), freia_dag_optimize(), freia_insert_added_stats(), freia_migrate_statements(), freia_spoc_pipeline(), freia_terapix_call(), fsi_seq_flt(), full_loop_unroll(), fusion_buffer(), generate_alternate_return_targets(), generate_c1_alpha(), generate_c1_beta(), generate_code_call(), generate_code_seq(), generate_code_test_proc(), generate_compute_local_indices(), generate_fifo_stats(), generate_fifo_stats2(), generate_get_value_locally(), generate_mmcd_stats_from_ref(), generate_one_message(), generate_optimized_code_for_loop_nest(), generate_parallel_body(), generate_receive_from_computer(), generate_remapping_code(), generate_send_to_computer(), generate_stat_from_ref_list_HRE(), generate_stat_from_ref_list_HRE_list(), generate_stat_from_ref_list_proc(), generate_stat_from_ref_list_proc_list(), generate_subarray_shift(), generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), generic_add_declaration_statement(), generic_c_words_simplified_entity(), generic_constant_expression_supporting_entities(), generic_effect_find_aliases_with_simple_pointer_values(), generic_effects_entities_which_may_conflict_with_scalar_entity(), generic_eval_cell_with_points_to(), generic_insert_statement(), generic_points_to_cell_to_useful_pointer_cells(), generic_points_to_cells_translation(), generic_points_to_sources_to_sinks(), generic_program_pointer_values(), generic_reference_add_fixed_subscripts(), generic_stub_source_to_sinks(), generic_words_qualifiers(), generic_written_pointers_set(), GenericAddLocalEntityToDeclarations(), genref_loop(), get_graph_dataflows(), get_rhs_of_instruction(), get_supportedRef_proc(), getSymbolBy(), gfc2pips_code2instruction(), gfc2pips_code2instruction_(), gfc2pips_code2instruction__TOP(), gfc2pips_computeAdressesOfArea(), gfc2pips_dumpSELECT(), gfc2pips_expr2expression(), gfc2pips_namespace(), gfc2pips_symbol2data_instruction(), global_source_to_sinks(), group_expr_by_level(), handle_reduction_directive(), hpf_compile_call(), hpf_compile_parallel_body(), hpf_compiler(), hpf_remapping(), hpfc_compute_lid(), hpfc_hmessage(), hpfc_order_variables(), hpfc_translate_call_with_distributed_args(), HRE_distribute_call(), HRE_distribute_seq(), HRE_distribute_stat(), HRE_distribute_test(), include_constant_symbolic_communication(), include_results_in_bdt(), init_dynamic_check_list(), init_statement_equivalence_table(), initialize_and_verify_common_variable(), initialize_dynamic_check_list(), initialize_mu_list(), initiliaze_marked_list(), insert_array_scalar_access_movement(), insert_control_in_arc(), insert_run_time_communications(), insert_sort(), io_comp_regions(), io_efficient_compile(), local_syntax_to_reference_list(), loop_initialization_to_transformer(), loop_nest_to_wp65_code(), loop_private_variables(), loop_push(), loop_replace_variable(), loop_variant_list(), LowlinkCompute(), make_all_movement_blocks(), make_array_communication_statement(), make_array_test(), make_class_from_list(), make_classes_from_lists(), make_compute_block(), make_lInitStats(), make_list_of_flags(), make_loop_lStats_HRE(), make_loop_nest_for_overlap(), make_lStats(), make_lSwitchStats(), make_mmcd_stats_from_ref(), make_new_local_variables(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_seqStat(), make_simple_Fortran_io_instruction(), make_statement_from_statement_varargs_list(), make_vvs_from_sc(), MakeArrayExpression(), MakeCaseStatement(), MakeDataStatement(), MakeDefaultStatement(), MakeIoInstA(), MakeIoList(), MakeParameterList(), MakeStorageRam(), MakeSwitchStatement(), mapping_on_broadcast(), maybe_unroll_while_rwt(), meld(), merge_points_to_cell_lists(), merge_transformer_lists(), messages_atomization(), messages_handling(), module_entities(), module_initial_parameter_pv(), module_list_sort(), module_to_all_declarations(), module_to_wp65_modules(), move_ahead(), move_declaration_control_node_declarations_to_statement(), move_declarations(), move_statements_stat(), mppa_helper_args_params(), my_build_new_ref(), nary_call_rwt(), new_add_any_variable_to_area(), new_array_element_backward_substitution_in_transformer(), new_df_ref_ind(), new_df_sink_ins(), new_df_trans_exp(), new_eng_loop(), new_points_to_unstructured(), NewDeclarationOfDistributedArray(), normalize_subscript_expression(), opencl_compile_mergeable_dag(), opencl_merge_and_compile(), opt_loop_interchange_fill_lists(), opt_loop_interchange_fill_lists_stat(), order_isomorphic_statements_list(), outliner_file(), outliner_scan(), Overlap_Analysis(), partition_unknowns(), perform_array_element_substitutions_in_transformer(), phrase_check_reference(), phrase_remove_dependences_rwt(), pips_parse_arguments(), plc_make_proto(), pointer_source_to_sinks(), points_to_cell_translation(), points_to_cells_parameters(), points_to_cells_pointer_arguments(), points_to_cells_to_pointer_cells(), points_to_cells_to_upper_bound_points_to_cells(), points_to_reference_to_translation(), points_to_reference_to_typed_index(), points_to_reference_update_final_subscripts(), pr_call_flt(), pragma_omp_merge_expr(), prepare_array_bounds(), prettyprint_dependence_graph_view(), prgm_mapping(), private_ultimate_type(), process_gLoopToSync_HRE(), process_gLoopToSync_proc(), process_replacement_HRE_OutRef(), process_static_initialization(), ProcessEntry(), program_points_to(), Psysteme_to_expression(), put_source_ind(), put_stmt_in_Block(), ram_variable_add_aliases(), receive_messages_generation(), recompute_loop_transformer(), RecordDerivedEntityDeclaration(), recursive_filter_formal_context_according_to_actual_context(), reductions_get_omp_pragma_expr(), reference_add_field_dimension(), reference_add_zero_subscript(), reference_complete_with_zero_subscripts(), reference_conflicting_test_and_update(), reference_conversion_computation(), reference_list_update(), reference_to_points_to_sinks(), references_of_expression(), ReferenceTestUnion(), ReferenceUnion(), refine_points_to_cell_subscripts(), regenerate_toggles(), region_to_address(), regions_backward_translation(), regions_to_loops(), remove_dependance_from_levels(), remove_write_ref(), RemoveDummyArguments(), rename_statement_declarations(), reorganize_bdt(), replace_array_ref_with_fifos(), replace_array_ref_with_fifos2(), replace_control_related_to_a_list(), replace_entity_by_expression_expression_walker(), replicate_cycles(), rice_update_dependence_graph(), rloops_mapping_of_statement(), rm_db_block(), safe_intrinsic_to_post_pv(), same_or_equivalence_argument_add_aliases(), save_callee_class(), save_exp(), save_id(), save_int(), sc_delimiter(), search_graph_bdt(), search_parallel_loops(), sentence_area(), sentence_data_statement(), sentence_head(), sentence_symbolic(), sentence_variable(), set_array_declaration(), set_dimensions_of_local_variable_family(), set_register_qualifier(), shape_one_message(), simple_reference_add_field_dimension(), simplified_reference(), single_pointer_assignment_to_post_pv(), sort_entities_with_dep(), sort_subsequence(), sort_unknowns(), source_to_sinks(), sources_to_sinks(), split_initializations_in_statement(), st_compute_current_computer(), st_compute_current_owners(), st_generate_packing(), st_get_value_locally_and_send(), st_send_to_computer_if_necessary(), statement_arrows(), statement_clean_declarations_helper(), statement_to_loop_statement_list(), statements_to_direct_declarations(), static_control_to_indices(), step_local_RT_Integer(), step_recv_regions_list_add(), step_send_regions_list_add(), step_translate_and_map(), stmt_bdt_directions(), struct_assignment_to_points_to(), struct_variable_to_pointer_locations(), struct_variable_to_pointer_subscripts(), stub_text(), subscript_to_points_to_sinks(), switch_vertex_to_a_copy(), syntax_to_reference_list(), TakeDerivedEntities(), template_ranges_to_processors_ranges(), ternary_intrinsic_call_to_points_to_sinks(), test_dependence_using_regions(), TestCoupleOfReferences(), TestDiVariables(), text_block(), text_block_elseif(), text_block_ifthen(), text_entity_declaration(), text_logical_if(), text_loop_cmf(), text_loop_craft(), text_loop_default(), text_trail(), text_whileloop(), top_down_abc_array(), top_down_abc_call(), transfer_control_predecessor(), transfer_control_successor(), transformer_combine(), transformer_list_add_combination(), transformers_combine(), translate_reductions(), TranslateEntryFormals(), translation_transitive_closure(), TransRefTemp(), unify_lists(), union_list(), unstructured_to_direct_declarations(), update_functional_type_with_actual_arguments(), update_indices_for_local_computation(), update_map(), update_partition(), update_referenced_entities(), update_successor_in_copy(), update_successors_of_predecessor(), update_toggle_init_stats_list(), update_unstructured_declarations(), UpdateArrayEntity(), UpdateFunctionalType(), UpdateParenEntity(), UpdatePointerEntity(), UpdateType(), UseDummyArguments(), UseFormalArguments(), user_call_to_points_to_sinks(), valuer(), variable_list_update(), vecteur_to_list(), verify_used_before_set_call(), word_points_to(), words_any_reference(), words_assign_op(), words_assign_substring_op(), words_basic(), words_brace_expression(), words_cmf_loop_range(), words_comma_op(), words_common_variable(), words_conditional_op(), words_declaration(), words_dimension(), words_dimensions(), words_enum(), words_implied_do(), words_infix_binary_op(), words_infix_nary_op(), words_inverse_op(), words_io_control(), words_io_inst(), words_loop_list(), words_loop_range(), words_nullary_op_c(), words_nullary_op_fortran(), words_numerical_dimension(), words_omp_red(), words_parameters(), words_pointer_value(), words_points_to(), words_points_to_list(), words_points_to_reference(), words_postfix_unary_op(), words_prefix_unary_op(), words_range(), words_reduction(), words_reductions(), words_regular_call(), words_stat_io_inst(), words_subscript_range(), words_substring_op(), words_test_list(), words_type(), words_unary_minus(), words_va_arg(), words_variable_or_function(), write_resulting_bdt(), and xml_Region_Parameter().

◆ gen_nreverse()

list gen_nreverse ( list  cp)

reverse a list in place

Parameters
cp,thelist to be reversed
Returns
the list reversed

Definition at line 304 of file list.c.

305 {
306  cons *next, *next_next ;
307 
308  if( cp == NIL || cp->cdr == NIL ) return( cp ) ;
309 
310  next = cp->cdr ;
311  cp->cdr = NIL;
312  next_next = NEXT( next );
313 
314  for( ; next != NIL ; )
315  {
316  next->cdr = cp ;
317  cp = next ;
318  next = next_next ;
319  next_next = NEXT( next_next ) ;
320  }
321  return cp;
322 }
#define NEXT(cp)
Definition: list.c:298

References cons::cdr, cp, NEXT, and NIL.

Referenced by add_constraint_on_x(), add_one_more_expression(), add_prettyprint_control_list_to_declaration_statement(), AddCommonToModule(), adg_increasing_stat_order_sort(), all_previous_stats_with_deps_are_computed(), apply_transformer_lists_generic(), atomize_statement(), atomizer_of_unstructured(), base_to_entities(), binary_arithmetic_operator_to_post_pv(), block_to_total_precondition(), build_call_STEP_init_regionArray(), build_esv_list(), build_first_comb(), build_real_resources(), build_third_comb(), c_unstructured(), call_STEP_subroutine2(), call_STEP_subroutine3(), callers_to_statements(), clean_statement_list_for_aipo(), clean_up_transformer_list(), cluster_stage_spire(), cluster_stage_spire_generation(), combine_transformer_lists(), common_members_of_module(), complete_points_to_reference_with_fixed_subscripts(), concat_new_entities(), constant_reference_to_normalized_constant_reference(), controlize_distribution(), controlize_list_1(), copy_to_block(), copy_vertices(), cstrsplit(), dag_computable_vertices(), dag_connected_component(), dag_remove_unused_inputs(), dag_split_connected_components(), dag_split_on_scalars(), declare_common_variables_in_module(), delay_communications_sequence(), dimensions_to_dma(), dimensions_to_normalized_dimensions(), do_array_expansion(), do_array_to_pointer_walk_expression(), do_clone_application(), do_clone_call(), do_clone_reference(), do_clone_sequence(), do_clone_statement(), do_clone_subscript(), do_clone_syntax(), do_group_constants_terapix(), do_linearize_array_init(), do_linearize_array_reference(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_recompile_module(), do_remove_redundant_communications_in_anyloop(), do_split_block_statements(), do_split_structure(), do_symbolic_tiling(), do_transform_if_statements(), drop_distributed_arguments(), duplicate_regions_referenced_entity(), effects_to_dma(), effects_to_entity_list(), end_omp_construct(), EndOfProcedure(), entities_to_expressions(), entity_list_to_base(), expand_expression(), expand_reference(), expressions_to_entities(), extended_regions_must_convex_hull(), extract_the_distribute(), find_points_to_subscript_for_type(), find_receiver_cluster(), find_statements_interactively(), find_statements_with_pragma(), flush_statement_comment(), free_guards(), freia_add_image_arguments(), freia_cleanup_sequence_rec(), freia_compile(), freia_create_helper_function(), freia_dag_optimize(), freia_extract_params(), freia_migrate_statements(), freia_spoc_pipeline(), freia_terapix_call(), freia_transpose_kernel(), fs_expression_list_to_entity_list(), full_loop_unroll(), fuse_sequences_in_unstructured(), gather_and_remove_all_format_statements(), gen_common_prefix(), gen_copy_string_list(), gen_mpi_send_recv(), gen_omp_parallel(), gen_omp_taskwait(), gen_send_communications(), generate_call_init_regionArray(), generate_deducables(), generate_io_wp65_code(), generic_eval_cell_with_points_to(), get_common_members(), get_list_of_rhs(), get_log_buffer(), get_sizeofexpression_for_region(), gfc2pips_array_ref2indices(), gfc2pips_computeAdressesOfArea(), gfc2pips_getTypesDeclared(), gfc2pips_shift_comments(), gfc2pips_shiftAdressesOfArea(), gfc2pips_symbol2data_instruction(), gfc2pips_vars(), gpu_ify(), gpu_promote_sequential_on_sequence(), hierarchical_com(), hpf_compile_block(), initialization_list_to_statements(), insert_new_declarations(), insert_rwt(), isolate_code_portion(), keep_recv_or_send_referenced_entity(), ldimensions_dup(), level_of(), listexpres_to_listexpres_newbase(), loop_normalize_of_unstructured(), loop_to_implieddo(), lUpdateExpr_but_distributed(), make_bound_expression(), make_causal_external(), make_causal_internal(), make_com_loopbody(), make_declarations_statement(), make_fields_assignment_instruction(), make_loadsave_statement(), make_loop_nest_for_overlap(), make_scalar_communication_module(), make_send_receive_conversion(), make_shuffle_statement(), make_start_ru_module(), merge_points_to_cell_lists(), module_formal_parameters(), module_loops(), move_ahead(), move_declaration_control_node_declarations_to_statement(), mpi_finalize(), mpi_initialize(), mpic_make_args_mpi_send_or_receiv(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), mpic_make_mpi_finalize(), mpic_make_mpi_init(), mppa_compile_dag(), mppa_dag_split(), mppa_helper_args_params(), my_matrices_to_constraints_with_sym_cst(), new_block_to_complexity(), old__gpu_ify(), opencl_compile_mergeable_dag(), opencl_merge_and_compile(), outline_stmts_between_pragmas_in_sequence(), outliner_parameters(), outliner_smart_references_computation(), pointer_reference_to_expression(), points_to_array_reference_p(), points_to_array_reference_to_type(), points_to_cell_to_upper_bound_points_to_cells(), points_to_indices_to_subscript_indices(), points_to_reference_to_final_dimension(), points_to_reference_update_final_subscripts(), points_to_with_stripped_sink(), postcondition_filter(), pragma_to_string(), promote_statement(), propagate_constant_image_to_succs(), put_formats_at_module_beginning(), put_variables_in_ordered_lists(), rebuild_topological_sort(), recursive_functional_type_supporting_entities(), reference_to_points_to_translations(), region_to_minimal_dimensions(), regions_to_loops(), remove_old_pragma(), remove_STEP_pragma(), replace_expression_similar_to_pattern(), replace_in_sequence_statement_with(), replace_indices_region(), replace_indices_region_com(), replace_statement_walker(), sc_delimiter(), scalopragma(), separate_variables(), separate_variables_2(), sequence_rewrite(), sesamify(), simdize_simple_statements(), simdize_simple_statements_pass2(), sort_parameters(), sort_subsequence(), sreference_offset(), statement_insertion_fix_access(), statement_mark(), statement_pragmas(), statement_to_called_user_entities(), statement_to_labels(), statement_to_referenced_entities(), statements_to_direct_declarations(), static_controlize_unstructured(), stco_renumber_code(), step_directive_basic_workchunk_index(), step_statement_path_build(), string_to_entities(), string_to_expressions(), strsplit(), stub_head(), stub_text(), subarray_shift_assignment_p(), subscript_expressions_to_constant_subscript_expressions(), SupressDependances(), systeme_to_loop_nest(), terapix_loop_optimizer(), text_entity_declaration(), text_unstructured(), Tiling_buffer_allocation(), transformer_apply_generic(), transformer_filter_subsumed_variables(), transformer_list_preserved_variables(), transformer_list_safe_variables_projection(), transformer_list_to_active_transformer_list(), transformer_list_to_argument(), transformer_list_with_effect(), transformers_derivative_fix_point(), transformers_safe_apply(), transformers_safe_normalize(), type_to_named_type(), updated_control_list(), value_passing_summary_transformer(), and variable_to_dimensions().

◆ gen_nth()

gen_chunk gen_nth ( int  n,
const list  l 
)

to be used as ENTITY(gen_nth(3, l))...

Definition at line 710 of file list.c.

711 {
712  list r = gen_nthcdr(n, l);
713  message_assert("not NIL", r);
714  return CAR(r);
715 }
list gen_nthcdr(int n, const list lx)
caution: the first item is 0! was: return( (n<=0) ? l : gen_nthcdr( n-1, CDR( l ))) ; if n>gen_length...
Definition: list.c:700

References CAR, gen_nthcdr(), and message_assert.

Referenced by adg_dataflowgraph(), adg_max_of_leaves(), align_check(), array_ranges_to_template_ranges(), c_convex_effects_on_actual_parameter_forward_translation(), caller_list_of_bounds(), compute_region(), compute_regions_union(), connect_unstructured(), debug_unstructured(), do_brace_expression_to_statements(), do_gpu_qualify_pointers(), effect_field_dimension_entity(), full_spaghettify_statement(), get_externalized_and_analyzed_function_name(), get_final_offset(), get_function_name_by_searching_tag(), get_overlap(), get_subwordSize_from_opcode(), identify_statements_to_distribute(), ith_index_of_ref(), make_lSwitchStats(), make_transition_statement(), MakeEnumeratorInitialValue(), MakeForloopWithIndexDeclaration(), mppa_compile_dag(), mppa_helper_args_params(), new_declaration_tag(), points_to_reference_to_typed_index(), points_to_translation_of_formal_parameters(), ppt_assignement(), pragma_parse_PRAGMA_DISTRIBUTED(), reduce_sequence(), reference_to_type(), replace_control_with_unstructured(), sc_delimiter(), sc_kernel_specific_agent(), select_op_rwt(), set_overlap(), sigmac_params_decl(), sort_parameters(), st_dim_string(), st_reference(), statement_insertion_fix_access_in_callers(), statement_of_level(), store_a_new_declaration(), template_ranges_to_processors_ranges(), update_call(), and words_parameters().

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

◆ gen_nthcdr()

list gen_nthcdr ( int  n,
const list  lx 
)

caution: the first item is 0! was: return( (n<=0) ? l : gen_nthcdr( n-1, CDR( l ))) ; if n>gen_length(l), NIL is returned.

Definition at line 700 of file list.c.

701 {
702  list l = (list) lx;
703  message_assert("valid n", n>=0);
704  for (; !ENDP(l) && n>0; l=CDR(l), n--);
705  return(l);
706 }

References CDR, ENDP, and message_assert.

Referenced by block_to_complexity(), freia_get_nth_scalar_param(), gen_nth(), generate_io_wp65_code(), gfc2pips_shift_comments(), points_to_reference_to_translation(), points_to_reference_to_typed_index(), replace_formal_parameters_by_real_ones(), and subscripted_field_list_to_type().

+ Here is the caller graph for this function:

◆ gen_occurences()

int gen_occurences ( const void *  vo,
const list  l 
)

count occurences of vo in l

Definition at line 746 of file list.c.

747 {
748  list c = (list) l;
749  int n = 0;
750  gen_chunk * item = (gen_chunk*) vo;
751  for (; !ENDP(c); POP(c))
752  if (CHUNK(CAR(c))==item) n++;
753  return n;
754 }

References CAR, CHUNK, ENDP, and POP.

Referenced by check_declaration_uniqueness_p(), clean_sdg(), dag_consistency_asserts(), load_arc_precondition(), occurences_in_control_list(), predecessors(), propagate_constant_image(), sequence_dg(), successors(), and topological_sort().

+ Here is the caller graph for this function:

◆ gen_once()

◆ gen_once_p()

bool gen_once_p ( list  l)

FC: ARGH...O(n^2)!

Definition at line 758 of file list.c.

759 {
760  list c;
761  for(c=l; c!=NIL && CDR(c)!=NIL; c=CDR(c)) {
762  gen_chunk * item = CHUNK(CAR(c));
763  if (gen_in_list_p(item , CDR(c)))
764  return false;
765  }
766  return true;
767 }

References CAR, CDR, CHUNK, gen_in_list_p(), and NIL.

Referenced by add_conflicts(), compilation_unit_text(), and fix_block_statement_declarations().

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

◆ gen_position()

int gen_position ( const void *  item,
const list  l 
)

Element ranks are strictly positive as for first, second, and so on.

If item is not in l, 0 is returned.

Definition at line 995 of file list.c.

996 {
997  list c_item = (list) l;
998  int rank = 0;
999 
1000  for(; !ENDP(c_item); POP(c_item)) {
1001  rank++;
1002  if(item==CHUNK(CAR(c_item))) {
1003  return rank;
1004  }
1005  }
1006  return 0;
1007 }
static entity rank

References CAR, CHUNK, ENDP, POP, and rank.

Referenced by basic_concrete_types_compatible_for_effects_interprocedural_translation_p(), check_fortran_declaration_dependencies(), entity_field_rank(), load_arc_precondition(), make_declaration_replication(), pixel_name(), sc_delimiter(), sc_get_port_id(), update_successor_in_copy(), and update_successors_of_predecessor().

+ Here is the caller graph for this function:

◆ gen_reduce()

void* gen_reduce ( void *  r,
void *(*)(void *, const list fp,
const list  l 
)

Definition at line 180 of file list.c.

181 {
182  list cp = (list) l;
183  for( ; cp != NIL ; cp = cp->cdr ) {
184  r = (*fp)( r, cp );
185  }
186  return r;
187 }

References cp, and NIL.

Referenced by do_group_basics_maximum(), do_group_count_elements(), and SizeOfDimensions().

+ Here is the caller graph for this function:

◆ gen_remove()

void gen_remove ( list cpp,
const void *  o 
)

remove all occurences of item o from list *cpp, which is thus modified.

Definition at line 685 of file list.c.

686 {
687  gen_remove_from_list(cpp, o, false);
688 }
static void gen_remove_from_list(list *pl, const void *o, bool once)
remove item o from list *pl which is modified as a side effect.
Definition: list.c:664

References gen_remove_from_list().

Referenced by add_node_to_interval(), adg_pure_dfg2(), arguments_rm_entity(), array_must_fully_written_by_regions_p(), better_elim_var_with_eg(), check_loop_distribution_feasability(), clean_distributed_io_system(), clean_shared_io_system(), clean_up_sequences_rewrite(), CleanUpEntities(), compute_regions_union(), controlize_forloop(), controlize_goto(), controlize_whileloop(), cycle_to_flow_sensitive_preconditions(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), dag_remove_unused_inputs(), dag_remove_vertex(), dag_simplify(), dag_to_flow_sensitive_preconditions(), discard_a_control_sequence_without_its_statements(), do_redundant_load_store_elimination(), do_remove_entity_from_decl(), do_remove_entity_from_private(), elim_var_with_eg(), fill_gRefToEncLoop_loop(), filter_regions(), filter_variables_in_pragma_expr(), find_exit_control_node(), freia_dag_optimize(), freia_spoc_pipeline(), fuse_2_control_nodes(), generate_code_loop(), generate_remapping_code(), GenericCleanEntities(), gfc2pips_namespace(), handle_independent_directive(), hpf_remapping(), HRE_distribute_loop(), if_conv_statement(), insert_control_in_arc(), list_diff(), loop_normalize_of_statement(), loop_private_variables_as_entites(), MakeEntry(), MakeForloopWithIndexDeclaration(), merge_actual_and_formal_sinks(), mppa_dag_split(), new_elim_var_with_eg(), opencl_merge_and_compile(), outliner(), partition_successor_p(), partition_unknowns(), plc_elim_var_with_eg(), prgm_mapping(), process_ref_lists(), put_variables_in_ordered_lists(), remapping_variables(), remove_cycle_dependencies(), remove_from_entities(), remove_interval_predecessor(), remove_module_entity(), remove_not_remapped_leavings(), remove_variable_entity(), RemoveDummyArguments(), RemoveEntityFromCompilationUnit(), RemoveFromExterns(), RemoveLocalEntityFromDeclarations(), rice_update_dependence_graph(), static_controlize_loop(), static_controlize_statement(), switch_vertex_to_a_copy(), terapix_loop_optimizer(), terapixify_loops(), test_dependence_using_regions(), TestDependence(), transfer_control_predecessor(), transfer_control_successor(), type_compatible_super_cell(), type_compatible_with_points_to_cell_p(), unlink_2_control_nodes(), unstructured_to_trail(), UseDummyArguments(), and UseFormalArguments().

+ Here is the call graph for this function:

◆ gen_remove_from_list()

static void gen_remove_from_list ( list pl,
const void *  o,
bool  once 
)
static

remove item o from list *pl which is modified as a side effect.

Parameters
oncewhether to do it once, or to look for all occurences.

Definition at line 664 of file list.c.

665 {
666  list * pc = pl;
667  while (*pc)
668  {
669  if ((gen_chunk*) o == CHUNK(CAR(*pc)))
670  {
671  list tmp = *pc;
672  *pc = CDR(*pc);
673  CAR(tmp).p = NEWGEN_FREED;
674  CDR(tmp) = NEWGEN_FREED;
675  free(tmp);
676  if (once) return;
677  }
678  else
679  pc = &CDR(*pc);
680  }
681 }
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783

References CAR, CDR, CHUNK, free(), NEWGEN_FREED, and pl.

Referenced by gen_remove(), and gen_remove_once().

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

◆ gen_remove_once()

◆ gen_replace_in_list()

bool gen_replace_in_list ( list  l,
const void *  s,
const void *  t 
)

substitute all item s by t in list l

Returns
whether the substitution was performed

Definition at line 634 of file list.c.

635 {
636  bool done = false;
637  while (l)
638  {
639  if (CHUNK(CAR(l))==s)
640  {
641  CHUNK(CAR(l)) = (gen_chunk*) t;
642  done=true;
643  }
644  l = CDR(l);
645  }
646  return done;
647 }

References CAR, CDR, and CHUNK.

Referenced by freia_dag_optimize(), insert_control_in_arc(), and switch_image_variable().

+ Here is the caller graph for this function:

◆ gen_some()

list gen_some ( gen_filter_func_t  fp,
const list  l 
)

Definition at line 206 of file list.c.

207 {
208  list cp = (list) l;
209  for( ; cp!= NIL ; cp = cp->cdr )
210  if( (*fp)(cp))
211  return cp;
212  return NIL;
213 }

References cp, and NIL.

Referenced by gen_insert_after().

+ Here is the caller graph for this function:

◆ gen_sort_list()

void gen_sort_list ( list  l,
gen_cmp_func_t  compare 
)

Sorts a list of gen_chunks in place, to avoid allocations...

The list skeleton is not touched, but the items are replaced within the list. If some of the cons are shared, it may trouble the data and the program.

See man qsort about the compare function:

  • 2 pointers to the data are passed,
  • and the result is <, =, > 0 if the comparison is lower than, equal...

FC 27/12/94

the list items are first put in the temporary table,

then sorted,

and the list items are updated with the sorted table

Definition at line 796 of file list.c.

797 {
798  list c;
799  int n = gen_length(l);
800  gen_chunk
801  **table = (gen_chunk**) alloc(n*sizeof(gen_chunk*)),
802  **point;
803 
804  /* the list items are first put in the temporary table,
805  */
806  for (c=l, point=table; !ENDP(c); c=CDR(c), point++)
807  *point = CHUNK(CAR(c));
808 
809  /* then sorted,
810  */
811  qsort(table, n, sizeof(gen_chunk*), compare);
812 
813  /* and the list items are updated with the sorted table
814  */
815  for (c=l, point=table; !ENDP(c); c=CDR(c), point++)
816  CHUNK(CAR(c)) = *point;
817 
818  gen_free_area((void**) table, n*sizeof(gen_chunk*));
819 }
size_t gen_length(const list l)
Definition: list.c:150
void gen_free_area(void **p, int size)
free an area.
Definition: list.c:775

References alloc(), CAR, CDR, CHUNK, ENDP, gen_free_area(), and gen_length().

Referenced by create_step_regions(), dag_split_on_scalars(), davinci_print_control_nodes(), davinci_print_non_deterministic_unstructured(), db_print_all_required_resources(), fprint_any_environment(), fsi_sort(), generic_points_to_set_to_stub_cell_list(), get_symbol_table(), init_statement_equivalence_table(), internal_compute_distribution_context(), new_general_merge_sort(), opencl_merge_and_compile(), order_isomorphic_statements_list(), points_to_list_sort(), prettyprint_dependence_graph(), promote_local_entities(), set_to_sorted_list(), simple_pvs_syntactically_equal_p(), sort_list_of_entities(), sort_parameters(), sort_subsequence(), statements_localize_declarations(), text_equivalence_class(), text_pointer_values(), vertex_list_sorted_by_entities(), and xml_Chain_Graph().

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

◆ gen_string_cons()

list gen_string_cons ( string  s,
const list  l 
)

Definition at line 919 of file list.c.

920 {
921  return gen_cons((const void *) s, l);
922 }

References gen_cons().

Referenced by this_entity_cdeclaration().

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

◆ gen_substitute_chunk_by_list()

void gen_substitute_chunk_by_list ( list pl,
const void *  o,
list  sl 
)

substitute item o by list sl in list *pl, which is modified as a side effect.

The substitution is performed only once when the first o is found. List sl is physically included in list *pl. If sl is empty, item o is removed from list *pl. If o is not found in *pl, *pl is left unmodified.

If the chunk to substitute is found, substitute it

Insert sl at the beggining of the new list or after ppc

Add the left over list after sl

Get rid of the useless cons

Move down the input list

Definition at line 591 of file list.c.

592 {
593  list * pc = pl; // current indirect pointer
594  list ppc = NULL; // pointer to the previous cons
595 
596  if(ENDP(sl))
597  gen_remove_once(pl, o);
598  else
599  while (*pc) {
600  /* If the chunk to substitute is found, substitute it */
601  if ((gen_chunk*) o == CHUNK(CAR(*pc))) {
602  list tmp = *pc;
603  list npc = CDR(*pc);
604 
605  /* Insert sl at the beggining of the new list or after ppc */
606  if(ppc==NULL) {
607  *pl = sl;
608  }
609  else {
610  CDR(ppc) = sl;
611  }
612 
613  /* Add the left over list after sl */
614  CDR(gen_last(sl)) = npc;
615 
616  /* Get rid of the useless cons */
617  CAR(tmp).p = NEWGEN_FREED;
618  CDR(tmp) = NEWGEN_FREED;
619  free(tmp);
620 
621  break;
622  }
623  else {
624  /* Move down the input list */
625  ppc = *pc;
626  pc = &CDR(*pc);
627  }
628  }
629 }
void gen_remove_once(list *pl, const void *o)
Remove the first occurence of o in list pl:
Definition: list.c:691
list gen_last(list l)
Return the last element of a list.
Definition: list.c:578

References CAR, CDR, CHUNK, ENDP, free(), gen_last(), gen_remove_once(), NEWGEN_FREED, and pl.

Referenced by statement_replace_with_statement_list().

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

◆ gen_typed_cons()

list gen_typed_cons ( _int  type,
const void *  item,
const list  next 
)

CONS a list with minimal type checking this cannot be done within the CONS macro because possible functions calls must not be replicated.

Definition at line 900 of file list.c.

901 {
902  NEWGEN_CHECK_TYPE(type, item);
903  // also check consistency with first item in list
904  if (next!=NIL) NEWGEN_CHECK_TYPE(type, next->car.e);
905  return gen_cons(item, next);
906 }

References cons::car, gen_chunk::e, gen_cons(), NEWGEN_CHECK_TYPE, and NIL.

Referenced by gen_abc_checked_cons(), gen_action_cons(), gen_action_kind_cons(), gen_alias_association_cons(), gen_alias_associations_cons(), gen_align_cons(), gen_alignmap_cons(), gen_alignment_cons(), gen_application_cons(), gen_approximation_cons(), gen_area_cons(), gen_array_dimension_checked_cons(), gen_assignment_cons(), gen_atom_cons(), gen_attachee_cons(), gen_attachment_cons(), gen_attachments_cons(), gen_basic_cons(), gen_bdt_cons(), gen_bound_pair_cons(), gen_c_parser_context_cons(), gen_call_cons(), gen_call_site_cons(), gen_callees_cons(), gen_cast_cons(), gen_cell_cons(), gen_cell_interpretation_cons(), gen_cell_relation_cons(), gen_cell_relations_cons(), gen_chain_cons(), gen_clone_context_cons(), gen_code_cons(), gen_communication_cons(), gen_comp_desc_cons(), gen_comp_desc_set_cons(), gen_comp_sec_cons(), gen_complexity_cons(), gen_conditional_cons(), gen_cone_cons(), gen_conflict_cons(), gen_constant_cons(), gen_context_info_cons(), gen_control_cons(), gen_controlmap_cons(), gen_dad_struct_cons(), gen_dag_cons(), gen_dagvtx_cons(), gen_data_cons(), gen_data_status_cons(), gen_database_cons(), gen_dataflow_cons(), gen_dataval_cons(), gen_datavar_cons(), gen_db_owned_resources_cons(), gen_db_resource_cons(), gen_db_resources_cons(), gen_db_status_cons(), gen_db_symbol_cons(), gen_descriptor_cons(), gen_dfg_arc_label_cons(), gen_dfg_vertex_label_cons(), gen_dg_arc_label_cons(), gen_dg_vertex_label_cons(), gen_dimension_checked_cons(), gen_dimension_cons(), gen_distribute_cons(), gen_distributemap_cons(), gen_distribution_cons(), gen_dummy_cons(), gen_dynamic_check_cons(), gen_dynamic_status_cons(), gen_effect_cons(), gen_effects_classes_cons(), gen_effects_cons(), gen_entities_cons(), gen_entity_cons(), gen_entity_effects_cons(), gen_entity_entities_cons(), gen_entity_int_cons(), gen_entity_status_cons(), gen_entity_task_buffers_cons(), gen_entity_to_entity_cons(), gen_entitymap_cons(), gen_equivalences_cons(), gen_evaluation_cons(), gen_execution_cons(), gen_expression_cons(), gen_expressionwithlevel_cons(), gen_extension_cons(), gen_extensions_cons(), gen_forloop_cons(), gen_formal_cons(), gen_function_cons(), gen_functional_cons(), gen_gap_cons(), gen_gexpression_cons(), gen_graph_cons(), gen_hpf_newdecl_cons(), gen_hpf_newdecls_cons(), gen_hpfc_reductions_cons(), gen_hpfc_status_cons(), gen_ifcount_cons(), gen_instruction_cons(), gen_interpreted_cell_cons(), gen_interval_vertex_label_cons(), gen_language_cons(), gen_leaf_label_cons(), gen_lexpressionwithlevel_cons(), gen_lisp_expression_cons(), gen_loop_cons(), gen_makefile_cons(), gen_map_effect_bool_cons(), gen_map_effect_step_point_cons(), gen_map_entity_int_cons(), gen_match_cons(), gen_matchTree_cons(), gen_matchTreeSons_cons(), gen_memory_mapping_cons(), gen_message_cons(), gen_mode_cons(), gen_multitest_cons(), gen_newdeclmap_cons(), gen_normalized_cons(), gen_numbers_status_cons(), gen_opcode_cons(), gen_opcodeClass_cons(), gen_operator_id_tree_cons(), gen_overlap_cons(), gen_overlapsmap_cons(), gen_owner_cons(), gen_parameter_cons(), gen_path_selector_cons(), gen_path_selectors_cons(), gen_pattern_cons(), gen_patternArg_cons(), gen_patternx_cons(), gen_persistant_expression_to_effects_cons(), gen_persistant_expression_to_entity_cons(), gen_persistant_statement_to_cluster_cons(), gen_persistant_statement_to_control_cons(), gen_persistant_statement_to_int_cons(), gen_persistant_statement_to_statement_cons(), gen_placement_cons(), gen_plc_cons(), gen_points_to_cons(), gen_points_to_graph_cons(), gen_points_to_list_cons(), gen_pragma_cons(), gen_predicate_cons(), gen_preference_cons(), gen_property_cons(), gen_pstatement_cons(), gen_pstatement_reductions_cons(), gen_qualifier_cons(), gen_quast_cons(), gen_quast_leaf_cons(), gen_quast_value_cons(), gen_ram_cons(), gen_range_cons(), gen_rangecount_cons(), gen_real_resource_cons(), gen_recursive_selector_cons(), gen_reduced_loops_cons(), gen_reduction_cons(), gen_reduction_operator_cons(), gen_reductionInfo_cons(), gen_reductions_cons(), gen_ref_temp_cons(), gen_reference_cons(), gen_remapping_cons(), gen_renaming_cons(), gen_resource_cons(), gen_rtype_cons(), gen_rule_cons(), gen_scc_cons(), gen_sccflags_cons(), gen_sccs_cons(), gen_schedule_cons(), gen_sentence_cons(), gen_sequence_cons(), gen_sesam_buffers_processing_context_cons(), gen_sexpression_cons(), gen_simdstatement_cons(), gen_simple_section_cons(), gen_sizeofexpression_cons(), gen_statement_cell_relations_cons(), gen_statement_cons(), gen_statement_effects_cons(), gen_statement_entities_cons(), gen_statement_points_to_cons(), gen_statement_renamings_cons(), gen_statement_task_cons(), gen_static_control_cons(), gen_status_cons(), gen_step_clause_cons(), gen_step_comm_cons(), gen_step_directive_cons(), gen_step_directives_cons(), gen_step_point_cons(), gen_storage_cons(), gen_style_cons(), gen_subscript_cons(), gen_successor_cons(), gen_symbolic_cons(), gen_synchronization_cons(), gen_syntax_cons(), gen_task_buffers_cons(), gen_task_cons(), gen_test_cons(), gen_text_cons(), gen_tiling_cons(), gen_transformation_cons(), gen_transformer_cons(), gen_type_cons(), gen_ubs_check_cons(), gen_ubs_cons(), gen_unformatted_cons(), gen_unstructured_cons(), gen_value_cons(), gen_var_val_cons(), gen_varcount_cons(), gen_variable_cons(), gen_vertex_cons(), gen_virtual_resource_cons(), gen_vtxcontent_cons(), gen_whileloop_cons(), and gen_word_to_attachments_cons().

+ Here is the call graph for this function:

◆ gen_VOID_STAR_cons()

list gen_VOID_STAR_cons ( const void *  e,
const list  l 
)

Definition at line 934 of file list.c.

935 {
936  return gen_cons((const void *) e, l);
937 }

References gen_cons().

+ Here is the call graph for this function:

◆ list_own_allocated_memory()

size_t list_own_allocated_memory ( const list  l)

Definition at line 158 of file list.c.

159 {
160  return gen_length(l)*sizeof(cons);
161 }
struct cons cons
The structure used to build lists in NewGen.

References gen_length().

Referenced by allocated_memory_simple_in().

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

Variable Documentation

◆ gen_chunk_of_cons_of_gen_chunk

gen_chunk* gen_chunk_of_cons_of_gen_chunk = gen_chunk_undefined
static

SPECIAL INSERTION.

Definition at line 217 of file list.c.

Referenced by cons_of_gen_chunk(), and gen_insert_after().