34 #include "pips_config.h"
58 #define INITIAL_SET_SIZE 10
63 null_1 = (*pe1==(
entity)NULL),
64 null_2 = (*pe2==(
entity)NULL);
67 return(null_2-null_1);
121 bool cmp = cmp1 && cmp2 && cmp3;
435 bool found_p =
false;
571 (void)
fprintf(stderr,
"POINTS_TO UNDEFINED\n");
574 (
void)
fprintf(stderr,
"Arg. \"pt\"is not a points_to.\n");
617 fprintf(stderr,
"points-to set %s:\n", what);
619 fprintf(stderr,
"undefined set\n");
621 fprintf(stderr,
"uninitialized set\n");
623 fprintf(stderr,
"empty set\n");
840 fprintf(stderr,
"p is empty.\n");
862 bool compatible_p =
false;
887 pips_debug(8,
"Cell of type \"%s\" is %s included in cell of type \"%s\"\n",
889 compatible_p?
"":
"not",
911 bool compatible_p =
false;
936 pips_debug(8,
"Cell of type \"%s\" is %s included in cell of type \"%s\"\n",
939 compatible_p?
"":
"not");
977 pips_debug(8,
"Could not find %d nodes of type \"%s\" in path \"", k,
987 bool in_path_p =
false;
1180 bool null_initialization_p =
1192 if(null_initialization_p) {
1226 bool array_p =
true;
1249 fprintf(stderr,
"Type of source: \"");
1277 if(
true || !
ENDP(slrsc)) {
1280 list cslrsc = slrsc;
1281 list cslrec = slrec;
1282 list cslrfc = slrfc;
1284 for( ; !
ENDP(cslrsc) && !
ENDP(cslrec) && !
ENDP(cslrfc);
1285 POP(cslrsc),
POP(cslrec),
POP(cslrfc)) {
1321 bool null_initialization_p =
1323 if(null_initialization_p) {
1332 bool uninitialized_dereferencing_p =
1335 if(uninitialized_dereferencing_p) {
1349 bool null_dereferencing_p =
1352 if(null_dereferencing_p) {
1384 bool null_initialization_p =
1423 if(null_initialization_p) {
1430 if(null_initialization_p){
1440 bool null_initialization_p =
1480 "because the \"const\" qualifier is not used.\n",
1488 if(null_initialization_p) {
1495 if(null_initialization_p){
1555 list csl = sl, co_sl = o_sl;
1556 bool compatible_p =
true;
1557 while(!
ENDP(csl) && !
ENDP(co_sl)) {
1569 compatible_p =
false;
1574 if(compatible_p &&
ENDP(csl) &&
ENDP(co_sl)
1583 else if(compatible_p) {
1590 int np = nd_sl-no_sl;
1595 pips_assert(
"the suffix and the body have positive length",
1602 for(i=0; i<np; i++) {
1613 POP(csl), np++, nb--;
1615 for(i=0;i<nb; i++) {
1687 pips_assert(
"fresh_p must be set to true", fresh_p);
1744 return translations;
1767 if(
ENDP(translations)) {
1794 return translations;
1833 bool exact_p =
false;
1853 if(
ENDP(sinks) || (all_p && !exact_p)) {
1876 if((
ENDP(sinks) && !strict_p) || all_p) {
2016 if(strcmp(sn, cn)==0) {
2034 if(strcmp(sn, cn)==0) {
2134 bool match_p =
false;
2141 else if(
ENDP(source_sl)) {
2145 int n_us_in_source =
2152 if(n_us_in_sink >= n_us_in_source) {
2245 pips_user_warning(
"Typing error in a pointer assignment or a dereferencing with \"%s\" at line %d.\n",
2343 "Sink missing for a source based on \"%s\".\n"
2344 "Update points-to property POINTS_TO_UNINITIALIZED_POINTER_DEREFERENCING and/or POINTS_TO_UNINITIALIZED_NULL_DEREFERENCING according to needs.\n",
2362 bool null_dereferencing_p
2364 bool nowhere_dereferencing_p
2374 if(
ENDP(starpointed)) {
2580 Possible_set =
set_add_element(Possible_set, Possible_set,(
void*) pt);
2585 Merge_set =
set_union(Merge_set, Possible_set, Definite_set);
2677 i = i2>i1? 1 : (i2<i1? -1 : 0);
2679 for(;i==0 && !
ENDP(sl1);
POP(sl1),
POP(sl2)){
2685 i = i2>i1? 1 : (i2<i1? -1 : 0);
2694 return (i== 0 ?
true:
false) ;
2720 i = i2>i1? 1 : (i2<i1? -1 : 0);
2722 for(;i==0 && !
ENDP(sl1);
POP(sl1),
POP(sl2)){
2728 i = i2>i1? 1 : (i2<i1? -1 : 0);
2777 i = i2>i1? 1 : (i2<i1? -1 : 0);
2785 i = i2>i1? 1 : (i2<i1? -1 : 0);
2787 for(;i==0 && !
ENDP(sl1);
POP(sl1),
POP(sl2)){
2793 i = i2>i1? 1 : (i2<i1? -1 : 0);
2795 for(;i==0 && !
ENDP(sli1);
POP(sli1),
POP(sli2)){
2801 i = i2>i1? 1 : (i2<i1? -1 : 0);
2824 bool consistent_p =
true;
2829 if(constant_subscript_p) {
2861 if(constant_subscript_p) {
2885 return consistent_p;
2902 bool consistent_p =
true;
2921 "Contradictory points-to arcs: incompatible approximation\n");
2924 consistent_p =
false;
2941 fprintf(stderr,
"Redundant points-to arc:\n");
2943 consistent_p =
false;
2946 fprintf(stderr,
"Contradictory points-to arcs: incompatible approximation\n");
2949 consistent_p =
false;
2961 fprintf(stderr,
"Points-to %p ", pt);
2963 fprintf(stderr,
" is in set s but does not belong to it!\n");
2964 consistent_p =
false;
2973 fprintf(stderr,
"Sharing detected\n");
2975 return consistent_p;
2980 bool sharing_p =
false;
2988 bool found_p =
false;
2992 if(found_p && pt1!=pt2) {
2998 bool new_sharing_p =
false;
3001 if(source_1==source_2) {
3002 new_sharing_p =
true;
3003 fprintf(stderr,
"Sharing between source_1 and source_2.\n");
3005 else if(source_1==sink_2) {
3006 new_sharing_p =
true;
3007 fprintf(stderr,
"Sharing between source_1 and sink_2.\n");
3009 else if(sink_1==source_2) {
3010 new_sharing_p =
true;
3011 fprintf(stderr,
"Sharing between sink_1 and source_2.\n");
3013 else if(sink_1==sink_2) {
3014 new_sharing_p =
true;
3015 fprintf(stderr,
"Sharing between sink_1 and sink_2.\n");
3018 if(!new_sharing_p) {
3020 if(source_r1==source_r2) {
3021 new_sharing_p =
true;
3022 fprintf(stderr,
"Sharing between source_r1 and source_r2.\n");
3024 else if(source_r1==sink_r2) {
3025 new_sharing_p =
true;
3026 fprintf(stderr,
"Sharing between source_r1 and sink_r2.\n");
3028 else if(sink_r1==source_r2) {
3029 new_sharing_p =
true;
3030 fprintf(stderr,
"Sharing between sink_r1 and source_r2.\n");
3032 else if(sink_r1==sink_r2) {
3033 new_sharing_p =
true;
3034 fprintf(stderr,
"Sharing between sink_r1 and sinke_r2.\n");
3040 fprintf(stderr,
"\nand pt2 ");
3043 sharing_p = sharing_p || new_sharing_p;
3162 s = va_arg(args,
pt_map);
3175 pips_debug(1,
"Impossible initialization of a bottom graph\n");
3301 (
long long int)
hash_get(cell_out_degree, (
void *) name);
3304 hash_put(cell_out_degree, (
void *) name, (
void *) i);
3308 hash_update(cell_out_degree, (
void *) name, (
void *) i);
3312 long long int m = 0;
3314 if((
long long int) v > m) {
3315 m = (
long long int) v;
3316 *mod_cell =
strdup((
string) k);
3318 }, cell_out_degree);
3340 if(odl<2*sl+1+2) odl = 2*sl+1+2+1;
3347 pips_debug(1,
"Normalization takes place for graph \"ptg\" with \"od\"=%d and \"odl\"=%d:\n", od, odl);
3359 pips_debug(1,
"After normalization, \"ptg\":\n");
3376 bool unreachable_p =
true;
3393 unreachable_p =
false;
3398 return unreachable_p;
3419 pips_assert(
"pts is consistent before unreachable arc removal",
3449 pips_assert(
"pts is consistent after unreachable arc removal",
3487 return consistent_p;
3508 "does not appear in the points-to graph.\n");
3540 pips_debug(7,
"\n print_points_to_graph \n");
int get_int_property(const string)
cell make_cell_reference(reference _field_)
approximation make_approximation_exact(void)
approximation copy_approximation(approximation p)
APPROXIMATION.
approximation make_approximation_may(void)
descriptor make_descriptor_none(void)
cell copy_cell(cell p)
CELL.
void free_approximation(approximation p)
points_to make_points_to(cell a1, cell a2, approximation a3, descriptor a4)
void free_points_to(points_to p)
points_to copy_points_to(points_to p)
POINTS_TO.
bool points_to_consistent_p(points_to p)
void free_points_to_graph(points_to_graph p)
points_to_graph make_points_to_graph(bool a1, set a2)
type make_type_variable(variable _field_)
type copy_type(type p)
TYPE.
basic copy_basic(basic p)
BASIC.
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
variable make_variable(basic a1, list a2, list a3)
void free_expression(expression p)
reference copy_reference(reference p)
REFERENCE.
struct _newgen_struct_entity_ * entity
bool entity_heap_location_p(entity b)
package abstract location.
#define remove_arc_from_pt_map(a, s)
#define pt_map_undefined_p(pt)
#define consistent_pt_map_p(s)
bool entity_abstract_location_p(entity al)
bool entity_stub_sink_p(entity e)
test if an entity is a stub sink for a formal parameter e.g.
bool cell_typed_anywhere_locations_p(cell c)
test if a cell is the bottom of the lattice
bool entity_typed_anywhere_locations_p(entity e)
Test if an entity is the bottom of the lattice.
entity entity_anywhere_locations()
cell make_anywhere_cell(type t)
void const char const char const int
cell make_nowhere_cell()
This file contains all the operators defining constant paths :
cell make_typed_nowhere_cell(type t)
type cell_to_type(cell, bool *)
bool cell_equal_p(cell, cell)
CELLS.
type points_to_reference_to_concrete_type(reference)
cell make_anywhere_points_to_cell(type)
Function storing points to information attached to a statement.
bool cell_equivalent_p(cell, cell)
Check that memory locations denoted by cell "c1" can be reached by knowing cell "c2" and by using poi...
type points_to_cell_to_type(cell, bool *)
FI: I need more generality than is offered by cell_to_type()
cell points_to_cells_minimal_upper_bound(list)
reference cell_any_reference(cell)
API for reference.
cell points_to_cell_add_field_dimension(cell, entity)
Functions about points-to cells - There is no cell.c file.
void points_to_cell_add_unbounded_subscripts(cell)
string approximation_to_string(approximation)
type points_to_cell_to_concrete_type(cell)
bool points_to_cell_equal_p(cell, cell)
bool related_points_to_cells_p(cell, cell)
points_to_list load_pt_to_list(statement)
cell make_null_pointer_value_cell(void)
bool memory_dereferencing_p(reference)
Does the set of locations referenced by r depend on a pointer dereferencing?
reference cell_to_reference(cell)
FI: probably to be moved elsewhere in ri-util.
bool cell_included_p(cell, cell)
Check that all memory locations denoted by cell "c1" are included in cell "c2".
bool anywhere_cell_p(cell)
Is it an anywhere cell?
bool all_heap_locations_cell_p(cell)
bool generic_atomic_points_to_cell_p(cell, bool)
Is it a unique concrete memory location?
bool nowhere_cell_p(cell)
Target of an undefined pointer.
bool points_to_cell_in_list_p(cell, list)
bool atomic_points_to_cell_p(cell)
Is it a unique concrete memory location?
bool cell_abstract_location_p(cell)
string effect_reference_to_string(reference)
bool null_pointer_value_cell_p(cell)
void points_to_cell_add_zero_subscripts(cell)
bool heap_cell_p(cell)
Any heap cell, more or less abstract or typed.
bool store_independent_points_to_reference_p(reference)
Functions for points-to references, the kind of references used in points-to cells.
#define cell_undefined_p(x)
#define approximation_tag(x)
#define approximation_exact_p(x)
#define approximation_must_p(x)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
entity get_current_module_entity(void)
Get the entity of the current module.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
list gen_last(list l)
Return the last element of a list.
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
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...
list gen_full_copy_list(list l)
Copy a list structure with element copy.
bool statement_unstructured_p(statement)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
_uint hash_string_rank(const void *, size_t)
en s'inspirant vaguement de Fast Hashing of Variable-Length Text Strings Peter K.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define MODULE_SEP_STRING
const char * entity_minimal_user_name(entity e)
Do not preserve scope information.
string bool_to_string(bool)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_MAP(k, v, code, ht)
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
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 *,...
bool set_empty_p(const set)
tell whether set s is empty.
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
set set_del_element(set, const set, const void *)
set set_intersection(set, const set, const set)
#define SET_MAP(element, code, the_set)
set set_assign(set, const set)
Assign a set with the content of another set.
int set_size(const set)
returns the number of items in s.
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
set set_clear(set)
Assign the empty set to s s := {}.
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
#define set_undefined_p(s)
set set_add_element(set, const set, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
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 ...
pt_map memory_leak_to_more_memory_leaks(cell l, pt_map in)
Cell "l" has been memory leaked for sure and is not referenced any more in "in".
list expression_to_points_to_sinks(expression, pt_map)
The returned list contains cells used in "in".
points_to create_stub_points_to(cell, type, bool)
int points_to_context_statement_line_number(void)
#define points_to_approximation(x)
#define points_to_undefined_p(x)
#define points_to_undefined
#define points_to_sink(x)
#define points_to_domain_number(x)
#define points_to_graph_undefined
#define points_to_list_list(x)
struct _newgen_struct_points_to_ * points_to
#define points_to_graph_bottom(x)
#define POINTS_TO(x)
POINTS_TO.
#define points_to_list_bottom(x)
#define points_to_graph_set(x)
#define points_to_source(x)
set add_subscript_dependent_arc_to_simple_pt_map(points_to a, set s)
The source and destination references imply no dereferencing but the subscripts may be any kind of ex...
entity location_entity(cell c)
bool source_subset_in_set_p(cell source, set s)
test if a cell "source" appears as a source in a set of points-to
set points_to_function_projection(set pts)
"pts" is the points-to relation existing at the return point of a function.
list points_to_source_to_translations(cell source, pt_map ptm, bool fresh_p)
Use "ptm" as a translation map.
pt_map remove_unreachable_heap_vertices_in_points_to_graph(pt_map in, bool verbose_p)
pt_map remove_unreachable_stub_vertices_in_points_to_graph(pt_map in)
cell find_kth_points_to_node_in_points_to_path(list p, type t, int k)
Find the "k"-th node of type "t" in list "p".
void free_points_to_graph_sets(points_to_graph s,...)
Free several sets in one call.
bool arc_in_points_to_set_p(points_to spt, set pts)
Check if points-to arc "spt" belongs to points-to set "pts".
list points_to_sources_to_effective_sinks(list sources, pt_map ptm, bool fresh_p)
list stub_source_to_sinks(cell source, pt_map pts, bool fresh_p)
list generic_points_to_source_to_sinks(cell source, pt_map ptm, bool fresh_p, bool strict_p, bool all_p, bool effective_p)
Build the sinks of source "source" according to the points-to graphs.
bool points_to_compare_cell(cell c1, cell c2)
list nowhere_source_to_sinks(cell source, pt_map pts)
list points_to_source_to_any_sinks(cell source, pt_map ptm, bool fresh_p)
Retrieve all possible sinks of the source.
list sink_to_sources(cell sink, set pts, bool fresh_p)
Build a list of possible cell sources for cell "sink" in points-to graph "pts".
bool consistent_points_to_arc_p(points_to a, bool constant_subscript_p)
void upgrade_approximations_in_points_to_set(pt_map ptm)
When arcs have been removed from a points-to relation, the approximations of remaining arcs may not c...
string points_to_cell_name(cell source)
Create a string which is the cell reference in C syntax.
points_to create_k_limited_stub_points_to(cell source, type t, bool array_p, pt_map in)
Create a new node "sink" of type "t" and a new arc "pt" starting from node "source",...
bool source_in_graph_p(cell source, points_to_graph s)
cell type_compatible_super_cell(type t, cell c)
See if a super-cell of "c" exists witf type "t".
bool node_in_points_to_path_p(cell n, list p)
void dump_points_to(const points_to pt)
list reference_to_points_to_translations(entity v, list sl, pt_map ptm)
This function is designed to work properly for the translation of effects at call sites.
void print_or_dump_points_to_set(string what, set s, bool print_p)
Print a set of points-to for debug.
list sources_to_sinks(list sources, pt_map ptm, bool fresh_p)
Same as source_to_sinks, but for a list of cells.
bool cell_out_of_scope_p(cell c)
Return true if a cell is out of scope.
points_to find_arc_in_points_to_set(cell source, cell sink, pt_map ptm)
The approximation is not taken into account.
pt_map graph_assign_list(pt_map ptm, list l)
FI: I add functions dealing with points_to_graph variable, i.e.
void remove_impossible_arcs_to_null(list *pL, pt_map in)
You know that null and undefined cells in "*pL" are impossible because of the operation that is going...
points_to fuse_points_to_sink_cells(cell source, list sink_l, pt_map in)
All vertices in "sink_l" are assumed to be sinks of vertex "source" in points-to graph "in".
int points_to_cell_to_number_of_unbounded_dimensions(cell c)
list potential_to_effective_memory_leaks(list pmll, set res)
A new list, "emll", is allocated.
list points_to_reference_to_translation(reference n_r, list sl, pt_map ptm, bool fresh_p)
FI: easier it fresh_p is true...
cell points_to_source_name_to_source_cell(string sn, pt_map ptm, bool fresh_p)
static void refine_points_to_cell_subscripts(cell sc, cell ec, cell fc)
If the subscripts of the effective cell source "ec" are more precise than the subscripts of the cell ...
list source_to_sinks(cell source, pt_map pts, bool fresh_p)
Return a list of cells, "sinks", that are sink for some arc whose source is "source" or related to "s...
string points_to_cell_to_string(cell c)
list generic_stub_source_to_sinks(cell source, pt_map pts, bool array_p, bool fresh_p)
list points_to_source_name_to_sinks(string sn, pt_map ptm, bool fresh_p)
Use "sn" as a source name to derive a list of sink cells according to the points-to graph ptm.
list scalar_stub_source_to_sinks(cell source, pt_map pts, bool fresh_p)
list points_to_cell_null_initialization(cell c, pt_map pts)
If required according to the property, create a new arc from cell "c" to "null".
int points_to_reference_to_number_of_unbounded_dimensions(reference r)
set remove_points_to_cells(list cl, set g)
All nodes, i.e.
list reference_to_sinks(reference r, pt_map in, bool fresh_p)
list null_source_to_sinks(cell source, pt_map pts)
set points_to_set_block_projection(set pts, list l, bool main_p, bool body_p)
Remove from "pts" arcs based on at least one local entity in list "l" and preserve those based on sta...
bool store_independent_points_to_arc_p(points_to a)
list points_to_source_to_some_sinks(cell source, pt_map ptm, bool fresh_p)
May not retrieve all sinks of the source.
list points_to_sink_to_sources(cell sink, pt_map ptm, bool fresh_p)
Build the sources of sink "sink" according to the points-to graphs.
set add_arc_to_simple_pt_map(points_to a, set s)
bool points_to_compare_ptr_cell(const void *vcel1, const void *vcel2)
int points_to_compare_location(void *vpt1, void *vpt2)
Order the two points-to relations according to the alphabetical order of the underlying variables.
list pointer_source_to_sinks(cell sc, pt_map in)
Returns the sinks for a source cell "sc" of type pointer according to the points-to relation "in".
bool source_in_set_p(cell source, set s)
test if a cell appear as a source in a set of points-to
int points_to_equal_p(const void *vpt1, const void *vpt2)
returns true if two points-to arcs "vpt1" and "vpt2" are equal.
bool dereferencing_free_points_to_arc_p(points_to a)
void points_to_cell_list_and(list *a, const list b)
Compute A = A inter B: complexity in O(n2)
bool points_to_set_sharing_p(set s)
_uint points_to_rank(const void *vpt, size_t size)
create a key which is a concatenation of the source's name, the sink's name and the approximation of ...
list generic_points_to_sources_to_sinks(list sources, pt_map ptm, bool fresh_p, bool effective_p)
Build the union of the sinks of cells in "sources" according to the points-to graphs "ptm".
void remove_points_to_arcs(cell source, cell sink, pt_map pt)
int points_to_subscripts_to_number_of_unbounded_dimensions(list sl)
bool sink_in_set_p(cell sink, set s)
test if a cell appear as a sink in a set of points-to
bool consistent_points_to_graph_p(points_to_graph ptg)
set remove_arc_from_simple_pt_map(points_to a, set s)
set remove_points_to_cell(cell c, set g)
All arcs in relation "g" must be removed or updated if they use the node "c".
bool locations_equal_p(cell acc1, cell acc2)
eturn true if two acces_path are equals
string points_to_name(const points_to pt)
create a string which is a concatenation of the source's name, the sink's name and the approximation ...
bool cell_in_points_to_set_p(cell c, set pts)
Check if a cell c appears as source or sink in points-to set pts.
list array_stub_source_to_sinks(cell source, pt_map pts, bool fresh_p)
points_to points_to_sink_to_points_to(cell sink, pt_map ptm)
Return the points-to "fpt" ending in cell "sink" if it exists.
points_to points_to_path_to_k_limited_points_to_path(list p, int k, type t, bool array_p, pt_map in)
"p" is a points-to path ending with a cell that points towards a new cell ot type "t".
list variable_to_sinks(entity e, pt_map ptm, bool fresh_p)
Return all cells in points-to set "pts" who source is based on entity "e".
points_to_graph points_to_cell_source_projection(points_to_graph ptg, cell c)
Remove all arcs in "ptg" starting from "c".
list extended_sources_to_sinks(list pointed, pt_map in)
Same as extended_source_to_sinks, but for a set of cells, "pointed".
pt_map get_points_to_graph_from_statement(statement st)
void print_points_to_set(string what, set s)
pt_map add_arc_to_pt_map_(points_to a, pt_map s)
bool sinks_fully_matches_source_p(cell source, list sinks)
Is there at least one cell "sink" in list "sinks" whose subscripts fully match the subscripts in cell...
list null_to_sinks(cell source, pt_map ptm)
Create a list of null sinks and add a new null points-to relation to pts.
void print_points_to_path(list p)
For debugging.
pt_map generic_remove_unreachable_vertices_in_points_to_graph(pt_map ptg, int code, bool verbose_p)
Remove arcs in points-to graph "ptg" when they start from a stub cell that is not reachable.
list points_to_source_to_sinks(cell source, pt_map ptm, bool fresh_p)
Build the sinks of source "source" according to the points-to graphs.
bool points_to_in_list_p(points_to pt, const list lx)
bool cell_in_list_p(cell c, const list lx)
int maximal_out_degree_of_points_to_graph(string *mod_cell, pt_map in)
returns the cell vertex "mod_cell" with the maximal out_degree in graph "in", and its out-degree.
void print_points_to(const points_to pt)
list any_source_to_sinks(cell source, pt_map pts, bool fresh_p)
Generalization of source_to_sinks().
set points_to_source_projection(set pts, entity e)
Remove all arcs starting from e because e has been assigned a new value.
pt_map points_to_graph_assign(pt_map out, pt_map in)
void dump_points_to_set(string what, set s)
list extended_source_to_sinks(cell sc, pt_map in)
list points_to_sources_to_sinks(list sources, pt_map ptm, bool fresh_p)
void add_arc_to_pt_map(points_to a, pt_map s)
Add a store independent points-to arc: source and destination references include no dereferencing nor...
pt_map remove_unreachable_vertices_in_points_to_graph(pt_map in)
This function looks pretty dangerous as variables can be reached by their names.
list points_to_source_to_arcs(cell source, pt_map ptm, bool fresh_p)
Build the list of arcs whose source is "source" according to the points-to graphs "ptm".
pt_map normalize_points_to_graph(pt_map ptg)
For the time being, control the out-degree of the vertices in points-to graph "ptg" and fuse the vert...
set merge_points_to_set(set s1, set s2)
Merge two points-to sets.
pt_map merge_points_to_graphs(pt_map s1, pt_map s2)
void print_or_dump_points_to(const points_to pt, bool print_p)
print a points-to arc for debug
list formal_source_to_sinks(cell source, pt_map pts, bool fresh_p)
Creation of a stub for a formal parameter or for a reference based on a formal parameter.
bool unreachable_points_to_cell_p(cell c, pt_map ptg)
Can cell c be accessed via another cell?
set exact_to_may_points_to_set(set s)
Change the all the exact points-to relations to may relations.
list points_to_source_to_effective_sinks(cell source, pt_map ptm, bool fresh_p)
list global_source_to_sinks(cell source, pt_map pts, bool fresh_p)
list anywhere_source_to_sinks(cell source, pt_map pts)
source is assumed to be either nowhere/undefined or anywhere, it may be typed or not.
bool consistent_points_to_set(set s)
make sure that set "s" does not contain redundant or contradictory elements
bool type_compatible_with_points_to_cell_p(type t, cell c)
A type "t" is compatible with a cell "c" if any of the enclosing cell "c'" of "c",...
int compare_entities_without_scope(const entity *pe1, const entity *pe2)
cproto-generated files
string reference_to_string(reference r)
string expression_to_string(expression e)
void print_reference(reference r)
#define print_points_to_graph(x)
#define print_points_to_cell(x)
void print_type(type)
For debugging.
void print_statement(statement)
Print a statement on stderr.
string type_to_full_string_definition(type)
type.c
static int tc
Internal variables
#define PLUS_OPERATOR_NAME
#define binary_intrinsic_expression(name, e1, e2)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
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...
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
static int init
Maximal value set for Fortran 77.
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
const char * entity_module_name(entity e)
See comments about module_name().
value EvalExpression(expression e)
Evaluate statically an expression.
bool extended_integer_constant_expression_p(expression e)
More extensive than next function.
bool zero_expression_p(expression e)
void reference_add_zero_subscripts(reference r, type t)
int expression_to_int(expression exp)
================================================================
expression make_zero_expression(void)
Make a zero expression.
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool unbounded_expression_p(expression e)
bool expression_lists_equal_p(list l1, list l2)
entity any_function_to_return_value(entity m)
Same as function_to_return_value(), but returns value_undefined when m is a C void function or a Fort...
entity function_to_return_value(entity m)
Returns the entity rv that carries the value returned by module m, when m is not a C void function or...
bool const_variable_p(entity)
bool array_of_pointers_type_p(type)
type type_to_array_type(type)
convert a type "t" into a newly allocated array type "at" whose elements are of type "t",...
bool static_global_variable_p(entity)
Is v a global variable declared local to a C file such "static int i;".
bool type_equal_p(type, type)
type type_to_pointed_type(type)
returns t if t is not a pointer type, and the pointed type if t is a pointer type.
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
bool pointer_type_p(type)
Check for scalar pointers.
list derived_type_to_fields(type)
size_t type_depth(type)
Number of steps to access the lowest leave of type t without dereferencing.
bool formal_parameter_p(entity)
expression variable_initial_expression(entity)
Returns a copy of the initial (i.e.
bool struct_type_p(type)
Returns true if t is of type derived and if the derived type is a struct.
type compute_basic_concrete_type(type)
computes a new type which is the basic concrete type of the input type (this new type is not stored i...
bool overloaded_type_p(type)
Returns true if t is a variable type with a basic overloaded.
bool array_of_struct_type_p(type)
bool C_pointer_type_p(type)
Returns OK for "char[]" as well as for "char *".
bool variable_static_p(entity)
true if v appears in a SAVE statement, or in a DATA statement, or is declared static i C.
bool concrete_array_pointer_type_equal_p(type, type)
Same as above, but resolve typedefs first.
#define type_functional_p(x)
#define functional_result(x)
#define value_constant(x)
#define reference_undefined
#define reference_variable(x)
#define type_functional(x)
#define value_unknown_p(x)
#define basic_pointer_p(x)
#define value_constant_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define constant_int_p(x)
#define expression_undefined
#define reference_indices(x)
#define expression_undefined_p(x)
#define variable_dimensions(x)
#define type_variable_p(x)
#define variable_basic(x)
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
string words_to_string(cons *lw)