PIPS
unary_operators.c
Go to the documentation of this file.
1 /*
2 
3  $Id: unary_operators.c 23412 2017-08-09 15:07:09Z irigoin $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /* package generic effects : Be'atrice Creusillet 5/97
28  *
29  * File: unary_operators.c
30  * ~~~~~~~~~~~~~~~~~~~~~~~~
31  *
32  * This File contains generic unary operators for effects and lists of effects.
33  *
34  */
35 
36 #include <stdio.h>
37 #include <string.h>
38 
39 #include "genC.h"
40 #include "linear.h"
41 #include "ri.h"
42 #include "effects.h"
43 #include "ri-util.h"
44 #include "prettyprint.h"
45 #include "text-util.h"
46 #include "effects-util.h"
47 #include "misc.h"
48 
49 // for:
50 // c_convex_effects_on_formal_parameter_backward_translation
51 // set_translation_context_sc/reset_translation_context_sc
52 // ??? should be removed
53 #include "effects-convex.h"
54 #include "effects-generic.h"
55 
56 void
57 effects_map(list l_eff, void (*apply)(effect))
58 {
59  MAP(EFFECT, eff, {apply(eff);}, l_eff);
60 }
61 
62 list
63 effects_to_effects_map(list l_eff, effect (*pure_apply)(effect))
64 {
65  list l_new = NIL;
66  MAP(EFFECT, eff,
67  l_new = CONS(EFFECT, pure_apply(eff), l_new),
68  l_eff);
69  return gen_nreverse(l_new);
70 }
71 
72 void
73 effects_filter_map(list l_eff, bool (*filter)(effect), void (*apply)(effect))
74 {
75  MAP(EFFECT, eff, {if (filter(eff)) apply(eff);}, l_eff);
76 }
77 
78 list
79 effects_to_effects_filter_map(list l_eff , bool (*filter)(effect),
80  effect (*pure_apply)(effect))
81 {
82  list l_new = NIL;
83  MAP(EFFECT, eff,
84  if (filter(eff)) l_new = CONS(EFFECT, pure_apply(eff), l_new),
85  l_eff);
86  return gen_nreverse(l_new);
87 }
88 
89 list
90 effects_add_effect(list l_eff, effect eff)
91 {
92  return gen_nconc(l_eff, CONS(EFFECT, eff, NIL));
93 }
94 
95 list
97 {
98  list l_new = NIL;
99  MAP(EFFECT, eff,
100  if (effect_read_p(eff)) l_new = CONS(EFFECT, eff, l_new),
101  l_eff);
102  return gen_nreverse(l_new);
103 }
104 
105 list
107 {
108  list l_new = NIL;
109  MAP(EFFECT, eff,
110  if (store_effect_p(eff)) l_new = CONS(EFFECT, eff, l_new),
111  l_eff);
112  return gen_nreverse(l_new);
113 }
114 
115 list
117 {
118  list l_new = NIL;
119  MAP(EFFECT, eff,
120  if (effect_write_p(eff)) l_new = CONS(EFFECT, eff, l_new),
121  l_eff);
122  return gen_nreverse(l_new);
123 }
124 
125 /* At least one of the effects in l_eff is a write */
127 {
128  bool write_once_p = false;
129 
130  FOREACH(EFFECT, eff, l_eff) {
131  if (effect_write_p(eff)) {
132  write_once_p = true;
133  break;
134  }
135  }
136  return write_once_p;
137 }
138 
139 list
141 {
142  list l_new = NIL;
143  // functions that can be pointed by effect_dup_func:
144  // simple_effect_dup
145  // region_dup
146  // copy_effect
147  MAP(EFFECT, eff,
148  if (effect_read_p(eff))
149  l_new = CONS(EFFECT, (*effect_dup_func)(eff), l_new),
150  l_eff);
151  return gen_nreverse(l_new);
152 }
153 
154 list
156 {
157  list l_new = NIL;
158  // functions that can be pointed by effect_dup_func:
159  // simple_effect_dup
160  // region_dup
161  // copy_effect
162  MAP(EFFECT, eff,
163  if (effect_write_p(eff))
164  l_new = CONS(EFFECT, (*effect_dup_func)(eff), l_new),
165  l_eff);
166  return gen_nreverse(l_new);
167 }
168 
169 effect
170 effect_nop(effect eff)
171 {
172  return eff;
173 }
174 
175 list
176 effects_nop(list l_eff)
177 {
178  return l_eff;
179 }
180 
181 void
183 {
185 }
186 
187 void
189 {
191 }
192 
193 void
195 {
197 }
198 
199 void
201 {
203 }
204 
205 void
207 {
209 /* if (effect_read_p(eff)) */
210 /* { */
211 /* action ac = make_action_read(copy_action_kind(action_read(effect_action(eff)))); */
212 /* free_action(effect_action(eff)); */
213 /* effect_action(eff) = ac; */
214 /* } */
215 }
216 
217 void
219 {
221 }
222 
223 void
225 {
227 /* if (effect_write_p(eff)) */
228 /* { */
229 /* action ac = make_action_read(copy_action_kind(action_write(effect_action(eff)))); */
230 /* free_action(effect_action(eff)); */
231 /* effect_action(eff) = ac; */
232 /* } */
233 }
234 
235 void
237 {
239 }
240 void
242 {
243  FOREACH(EFFECT, eff, l_eff)
244  {
245  if (!effect_scalar_p(eff))
247  }
248 }
249 
250 /* returned list as no sharing with parameters */
251 list
253 {
254  list l_res = NIL;
255 
256  FOREACH(EFFECT, eff,l_eff)
257  {
258  if (gen_find_eq(effect_entity(eff), l_var) == entity_undefined)
259  {
260  // functions that can be pointed by effect_dup_func:
261  // simple_effect_dup
262  // region_dup
263  // copy_effect
264  l_res = CONS(EFFECT, (*effect_dup_func)(eff), l_res);
265  }
266  else
267  pips_debug(7, "Effect on variable %s removed\n",
269  }
270  return gen_nreverse(l_res);
271 }
272 
273 
274 list
275 effects_dup(list l_eff)
276 {
277  list l_new = NIL;
278  list ec = list_undefined;
279 
280  ifdebug(8) {
281  effects e = make_effects(l_eff);
282  pips_assert("input effects are consistent", effects_consistent_p(e));
283  effects_effects(e) = NIL;
284  free_effects(e);
285  }
286 
287  for(ec = l_eff; !ENDP(ec); POP(ec)) {
288  effect eff = EFFECT(CAR(ec));
289 
290  /* build last to first */
291  // functions that can be pointed by effect_dup_func:
292  // simple_effect_dup
293  // region_dup
294  // copy_effect
295  l_new = CONS(EFFECT, (*effect_dup_func)(eff), l_new);
296  }
297 
298  /* and the order is reversed */
299  l_new = gen_nreverse(l_new);
300 
301  ifdebug(8) {
302  effects e = make_effects(l_new);
303  pips_assert("input effects are consistent", effects_consistent_p(e));
304  effects_effects(e) = NIL;
305  free_effects(e);
306  }
307 
308  return l_new;
309 }
310 
311 void
312 effect_free(effect eff)
313 {
314  // functions that can be pointed by effect_free_func:
315  // free_effect
316  // region_free
317  (*effect_free_func)(eff);
318 }
319 
320 void
321 effects_free(list l_eff)
322 {
323  // functions that can be pointed by effect_free_func:
324  // free_effect
325  // region_free
326  MAP(EFFECT, eff,
327  {(*effect_free_func)(eff);},
328  l_eff);
329  gen_free_list(l_eff);
330 }
331 
332 /* list effect_to_nil_list(effect eff)
333  * input : an effect
334  * output : an empty list of effects
335  * modifies : nothing
336  * comment :
337  */
338 list effect_to_nil_list(effect eff __attribute__((__unused__)))
339 {
340  return(NIL);
341 }
342 
343 /** frees the input effect and returns a NIL list
344  */
346 {
347  effect_free(eff);
348  return(NIL);
349 }
350 
351 /* list effects_to_nil_list(eff)
352  * input : an effect
353  * output : an empty list of effects
354  * modifies : nothing
355  * comment :
356  */
357 list effects_to_nil_list(effect eff1 __attribute__((__unused__)), effect eff2 __attribute__((__unused__)) )
358 {
359  return(NIL);
360 }
361 
363 {
364  return(CONS(EFFECT,eff,NIL));
365 }
366 
368 {
370  return(CONS(EFFECT,eff,NIL));
371 }
372 
374 {
375  list l_ent = NIL;
376  FOREACH(EFFECT, eff, l_eff)
377  {
378  if (store_effect_p(eff) && effect_write_p(eff) && effect_scalar_p(eff))
379  l_ent = CONS(ENTITY, effect_entity(eff), l_ent);
380  }
381  return l_ent;
382 }
383 /***********************************************************************/
384 /* UNDEFINED UNARY OPERATORS */
385 /***********************************************************************/
386 
387 /* Composition with transformers */
388 
389 list
391 {
392  return list_undefined;
393 }
394 
395 
397  transformer trans __attribute__((__unused__)))
398 {
399  return l_eff;
400 }
401 
402 
403 
404 
405 /* Composition with preconditions */
406 
407 list
409 {
410  return list_undefined;
411 }
412 
413 list
414 effects_composition_with_preconditions_nop(list l_eff, transformer __attribute__((__unused__)) trans , bool __attribute__((__unused__)) b)
415 {
416  return l_eff;
417 }
418 
419 /* Union over a range */
420 
423 {
424  return descriptor_undefined;
425 }
426 
427 list
429  list l_eff __attribute__((__unused__)), entity index __attribute__((__unused__)), range r __attribute__((__unused__)), descriptor d __attribute__((__unused__)))
430 {
431  return list_undefined;
432 }
433 
435  entity index __attribute__((__unused__)),
436  range r __attribute__((__unused__)),
437  descriptor d __attribute__((__unused__)))
438 {
439  return l_eff;
440 }
441 
442 
443 list
445  entity orig_ent __attribute__((__unused__)),
446  entity new_ent __attribute__((__unused__)))
447 {
448  return list_undefined;
449 }
450 
451 list
453  entity new_ent __attribute__((__unused__)))
454 {
455  return l_eff;
456 }
457 
458 
461 {
462  return descriptor_undefined;
463 }
464 
465 list
467  entity index __attribute__((__unused__)),
468  range r __attribute__((__unused__)),
469  entity *new_index,
470  descriptor range_descriptor __attribute__((__unused__)),
471  bool descriptor_update_p __attribute__((__unused__)))
472 {
473  *new_index = entity_undefined;
474  return list_undefined;
475 }
476 
477 list
479  entity index __attribute__((__unused__)),
480  range r __attribute__((__unused__)),
481  entity *new_index __attribute__((__unused__)),
482  descriptor range_descriptor __attribute__((__unused__)),
483  bool descriptor_update_p __attribute__((__unused__)))
484 {
485  return l_eff;
486 }
487 
488 list /* of nothing */
489 db_get_empty_list(string name)
490 {
491  pips_debug(5, "getting nothing for %s\n", name);
492  return NIL;
493 }
494 
495 
496 /* adding special dimensions */
497 
498 /* void effect_add_dereferencing_dimension(effect eff)
499  * input : an effect
500  * output : nothing
501  * modifies : the effect eff.
502  * comment : adds a last dimension to represent an effect on the memory
503  * location pointed by the reference of the initial effect.
504  * also modifies the descriptor if there is one
505  */
507 {
511  {
512  pips_debug(8, "abstract location \n");
513  cell eff_c = effect_cell(eff);
514  if (!anywhere_effect_p(eff))
515  {
516  /* change for an anywhere effect. More work could be done here
517  in case of a typed abstract location
518  */
519  entity anywhere_ent = entity_all_locations();
520  if (cell_preference_p(eff_c))
521  {
522  /* it's a preference : we change for a reference cell */
523  free_cell(eff_c);
524  effect_cell(eff) = make_cell_reference(make_reference(anywhere_ent, NIL));
525  }
526  else
527  {
528  reference_variable(cell_reference(eff_c)) = anywhere_ent;
529  }
530  }
531  }
532  else
533  {
534  expression deref_exp = int_to_expression(0);
535  pips_debug(8, "heap or concrete location \n");
536 
537  // functions that can be pointed by effect_add_expression_dimension_func:
538  // simple_effect_add_expression_dimension
539  // convex_region_add_expression_dimension
540  (*effect_add_expression_dimension_func)(eff, deref_exp);
541  free_expression(deref_exp);
542  }
543  return;
544 }
545 
546 static expression field_entity_to_expression(entity f)
547 {
549  expression e;
552  return e;
553 }
554 
555 /* void effect_add_dereferencingfield_dimension(effect eff, int rank)
556  * input : an effect
557  * output : nothing
558  * modifies : the effect eff.
559  * comment : adds a last dimension to represent an effect on the field
560  * of rank "rank" of the actual reference represented by the
561  * effect reference. The dimension is added at the end of the
562  * effect reference dimensions.Also modifies the descriptor
563  * if the representation includes one.
564  */
565 
566 /**
567  @brief adds a last dimension to the effect reference, which is a
568  reference expression to the field entity.
569  @param effect the input effect, whose reference is modified
570  @param field the input field entity
571  */
573 {
574  cell eff_c = effect_cell(eff);
575 
576  pips_debug_effect(8, "begin with effect :\n", eff);
577  pips_debug(8, "and field: %s\n", entity_name(field));
578 
581  {
582  if (!anywhere_effect_p(eff))
583  {
584  /* change for an anywhere effect. More work could be done here
585  * in case of a typed abstract location
586  */
587  entity anywhere_ent = entity_all_locations();
588  if (cell_preference_p(eff_c))
589  {
590  /* it's a preference : we change for a reference cell */
591  free_cell(eff_c);
592  effect_cell(eff) = make_cell_reference(make_reference(anywhere_ent, NIL));
593  }
594  else
595  {
596  reference_variable(cell_reference(eff_c)) = anywhere_ent;
597  }
598  }
599  }
600  else
601  {
602  reference ref;
603  if (cell_preference_p(eff_c))
604  {
605  /* it's a preference : we change for a reference cell */
606  pips_debug(8, "It's a preference\n");
608  free_cell(eff_c);
610  }
611  else
612  {
613  /* it's a reference : let'us modify it */
614  ref = cell_reference(eff_c);
615  }
616 
619  field_entity_to_expression(field),
620  NIL));
621  }
622  pips_debug_effect(8, "end with effect :\n",eff);
623 
624  return;
625 }
626 
627 /***********************************************************************/
628 /* FILTERING DECLARATIONS */
629 /***********************************************************************/
630 
631 /** filter the input effects using the input declaration - matching
632  effects with no dereferencements are skipped - effects with
633  dereferencements are translated using the declaration initial
634  value if it exists, or are translated to an abstract location
635  effect (currently anywhere) otherwise.
636 
637  @param l_eff is the input effect list, it is freed by the function
638  to avoid copying the potentially numerous effects which are not
639  concerned by the declaration.
640 
641  @param decl is an entity.
642 
643  usage: l_new_eff = filter_effects_with_declaration(l_eff, decl)
644  */
646 {
647  list l_res = NIL;
648  storage decl_s = entity_storage(decl);
649 
650  ifdebug(8)
651  {
652  type ct = entity_basic_concrete_type(decl);
653  pips_debug(8, "dealing with entity : %s with type %s\n",
655  }
656 
657  if (storage_ram_p(decl_s)
658  /* static variable declaration has no effect, even in case of initialization. */
660  && type_variable_p(entity_type(decl)))
661  {
662  value v_init = entity_initial(decl);
663  expression exp_init = expression_undefined;
664  if(value_expression_p(v_init))
665  exp_init = value_expression(v_init);
666 
667  // We must first eliminate effects on the declared variable
668  // except if it is a static or extern variable.
669  // or use the initial value to translate them to the preceding memory state
670  // We should take care of the transformer too for convex effects.
671  // But which transformer ? Is the statement transfomer OK?
672  // or do we need to use the transformer for each variable initialization ?
673  // The last statement is probably the truth, but this is not what is currently implemented
674 
675  FOREACH(EFFECT, eff, l_eff)
676  {
677  reference eff_ref = effect_any_reference(eff);
678  entity eff_ent = reference_variable(eff_ref);
679 
680  pips_debug_effect(8,"dealing_with_effect: \n", eff);
681 
682  if (eff_ent == decl)
683  {
684  pips_debug(8, "same entity\n");
685  if(ENDP(reference_indices(eff_ref)))
686  {
687  // effect on the variable itself: no need to keep it
688  free_effect(eff);
689  }
690  else
691  /* here, it is a store effect */
692  {
693  bool exact_p;
694  /* no need to keep the effect if there is no pointer in the
695  * path of the effect or if it's a FILE* - well the latter
696  * is a hack, but with constant path effects this should not
697  * happen - BC
698  */
699  if (/* !effect_reference_contains_pointer_dimension_p(eff_ref, &exact_p) */
700  !effect_reference_dereferencing_p(eff_ref, &exact_p)
701  // !memory_dereferencing_p(eff_ref)
702  || FILE_star_effect_reference_p(eff_ref))
703  {
704  /* If a pointer effect disappear, some escape analysis
705  might be useful to remove effects on unreachable heap
706  locations. */
707  free_effect(eff);
708  }
709  else
710  {
711  if(!expression_undefined_p(exp_init)) // there is an inital value
712  {
713  // let us re-use an existing method even if it's not the fastest method
714  // interprocedural translation and intra-procedural
715  // propagation will have to be re-packaged later
716  list l_tmp = CONS(EFFECT, eff, NIL);
717  list l_res_tmp;
718 
719  // functions that can be pointed by c_effects_on_formal_parameter_backward_translation_func:
720  // c_simple_effects_on_formal_parameter_backward_translation
721  // c_convex_effects_on_formal_parameter_backward_translation
724  {
725  Psysteme sc = sc_new();
726  sc_creer_base(sc);
728  }
729 
730  /* beware of casts : do not take them into account for the moment */
731  syntax s_init = expression_syntax(exp_init);
732  if (syntax_cast_p(s_init))
733  exp_init = cast_expression(syntax_cast(s_init));
734  // functions that can be pointed by c_effects_on_formal_parameter_backward_translation_func:
735  // c_simple_effects_on_formal_parameter_backward_translation
736  // c_convex_effects_on_formal_parameter_backward_translation
737  l_res_tmp = (*c_effects_on_formal_parameter_backward_translation_func)(
738  l_tmp, exp_init, transformer_undefined);
739 
740  // functions that can be pointed by c_effects_on_formal_parameter_backward_translation_func:
741  // c_simple_effects_on_formal_parameter_backward_translation
742  // c_convex_effects_on_formal_parameter_backward_translation
745  {
747  }
748 
749  if (!exact_p) effects_to_may_effects(l_res_tmp);
750 
751  // functions that can be pointed by effects_union_op:
752  // ProperEffectsMustUnion
753  // RegionsMustUnion
754  // ReferenceUnion
755  // EffectsMustUnion
756  l_res = (*effects_union_op)(
757  l_res_tmp, l_res, effects_same_action_p);
758  gen_full_free_list(l_tmp); /* also free the input effect */
759  }
760  else
761  {
762  pips_debug(8, "there is no inital_value\n");
763  if (get_constant_paths_p())
764  {
765  pips_debug(8, "-> anywhere effect \n");
767  l_res = clean_anywhere_effects(l_tmp);
768  gen_full_free_list(l_tmp);
769  }
770  free_effect(eff);
771 
772  }
773  }
774  } /* if( !ENP(reference_indices(eff_ref))) */
775  }
776  else
777  {
778  // keep the effect if it's an effect on another entity
779  l_res = CONS(EFFECT, eff, l_res);
780  }
781 
782  } /* FOREACH */
783  gen_free_list(l_eff);
784  l_res = gen_nreverse(l_res); // we try to preserve the order of the input list
785 
786  }
787  return l_res;
788 }
789 
790 /***********************************************************************/
791 /* */
792 /***********************************************************************/
793 
794 /**
795  @input eff is an input effect describing a memory path
796  @return a list of effects corresponding to effects on eff cell prefix pointer paths
797 */
799 {
800  pips_debug_effect(5, "input effect :", eff);
801  list l_res = NIL;
804  descriptor d = effect_descriptor(eff);
806  int nb_phi_init = (int) gen_length(ref_inds);
807  reference tmp_ref = make_reference(e, NIL);
809  bool finished = false;
810 
812  {
813  if (anywhere_effect_p(eff)
816  return CONS(EFFECT, copy_effect(eff), NIL);
817  }
818 
819  while (!finished && !ENDP(ref_inds))
820  {
821  switch (type_tag(t))
822  {
823 
824  case is_type_variable:
825  {
826  pips_debug(5," variable case\n");
828  size_t nb_dim = gen_length(variable_dimensions(type_variable(t)));
829 
830  /* add to tmp_ref as many indices from ref as nb_dim */
831  for(size_t i = 0; i< nb_dim; i++, POP(ref_inds))
832  {
833  reference_indices(tmp_ref) =
834  gen_nconc(reference_indices(tmp_ref),
837  NIL));
838  }
839 
840  if (basic_pointer_p(b))
841  {
842  pips_debug(5," pointer basic\n");
843  if (!ENDP(ref_inds))
844  {
845  pips_debug(5,"and ref_inds is not empty\n");
846  int nb_phi_tmp_eff = (int) gen_length(reference_indices(tmp_ref));
847  effect tmp_eff = effect_undefined;
848  if (descriptor_convex_p(d))
849  {
850  if (nb_phi_tmp_eff == 0)
851  {
852  tmp_eff =
857  }
858  else
859  {
860  tmp_eff =
864  copy_descriptor(d));
865  for(int nphi = nb_phi_tmp_eff; nphi <= nb_phi_init; nphi++)
866  {
869  }
870  }
871  }
872  else if (!descriptor_none_p(d))
873  {
874  pips_internal_error("invalid effect descriptor kind\n");
875  }
876  else
877  {
878  tmp_eff =
883  }
884 
885  l_res = CONS(EFFECT, tmp_eff, l_res);
886  reference_indices(tmp_ref) =
887  gen_nconc(reference_indices(tmp_ref),
890  NIL));
891  POP(ref_inds);
892 
893  type new_t = copy_type(basic_pointer(b));
894  /* free_type(t);*/
895  t = new_t;
896  }
897  else
898  finished = true;
899  }
900  else if (basic_derived_p(b))
901  {
902  pips_debug(5,"derived basic\n");
904  t = new_t;
905  }
906  else
907  finished = true;
908  }
909  break;
910  case is_type_struct:
911  case is_type_union:
912  case is_type_enum:
913  {
914  pips_debug(5,"struct union or enum type\n");
915 
916  /* add next index */
917  expression field_exp = EXPRESSION(CAR(ref_inds));
918  reference_indices(tmp_ref) =
919  gen_nconc(reference_indices(tmp_ref),
921  copy_expression(field_exp),
922  NIL));
923  POP(ref_inds);
924  entity field_ent = expression_to_entity(field_exp);
925  pips_assert("expression is a field entity\n", !entity_undefined_p(field_ent));
926  type new_t = entity_basic_concrete_type(field_ent);
927  t = new_t;
928  }
929  break;
930  default:
931  pips_internal_error("unexpected type tag");
932  break;
933  }
934  }
935 
936  return l_res;
937 }
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
cell make_cell_reference(reference _field_)
Definition: effects.c:293
action copy_action(action p)
ACTION.
Definition: effects.c:77
void free_effect(effect p)
Definition: effects.c:451
descriptor make_descriptor_convex(Psysteme _field_)
Definition: effects.c:439
bool effects_consistent_p(effects p)
Definition: effects.c:541
effects make_effects(list a)
Definition: effects.c:568
void free_cell(cell p)
Definition: effects.c:249
approximation copy_approximation(approximation p)
APPROXIMATION.
Definition: effects.c:132
effect make_effect(cell a1, action a2, approximation a3, descriptor a4)
Definition: effects.c:484
void free_effects(effects p)
Definition: effects.c:535
descriptor copy_descriptor(descriptor p)
DESCRIPTOR.
Definition: effects.c:389
effect copy_effect(effect p)
EFFECT.
Definition: effects.c:448
descriptor make_descriptor_none(void)
Definition: effects.c:442
normalized make_normalized(enum normalized_utype tag, void *val)
Definition: ri.c:1447
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
type copy_type(type p)
TYPE.
Definition: ri.c:2655
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
void free_expression(expression p)
Definition: ri.c:853
reference copy_reference(reference p)
REFERENCE.
Definition: ri.c:2047
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
bool entity_flow_or_context_sentitive_heap_location_p(entity e)
bool entity_heap_location_p(entity b)
package abstract location.
static list ref_inds
Current list of transformations.
Definition: adg_read_paf.c:169
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
bool entity_abstract_location_p(entity al)
entity entity_all_locations()
eturn ANY_MODULE:ANYWHERE (the top of the lattice)
void const char const char const int
void set_translation_context_sc(Psysteme)
void convex_region_descriptor_remove_ith_dimension(effect, int)
list c_convex_effects_on_formal_parameter_backward_translation(list, expression, transformer)
void reset_translation_context_sc(void)
#define pips_debug_effect(level, message, eff)
for debug
list effects_undefined_composition_with_preconditions(list, transformer)
void effects_to_write_effects(list)
list effects_to_effects_map(list, effect(*)(effect))
list effects_store_effects(list)
list effect_to_may_effect_list(effect)
void effect_to_must_effect(effect)
descriptor effects_undefined_vector_to_descriptor(Pvecteur)
list effects_undefined_union_over_range(list, entity, range, descriptor)
void effects_to_may_effects(list)
list effects_read_effects_dup(list)
effect make_anywhere_effect(action)
list effects_descriptors_variable_change_nop(list, entity, entity)
effect effect_nop(effect)
list(* c_effects_on_formal_parameter_backward_translation_func)(list, expression, transformer)
void effect_add_dereferencing_dimension(effect)
void effect_to_write_effect(effect)
list effects_composition_with_preconditions_nop(list, transformer, bool)
list effects_undefined_descriptors_variable_change(list, entity, entity)
list db_get_empty_list(string)
list effects_to_effects_filter_map(list, bool(*)(effect), effect(*)(effect))
list effects_add_effect(list, effect)
bool effects_write_at_least_once_p(list)
list effects_read_effects(list)
void array_effects_to_may_effects(list)
list effects_write_effects_dup(list)
void effects_filter_map(list, bool(*)(effect), void(*)(effect))
list effects_composition_with_transformer_nop(list, transformer)
list effects_union_over_range_nop(list, entity, range, descriptor)
void effects_map(list, void(*)(effect))
unary_operators.c
descriptor loop_undefined_descriptor_make(loop)
list effect_to_nil_list_and_free(effect)
list clean_anywhere_effects(list)
list effect_to_nil_list(effect)
void effect_free(effect)
void effects_free(list)
void effects_to_must_effects(list)
list effects_dup(list)
void effect_to_may_effect(effect)
list filter_effects_with_declaration(list, entity)
list effect_intermediary_pointer_paths_effect(effect)
bool get_constant_paths_p(void)
list effects_undefined_loop_normalize(list, entity, range, entity *, descriptor, bool)
list effects_undefined_composition_with_transformer(list, transformer)
list effects_to_written_scalar_entities(list)
list effects_write_effects(list)
void effect_to_read_effect(effect)
list effects_loop_normalize_nop(list, entity, range, entity *, descriptor, bool)
effect(* effect_dup_func)(effect eff)
void effects_to_read_effects(list)
list effects_dup_without_variables(list, list)
list effects_nop(list)
list effect_to_list(effect)
void effect_add_field_dimension(effect, entity)
list effects_to_nil_list(effect, effect)
bool effects_same_action_p(effect, effect)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_approximation_tag(eff)
#define effect_write_p(eff)
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
#define effect_action_tag(eff)
bool undefined_pointer_value_cell_p(cell)
bool effect_abstract_location_p(effect)
Definition: effects.c:280
bool effect_reference_dereferencing_p(reference, bool *)
Definition: type.c:233
entity effect_entity(effect)
cproto-generated files
Definition: effects.c:52
bool store_effect_p(effect)
Definition: effects.c:1062
bool effect_scalar_p(effect)
Definition: effects.c:567
bool FILE_star_effect_reference_p(reference)
Definition: effects.c:536
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
Definition: effects.c:346
bool null_pointer_value_cell_p(cell)
#define cell_reference(x)
Definition: effects.h:469
#define cell_preference(x)
Definition: effects.h:472
#define effect_action(x)
Definition: effects.h:642
#define effect_undefined
Definition: effects.h:614
#define descriptor_convex_p(x)
Definition: effects.h:599
#define effect_descriptor(x)
Definition: effects.h:646
#define effects_effects(x)
Definition: effects.h:710
#define descriptor_undefined
Definition: effects.h:559
@ is_action_write
Definition: effects.h:293
@ is_action_read
Definition: effects.h:292
#define cell_preference_p(x)
Definition: effects.h:470
#define descriptor_none_p(x)
Definition: effects.h:602
@ is_approximation_may
Definition: effects.h:341
@ is_approximation_exact
Definition: effects.h:343
#define effect_approximation(x)
Definition: effects.h:644
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
#define effect_cell(x)
Definition: effects.h:640
void gen_full_free_list(list l)
Definition: genClib.c:1023
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
#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
static expression s_init
must take care not to substitute in an inserted expression
Definition: macros.c:177
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_internal_error
Definition: misc-local.h:149
#define UU
Definition: newgen_types.h:98
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
string string_of_type(const type)
Definition: type.c:56
void apply(char *phasename, char *target)
apply a transformation on a module
Definition: pypips.c:324
bool static_area_p(entity aire)
Definition: area.c:77
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
Definition: type.c:3677
#define basic_pointer(x)
Definition: ri.h:637
#define transformer_undefined
Definition: ri.h:2847
#define reference_variable(x)
Definition: ri.h:2326
#define basic_derived(x)
Definition: ri.h:640
#define type_tag(x)
Definition: ri.h:2940
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define syntax_cast(x)
Definition: ri.h:2739
#define type_variable(x)
Definition: ri.h:2949
#define basic_pointer_p(x)
Definition: ri.h:635
#define basic_derived_p(x)
Definition: ri.h:638
#define entity_storage(x)
Definition: ri.h:2794
@ is_syntax_reference
Definition: ri.h:2691
#define storage_ram_p(x)
Definition: ri.h:2519
#define ram_section(x)
Definition: ri.h:2249
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define cast_expression(x)
Definition: ri.h:747
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
#define entity_name(x)
Definition: ri.h:2790
#define reference_indices(x)
Definition: ri.h:2328
#define preference_reference(x)
Definition: ri.h:2102
#define expression_undefined_p(x)
Definition: ri.h:1224
#define variable_dimensions(x)
Definition: ri.h:3122
#define storage_ram(x)
Definition: ri.h:2521
#define syntax_cast_p(x)
Definition: ri.h:2737
@ is_type_enum
Definition: ri.h:2907
@ is_type_variable
Definition: ri.h:2900
@ is_type_union
Definition: ri.h:2906
@ is_type_struct
Definition: ri.h:2905
#define entity_type(x)
Definition: ri.h:2792
#define value_expression_p(x)
Definition: ri.h:3080
#define expression_syntax(x)
Definition: ri.h:1247
#define type_variable_p(x)
Definition: ri.h:2947
#define value_expression(x)
Definition: ri.h:3082
#define variable_basic(x)
Definition: ri.h:3120
@ is_normalized_complex
Definition: ri.h:1761
#define entity_initial(x)
Definition: ri.h:2796
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
#define ifdebug(n)
Definition: sg.c:47
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
The structure used to build lists in NewGen.
Definition: newgen_list.h:41