PIPS
passes.c
Go to the documentation of this file.
1 /*
2 
3  $Id: passes.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 
25 /*
26  * This file contains the passes computing points-to information:
27  *
28  * intraprocedural_points_to_analysis
29  * init_points_to_analysis
30  * interprocedural_points_to_analysis
31  */
32 
33 #include <stdlib.h>
34 #include <stdio.h>
35 
36 #include "genC.h"
37 #include "linear.h"
38 #include "ri.h"
39 
40 #include "ri-util.h"
41 #include "effects-util.h"
42 
43 #include "misc.h"
44 #include "properties.h"
45 
46 // For effects_private_current_context_stack()
47 #include "effects-generic.h"
48 
49 #include "pipsdbm.h"
50 #include "points-to.h"
51 
52 /* Store a sorted copy of the points-to pts_to_set associated to a
53  statement s in the points-to hash-table.
54 
55  In case s is a loop, do, while or for, the parameter "store" is set
56  to false to prevent key redefinitions in the underlying points-to
57  hash-table. This entry condition is not checked.
58 
59  In case s is a sequence, the sorted copy pts_to_set is associated
60  to each substatement and shared by s and all its substatement.
61 
62  Note: the function is called with store==true from
63  points_to_whileloop(). And the hash-table can be updated
64  (hash_update()).
65 
66  */
67 void points_to_storage(set pts_to_set, statement s, bool store) {
68  list pt_list = NIL, tmp_l;
70 
71  if ( !set_empty_p(pts_to_set) && store == true ) {
72 
73  pt_list = set_to_sorted_list(pts_to_set,
74  (int(*)(const void*, const void*))
76  tmp_l = gen_full_copy_list(pt_list);
77  new_pt_list = make_points_to_list(true, tmp_l);
78  points_to_list_consistent_p(new_pt_list);
79  store_or_update_pt_to_list(s, new_pt_list);
80 
82  if(instruction_sequence_p(i)) {
85  store_or_update_pt_to_list(stm, new_pt_list);
86  }
87  }
88  }
89  else if(set_empty_p(pts_to_set)){
90  tmp_l = gen_full_copy_list(pt_list);
91  new_pt_list = make_points_to_list(true, tmp_l);
92  store_or_update_pt_to_list(s, new_pt_list);
93  }
94  gen_free_list(pt_list);
95 }
96 
97 void fi_points_to_storage(pt_map ptm, statement s, bool store) {
98  list pt_list = NIL, tmp_l;
100  set pts_to_set = points_to_graph_set(ptm);
101  bool bottom_p = points_to_graph_bottom(ptm);
102 
103  if ( !set_empty_p(pts_to_set) && store == true ) {
104 
105  pt_list = set_to_sorted_list(pts_to_set,
106  (int(*)(const void*, const void*))
108  tmp_l = gen_full_copy_list(pt_list);
109  new_pt_list = make_points_to_list(bottom_p, tmp_l);
110  points_to_list_consistent_p(new_pt_list);
111  store_or_update_pt_to_list(s, new_pt_list);
112  }
113  else if(set_empty_p(pts_to_set)){
114  tmp_l = gen_full_copy_list(pt_list);
115  new_pt_list = make_points_to_list(bottom_p, tmp_l);
116  store_or_update_pt_to_list(s, new_pt_list);
117  }
118  gen_free_list(pt_list);
119 }
120 ␌
121 /* Return the subset of "in" that is related to formal parameters and stubs
122  *
123  * More care should be taken about formal parameter
124  * modifications. Dummy initial variables should be allocated to
125  * preserve the values of formal parameters on entry.
126  */
128 {
129  pt_map out = new_pt_map();
130  set in_s = points_to_graph_set(in);
131  set out_s = points_to_graph_set(out);
132 
133  SET_FOREACH(points_to, pt, in_s) {
134  cell source = points_to_source(pt);
136  || stub_points_to_cell_p(source)) {
137  cell sink = points_to_sink(pt);
138  if(stub_points_to_cell_p(sink)) {
139  points_to npt = copy_points_to(pt);
140  add_arc_to_simple_pt_map(npt, out_s);
141  }
142  }
143  }
144 
145  return out;
146 }
147 
148 ␌
150 
152 {
153  pips_assert("points_to_context is undefined",
156 }
157 
159 {
160  pips_assert("points_to_context is defined",
162  // Deep when pt_map is a Newgen object
163  // free_pt_map(points_to_context); // Shallow if pt_map==set
165 }
166 
167 /* Instead of simply adding the new arc, make sure the consistency is
168  * not broken. If "a" is an exact arc starting from source "s_a" and
169  * pointing to destination "d_a" and if "pt" contains may arcs or an
170  * exact arc s->d, these arcs must be removed. Vice-versa, if
171  * "a=(s_a,d_a)" is a may arc and if "pt" contain an exact arc (s,d)...
172  *
173  * FI: I am cheating and doing exactly what I need to deal with global
174  * variables at call sites...
175  *
176  * FI: issue with the commented out free() below: the caller doesn't
177  * know that the object may be freed and may reuse it later, for
178  * instance to make a copy of it...
179  *
180  * Argument a is either included in pt or freed. it cannot be used
181  * after the call.
182  */
184 {
185  // Default functionality
186  // add_arc_to_pt_map(a, pt);
187 
188  cell s_a = points_to_source(a);
190  list dl = NIL; // delete list
191  list nl = NIL; // new list
192  bool found_p = false;
193  bool freed_p = false; // nl could be cleaned up instead at each free
194  set pt_s = points_to_graph_set(pt);
195 
196  SET_FOREACH(points_to, b, pt_s) {
197  cell s_b = points_to_source(b);
198  if(points_to_cell_equal_p(s_a, s_b)) {
199  cell d_a = points_to_sink(a);
200  cell d_b = points_to_sink(b);
202  found_p = true;
203  if(points_to_cell_equal_p(d_a, d_b)) {
204  if(approximation_tag(ap_a)==approximation_tag(ap_b)) {
205  /* Arc a is already in relation pt*/
206  //free_points_to(a);
207  freed_p = true;
208  }
209  else if(approximation_may_p(ap_a)) {
210  /* ap_b must be exact */
211  //free_points_to(a); // a is of no use because the context is stricter
212  freed_p = true;
213  }
214  }
215  else { /* Same source, different destinations */
216  /* We are in trouble if both arcs carry approximation exact... */
217  if(approximation_exact_p(ap_a)) {
218  if(approximation_exact_p(ap_b)) {
219  pips_internal_error("Conflicting arcs.\n"); // we are in trouble
220  }
221  else {
222  /* Arc b is less precise and mut be removed to avoid a conflict */
223  dl = CONS(POINTS_TO, b, dl);
224  }
225  }
226  else {
227  if(approximation_exact_p(ap_b)) {
228  // pips_internal_error("Conflicting arcs.\n"); // we are in trouble
229  // But the may arc is included in the exact arc already in pt
230  //free_points_to(a);
231  freed_p = true;
232  }
233  else {
234  /* Two may arcs: they are compatible but this may be
235  invalidated later by another arc in pt, for isntance
236  making a redundant. */
237  nl = CONS(POINTS_TO, a, nl);
238  }
239  }
240  }
241  }
242  else {
243  /* The sources are different */
244  ; // ignore this arc from pt
245  }
246  }
247 
248  if(found_p) {
249  FOREACH(POINTS_TO, d, dl)
250  remove_arc_from_pt_map(d, pt);
251 
252  // 0 or 1 element, which must be "a", which may have been freed
253  // after insertion in nl
254  FOREACH(POINTS_TO, n, nl)
255  if(!freed_p)
256  add_arc_to_pt_map(n, pt);
257  }
258  else
259  add_arc_to_pt_map(a, pt);
260 
261  return pt;
262 }
263 
264 /* FI: it should rather work the other way round, with
265  * add_arc_to_statement_points_to_context() calling
266  * add_arc_to_points_to_context().
267  */
269 {
270  pips_assert("points_to_context is defined",
272  //(void) update_points_to_graph_with_arc(pt, points_to_context);
274  pips_assert("in is consistent", consistent_pt_map_p(points_to_context));
275  points_to npt = copy_points_to(pt);
277 }
278 
279 /* Same as , but be careful about the arc before adding it to the
280  * points-to context.
281  *
282  * This function is used to update the contexts when dealing with
283  * global variables at a call site.
284  */
286 {
287  pips_assert("points_to_context is defined",
289  // Copy "pt" before it may be freed by update_points_to_graph_with_arc()
290  points_to npt = copy_points_to(pt);
292  //add_arc_to_pt_map(pt, points_to_context);
293  pips_assert("in is consistent", consistent_pt_map_p(points_to_context));
294  //add_arc_to_statement_points_to_context(npt);
296 }
297 
299 {
300  return points_to_context;
301 }
302 ␌
304 {
306  list dl = code_declarations(c);
307  list sl = NIL;
308 
309  FOREACH(ENTITY, v, dl) {
311  sl = CONS(ENTITY, v, sl);
312  fprintf(stderr, "Removed stub: \"%s\"\n", entity_name(v));
313  }
314  }
315 
316  /* Beware of location entities that might depend on the soon to be
317  * deleted stub entities.
318  */
319  if(!ENDP(dl) && get_bool_property("SEMANTICS_ANALYZE_CONSTANT_PATH")) {
320  FOREACH(ENTITY, v, dl) {
322  value val = entity_initial(v);
323  reference r = value_reference(val); // guarded by location_entity_p()
324  entity rv = reference_variable(r);
325  if(gen_in_list_p(rv, dl)) {
326  sl = CONS(ENTITY, v, sl);
327  fprintf(stderr, "Removed location: \"%s\"\n", entity_name(v));
328  }
329  }
330  }
331  }
332 
334 
335  GenericCleanEntities(sl, module, false);
336 
337  gen_free_list(sl);
338 }
339 ␌
340 #define FRANCOIS 1
341 
342 /* Pass INTRAPROCEDURAL_POINTS_TO_ANALYSIS
343  *
344  */
346  entity module;
347  statement module_stat;
348  pt_map pt_in = new_pt_map();
349  pt_map pts_to_out = new_pt_map();
350 
351  init_pt_to_list();
356  module_name, true));
357  module_stat = get_current_module_statement();
359 
360  debug_on("POINTS_TO_DEBUG_LEVEL");
361 
362  pips_debug(1, "considering module %s\n", module_name);
363 
364  /* In case we need effects to generate all necessary points-to information */
365  // These initializations are not sufficient. We also need at least a
366  // stack of statements
367  //set_constant_paths_p(true);
368  //set_pointer_info_kind(with_points_to);
369  //set_methods_for_proper_simple_effects();
370 
371  /* Clean-up formal context stubs and heap model variables */
373 
374  /* Stack for on-demand update of in points-to information */
376 
377  /*
378  Get the init_points_to_list resource.
379  This list contains formal paramters and their stub sinks
380  */
381  // #if !FRANCOIS: to simplify interface with effects_with_points_to
382  // FI: I would like not to use DBR_INIT_POINTS_TO_LIST because it
383  // generates useless information. However I need something as long
384  // as the empty points-to set is the attribute of dead code...
385  // Also, the init analysis uses the same modules but with another
386  // interface, which muddles the generation of stub cells with stars
387  // or zeros
388 #if 0
389  list pts_to_list = NIL;
390  points_to_list init_pts_to_list =
391  (points_to_list) db_get_memory_resource(DBR_INIT_POINTS_TO_LIST,
392  module_name, true);
393  /* Transform the list of init_pts_to_list in set of points-to.*/
394  pts_to_list = gen_full_copy_list(points_to_list_list(init_pts_to_list));
395  pt_in = graph_assign_list(pt_in, pts_to_list);
396  init_points_to_context(pt_in);
397  // FI: this should be useless as stubs are built on demand
398  // pt_in = set_assign_list(pt_in, NIL);
399  gen_free_list(pts_to_list);
400 #else
401  points_to_graph_set(pt_in) =
403  init_points_to_context(pt_in);
404 #endif
405 
406  /* Necessary to compute memory effects
407  *
408  * Memory effects may be computed to avoid issues with side effects
409  * Three possible options: 1) a new expression_to_points_to() that
410  * does not take side effects into account, 2) an extension of
411  * condition_to_points_to() to take care of dereferencing as in
412  * expression_to_points_to(), or use memory effects to deal with
413  * side effect free expressions only.
414  */
415  // set_methods_for_simple_effects();
416 
417  pts_to_out = statement_to_points_to(module_stat, pt_in);
418  /* Store the points-to relations */
420 
421  /* Remove dangling stubs... before the formal parameters are
422  projected as the projection will create lots of dangling
423  stubs. In fact, they are not dangling from a formal context view
424  point. */
425  // pts_to_out = remove_unreachable_vertices_in_points_to_graph(pts_to_out);
426  /* Filter OUT points-to by deleting local variables, including the
427  formal paprameters */
429  /* FI: you would have to be much more specific about was is kept
430  or not when the main function is exited... I am not sure it is
431  a good idea. Potentially useful information about argv is
432  lost. As well as useless information about memory leaks
433  occuring at the end of the execution. Motsly an issue for
434  validation. */
435  clear_pt_map(pts_to_out);
436  }
437  else
438  points_to_graph_set(pts_to_out) =
440 
441  /* Save IN points-to relations */
442 #if !FRANCOIS
443  list l_in = set_to_list(pt_in);
444  points_to_list in_list = make_points_to_list(true, l_in); // SG: baaaaaaad copy, let us hope AM will fix her code :p
445 #else
446  // pt_map context = points_to_to_context_points_to(pts_to_out);
448  // FI: not useful here, should be performed earlier I guess
449  // context = normalize_points_to_graph(context);
451  points_to_list in_list = make_points_to_list(false, l_in); // SG: baaaaaaad copy, let us hope AM will fix her code :p
452  // FI: I suppose context should be emptied because of the sharing
453  // with l_in and then freed
454 #endif
455  DB_PUT_MEMORY_RESOURCE(DBR_POINTS_TO_IN, module_name, in_list);
456 
457  /* Save OUT points-to relations */
458  list l_out =
460  bool out_bottom_p = points_to_graph_bottom(pts_to_out);
461  points_to_list out_list = make_points_to_list(out_bottom_p, l_out); // SG: baaaaaaad copy, let us hope AM will fix her code :p
462 
463  DB_PUT_MEMORY_RESOURCE(DBR_POINTS_TO_OUT, module_name, out_list);
464 
468  // FI: the depth of the free depends on pt_map
469  // free_pt_map(pts_to_out);
470  // free_pt_map(pt_in);
475  //generic_effects_reset_all_methods();
476  debug_off();
477  bool good_result_p = true;
478 
479  return (good_result_p);
480 }
481 
482 
484 {
485  entity module;
486  type t;
487  list pt_list = NIL, dl = NIL;
488  set pts_to_set = set_generic_make(set_private,
490  set formal_set = set_generic_make(set_private,
494 
495  t = entity_type(module);
496 
497  debug_on("POINTS_TO_DEBUG_LEVEL");
498 
499  pips_debug(1, "considering module \"%s\"\n", module_name);
500 
501  /* Properties */
502  if(get_bool_property("ALIASING_ACROSS_FORMAL_PARAMETERS"))
503  pips_user_warning("Property ALIASING_ACROSS_FORMAL_PARAMETERS"
504  " is ignored\n");
505  if(get_bool_property("ALIASING_ACROSS_TYPES"))
506  pips_user_warning("Property ALIASING_ACROSS_TYPES"
507  " is ignored\n");
508  if(get_bool_property("ALIASING_INSIDE_DATA_STRUCTURE"))
509  pips_user_warning("Property ALIASING_INSIDE_DATA_STRUCTURE"
510  " is ignored\n");
511 
512  if(type_functional_p(t)){
514 
515  FOREACH(ENTITY, fp, dl) {
516  if(formal_parameter_p(fp)) {
517  reference r = make_reference(fp, NIL);
518  cell c = make_cell_reference(r);
519  formal_set = formal_points_to_parameter(c);
520  pts_to_set = set_union(pts_to_set, pts_to_set,
521  formal_set);
522  }
523  }
524 
525  }
526  else
527  pips_user_error("The module %s is not a function.\n", module_name);
528 
529  pt_list = set_to_sorted_list(pts_to_set,
530  (int(*)
531  (const void*,const void*))
533  points_to_list init_pts_to_list = make_points_to_list(false, pt_list);
534  points_to_list_consistent_p(init_pts_to_list);
536  (DBR_INIT_POINTS_TO_LIST, module_name, init_pts_to_list);
538  set_clear(pts_to_set);
539  set_clear(pts_to_set);
540  set_free(pts_to_set);
541  set_free(formal_set);
542  debug_off();
543 
544  bool good_result_p = true;
545  return (good_result_p);
546 }
547 
548 static bool interprocedural_points_to_p = true;
551 {
553 }
554 
556 {
558 }
559 
561 {
565 }
566 
568 {
572 }
573 
575 {
579 }
580 
581 /* Retrieve points-to that are statically initialized, especially in compilation units */
582 bool initial_points_to(char * name)
583 {
586 
587  debug_on("POINTS_TO_DEBUG_LEVEL");
588 
589  /* At least, useful for debugging */
591  //set_current_module_statement( (statement)
592  // db_get_memory_resource(DBR_CODE, name, true));
593 
594  if(compilation_unit_p(name)) {
595  points_to_list ptl_out =
596  (points_to_list) db_get_memory_resource(DBR_POINTS_TO_OUT, name, true);
597  ptl_init = copy_points_to_list(ptl_out);
598  }
599  else {
600  /* Could we retrieve initializations of static variables? */
601  ptl_init = make_points_to_list(true, NIL);
602  }
603 
604  DB_PUT_MEMORY_RESOURCE(DBR_INITIAL_POINTS_TO, strdup(name), (char*) ptl_init);
605 
607  //reset_current_module_statement();
608 
609  debug_off();
610  return true;
611 }
612 
613 bool program_points_to(char * name)
614 {
615  //transformer t = transformer_identity();
617  int i, nmodules;
618  gen_array_t modules;
619  // list e_inter = NIL;
620  list pptl = NIL; // Program points-to list
621 
622  pips_assert("main was found", the_main!=entity_undefined);
623 
624  debug_on("POINTS_TO_DEBUG_LEVEL");
625  pips_debug(1, "considering program \"%s\" with main \"%s\"\n", name,
626  module_local_name(the_main));
627 
628  set_current_module_entity(the_main);
630  db_get_memory_resource(DBR_CODE,
631  module_local_name(the_main),
632  true));
633  modules = db_get_module_list();
634  nmodules = gen_array_nitems(modules);
635  pips_assert("some modules in the program", nmodules>0);
636 
637  for(i=0; i<nmodules; i++) {
638  string mname = gen_array_item(modules, i);
639  pips_debug(1, "considering module %s\n", mname);
640 
641  // Module initial points-to list
642  points_to_list mptl =
644  db_get_memory_resource(DBR_INITIAL_POINTS_TO, mname, true));
645  if(!points_to_list_bottom(mptl)) {
646  // FI: a bit simplistic if C standard allows double definitions...
647  pptl = gen_nconc(pptl, points_to_list_list(mptl));
648  }
649  }
650 
651  points_to_list program_ptl = make_points_to_list(false, pptl);
652  DB_PUT_MEMORY_RESOURCE(DBR_PROGRAM_POINTS_TO, "", (void *) program_ptl);
653 
656 
657  gen_array_full_free(modules);
658 
659  debug_off();
660  return true;
661 }
cell make_cell_reference(reference _field_)
Definition: effects.c:293
points_to_list make_points_to_list(bool a1, list a2)
bool points_to_list_consistent_p(points_to_list p)
points_to copy_points_to(points_to p)
POINTS_TO.
points_to_list copy_points_to_list(points_to_list p)
POINTS_TO_LIST.
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
bool entity_heap_location_p(entity b)
package abstract location.
#define remove_arc_from_pt_map(a, s)
#define add_arc_to_pt_map(a, s)
#define add_arc_to_simple_pt_map(a, s)
#define pt_map_undefined
#define pt_map_undefined_p(pt)
#define consistent_pt_map_p(s)
#define clear_pt_map(pt)
#define new_pt_map()
static FILE * out
Definition: alias_check.c:128
bool stub_entity_of_module_p(entity s, entity m)
size_t gen_array_nitems(const gen_array_t a)
Definition: array.c:131
void gen_array_full_free(gen_array_t a)
Definition: array.c:77
void * gen_array_item(const gen_array_t a, size_t i)
Definition: array.c:143
void GenericCleanEntities(list el, entity function, bool fortran_p)
Useful when the user edit a source file and parse it again or when a program transformation is perfor...
Definition: clean.c:63
void make_effects_private_current_context_stack(void)
void reset_effects_private_current_context_stack(void)
bool formal_parameter_points_to_cell_p(cell)
Definition: points_to.c:99
bool location_entity_of_module_p(entity, entity)
Definition: locations.c:360
bool points_to_cell_equal_p(cell, cell)
Definition: points_to.c:916
void store_or_update_pt_to_list(statement, points_to_list)
void init_pt_to_list(void)
void reset_pt_to_list(void)
statement_points_to get_pt_to_list(void)
int points_to_compare_cells(const void *, const void *)
Comparison of two points-to arcs based on their source and sink nodes.
Definition: prettyprint.c:295
bool stub_points_to_cell_p(cell)
Definition: points_to.c:108
#define approximation_tag(x)
Definition: effects.h:362
#define approximation_exact_p(x)
Definition: effects.h:369
#define approximation_may_p(x)
Definition: effects.h:363
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
Definition: entity_names.c:56
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
Definition: list.c:963
#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
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
Definition: list.c:734
#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
list gen_full_copy_list(list l)
Copy a list structure with element copy.
Definition: list.c:535
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
gen_array_t db_get_module_list(void)
Get an array of all the modules (functions, procedures and compilation units) of a workspace.
Definition: database.c:1266
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
#define debug_on(env)
Definition: misc-local.h:157
#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_user_warning
Definition: misc-local.h:146
#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 debug_off()
Definition: misc-local.h:160
#define pips_user_error
Definition: misc-local.h:147
set set_generic_make(set_type, hash_equals_t, hash_rank_t)
what about this replacement? #define SET_MAP(the_item, the_code, the_set) \ { SET_FOREACH(void *,...
Definition: set.c:83
bool set_empty_p(const set)
tell whether set s is empty.
Definition: set.c:367
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
Definition: set.c:474
list set_to_list(const set)
create a list from a set the set is not freed
Definition: set.c:436
list set_to_sorted_list(const set, gen_cmp_func_t)
Definition: set.c:447
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
Definition: newgen_set.h:78
void set_free(set)
Definition: set.c:332
set set_clear(set)
Assign the empty set to s s := {}.
Definition: set.c:326
set set_union(set, const set, const set)
Definition: set.c:211
@ set_private
Definition: newgen_set.h:45
void points_to_storage(set pts_to_set, statement s, bool store)
Store a sorted copy of the points-to pts_to_set associated to a statement s in the points-to hash-tab...
Definition: passes.c:67
bool init_points_to_analysis(char *module_name)
Definition: passes.c:483
void add_arc_to_points_to_context(points_to pt)
FI: it should rather work the other way round, with add_arc_to_statement_points_to_context() calling ...
Definition: passes.c:268
pt_map update_points_to_graph_with_arc(points_to a, pt_map pt)
Instead of simply adding the new arc, make sure the consistency is not broken.
Definition: passes.c:183
bool initial_points_to(char *name)
Retrieve points-to that are statically initialized, especially in compilation units.
Definition: passes.c:582
static bool fast_interprocedural_points_to_p
Definition: passes.c:549
static bool generic_points_to_analysis(char *module_name)
Pass INTRAPROCEDURAL_POINTS_TO_ANALYSIS.
Definition: passes.c:345
bool interprocedural_points_to_analysis_p()
Definition: passes.c:550
void init_points_to_context(pt_map init)
Definition: passes.c:151
void clean_up_points_to_stubs(entity module)
Definition: passes.c:303
bool intraprocedural_points_to_analysis(char *module_name)
Definition: passes.c:560
pt_map get_points_to_context()
Definition: passes.c:298
void reset_points_to_context()
Definition: passes.c:158
bool fast_interprocedural_points_to_analysis(char *module_name)
Definition: passes.c:574
bool program_points_to(char *name)
Definition: passes.c:613
void update_points_to_context_with_arc(points_to pt)
Same as , but be careful about the arc before adding it to the points-to context.
Definition: passes.c:285
pt_map points_to_to_context_points_to(pt_map in)
Return the subset of "in" that is related to formal parameters and stubs.
Definition: passes.c:127
void fi_points_to_storage(pt_map ptm, statement s, bool store)
Definition: passes.c:97
static pt_map points_to_context
Definition: passes.c:149
bool interprocedural_points_to_analysis(char *module_name)
Definition: passes.c:567
bool fast_interprocedural_points_to_analysis_p()
Definition: passes.c:555
static bool interprocedural_points_to_p
Definition: passes.c:548
static char * module
Definition: pips.c:74
string get_main_entity_name(void)
Return the local name of the main module if it is available, or the local name of any module by defau...
Definition: util.c:63
void add_arc_to_statement_points_to_context(points_to)
Definition: statement.c:104
set formal_points_to_parameter(cell)
We want a recursive descent on the type of the formal parameter, once we found a pointer type we begu...
void reset_statement_points_to_context(void)
Definition: statement.c:139
_uint points_to_rank(const void *, size_t)
create a key which is a concatenation of the source's name, the sink's name and the approximation of ...
void update_statement_points_to_context_with_arc(points_to)
Definition: statement.c:112
pt_map graph_assign_list(pt_map, list)
FI: I add functions dealing with points_to_graph variable, i.e.
void init_statement_points_to_context(void)
Definition: statement.c:90
pt_map full_copy_pt_map(pt_map)
Definition: statement.c:67
pt_map statement_to_points_to(statement, pt_map)
See points_to_statement()
Definition: statement.c:154
int points_to_equal_p(const void *, const void *)
returns true if two points-to arcs "vpt1" and "vpt2" are equal.
Definition: points_to_set.c:98
set points_to_function_projection(set)
"pts" is the points-to relation existing at the return point of a function.
#define points_to_approximation(x)
#define points_to_list_undefined
#define points_to_sink(x)
#define points_to_list_list(x)
#define points_to_graph_bottom(x)
#define POINTS_TO(x)
POINTS_TO.
#define points_to_list_bottom(x)
struct _newgen_struct_points_to_list_ * points_to_list
#define points_to_graph_set(x)
#define points_to_source(x)
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
bool entity_main_module_p(entity e)
Definition: entity.c:700
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
bool formal_parameter_p(entity)
Definition: variable.c:1489
void free_statement_global_stack(void)
Definition: static.c:358
void make_statement_global_stack(void)
Definition: static.c:318
#define type_functional_p(x)
Definition: ri.h:2950
#define instruction_sequence_p(x)
Definition: ri.h:1512
#define value_reference(x)
Definition: ri.h:3085
#define reference_variable(x)
Definition: ri.h:2326
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define code_declarations(x)
Definition: ri.h:784
#define entity_undefined
Definition: ri.h:2761
#define entity_name(x)
Definition: ri.h:2790
#define sequence_statements(x)
Definition: ri.h:2360
#define value_code(x)
Definition: ri.h:3067
#define instruction_sequence(x)
Definition: ri.h:1514
#define statement_instruction(x)
Definition: ri.h:2458
#define entity_type(x)
Definition: ri.h:2792
#define entity_initial(x)
Definition: ri.h:2796
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: delay.c:253