PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "ri-util.h"
#include "effects-util.h"
#include "constants.h"
#include "misc.h"
#include "properties.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "newgen_set.h"
#include "points_to_private.h"
#include "points-to.h"
Go to the source code of this file.
Functions | |
list | variable_to_pointer_locations (entity e) |
When the declaration of "e" does not contain an initial value, find all allocated pointers in entity e. More... | |
list | struct_variable_to_pointer_locations (entity e, entity ee) |
return list of cells for pointers declared directly or indirecltly in variable "e" of type struct defined by entity "ee" and its type. More... | |
list | struct_variable_to_pointer_subscripts (cell c, entity f) |
returns a list of cells to reach pointers depending on field f. More... | |
return list of cells for pointers declared directly or indirecltly in variable "e" of type struct defined by entity "ee" and its type.
Typedefs have already been taken care of by the caller (?).
Signature with e and ee inherited from Amira Mensi.
Find pointers downwards and build a list of cells.
ee | e |
Definition at line 115 of file variable.c.
References array_entity_p(), array_of_pointers_type_p(), array_of_struct_type_p(), array_type_p(), CELL, CONS, ENTITY, entity_to_expression(), entity_type, EXPRESSION, f(), FOREACH, free_cell(), gen_full_copy_list(), gen_full_free_list(), gen_nconc(), make_cell_reference(), make_reference(), make_unbounded_expression(), NIL, pips_assert, pointer_type_p(), struct_type_p(), struct_variable_to_pointer_subscripts(), type_struct, type_struct_p, ultimate_type(), and variable_entity_dimension().
Referenced by variable_to_pointer_locations().
returns a list of cells to reach pointers depending on field f.
Cell c is the current prefix.
In case we are dealing with an array of structs, add subscript expressions in mc, a modified copy of parameter c
Take care of each field in the structure.
copy cell c and add a subscript for f
copy cell c and add a subscript for f
Definition at line 183 of file variable.c.
References array_entity_p(), array_of_pointers_type_p(), array_of_struct_type_p(), basic_derived, CELL, cell_any_reference(), CONS, copy_cell(), ENTITY, entity_to_expression(), entity_type, EXPRESSION, f(), FOREACH, free_cell(), gen_nconc(), make_unbounded_expression(), NIL, pips_assert, pointer_type_p(), reference_indices, struct_type_p(), struct_variable_to_pointer_subscripts(), type_struct, type_variable, ultimate_type(), and variable_basic.
Referenced by struct_variable_to_pointer_locations(), and struct_variable_to_pointer_subscripts().
When the declaration of "e" does not contain an initial value, find all allocated pointers in entity e.
variable.c
We distinguish between scalar pointers, array of pointers and struct containing pointers and struct. Return a list of cells each containing a reference to aa pointer. These cells are used later as sources to build a points-to data structure pointing to nowhere/undefined.
M: missing recursive descent on variable_dimensions. int a[*(q=p)]
variable v = type_variable(t);
int d = (int) gen_length(variable_dimensions(v));
list sl = NIL;
int i;
for(i=0;i<d;i++) {
expression ind = make_unbounded_expression();
sl = CONS(EXPRESSION, ind, sl);
}
reference r = make_reference(e, sl);
Definition at line 66 of file variable.c.
References array_of_pointers_type_p(), array_of_struct_type_p(), basic_derived, CELL, CONS, entity_array_p(), entity_basic_concrete_type(), entity_variable_p, make_cell_reference(), make_reference(), NIL, pointer_type_p(), points_to_cell_add_unbounded_subscripts(), struct_type_p(), struct_variable_to_pointer_locations(), type_variable, and variable_basic.
Referenced by declaration_statement_to_points_to(), malloc_to_points_to_sinks(), and struct_initialization_to_points_to().