PIPS
pointer_values.h
Go to the documentation of this file.
1 /* Warning! Do not modify this file that is automatically generated! */
2 /* Modify src/Libs/pointer_values/pointer_values-local.h instead, to add your own modifications. */
3 
4 /* header file built by cproto */
5 
6 #ifndef pointer_values_header_included
7 #define pointer_values_header_included
8 /* pointer_values-local.h */
9 /*
10 
11  $Id: pointer_values-local.h 23065 2016-03-02 09:05:50Z coelho $
12 
13  Copyright 1989-2016 MINES ParisTech
14  Copyright 2010 HPC Project
15 
16  This file is part of PIPS.
17 
18  PIPS is free software: you can redistribute it and/or modify it
19  under the terms of the GNU General Public License as published by
20  the Free Software Foundation, either version 3 of the License, or
21  any later version.
22 
23  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
24  WARRANTY; without even the implied warranty of MERCHANTABILITY or
25  FITNESS FOR A PARTICULAR PURPOSE.
26 
27  See the GNU General Public License for more details.
28 
29  You should have received a copy of the GNU General Public License
30  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
31 
32 */
33 
34 /* pv_context is a structure holding the methods to use during
35  pointer values analyses */
36 typedef struct {
37 
38  /* ANALYSIS CONTROL */
39  bool initial_pointer_values_p; /* set to true for an initial module analysis */
40 
41  /* PIPSDEBM INTERFACES */
42  statement_cell_relations (*db_get_pv_func)(const char *);
43  void (*db_put_pv_func)(const char * , statement_cell_relations);
44  list (*db_get_in_pv_func)(const char *);
45  void (*db_put_in_pv_func)(const char * , list);
46  list (*db_get_out_pv_func)(const char *);
47  void (*db_put_out_pv_func)(const char * , list);
48  list (*db_get_initial_pv_func)(const char *);
49  void (*db_put_initial_pv_func)(const char * , list);
50  list (*db_get_program_pv_func)();
51  void (*db_put_program_pv_func)(list);
52 
53 /* statement_cell_relations (*db_get_gen_pv_func)(char *); */
54 /* void (*db_put_gen_pv_func)(char * , statement_cell_relations); */
55 /* statement_effects (*db_get_kill_pv_func)(char *); */
56 /* void (*db_put_kill_pv_func)(char * , statement_effects); */
57 
58  list (*make_pv_from_effects_func)(effect, effect, cell_interpretation, list);
59 
60  /* COMPARISON OPERATORS */
62  cell, descriptor ,
63  transformer, bool, bool *);
64 
65  /* TRANSLATION OPERATORS */
66  void (*cell_reference_with_value_of_cell_reference_translation_func)
68  void (*cell_reference_with_address_of_cell_reference_translation_func)
70 
71  /* UNARY OPERATORS */
72  cell_relation (*pv_composition_with_transformer_func)(cell_relation, transformer );
73 
74  /* BINARY OPERATORS */
75  list (*pvs_must_union_func)(list, list);
76  list (*pvs_may_union_func)(list, list);
77  bool (*pvs_equal_p_func)(list, list);
78 
79  /* STACKS */
80  stack stmt_stack;
81 } pv_context;
82 
83 /* pv_results is a structure holding the different results of an expression pointer values analysis */
84 typedef struct {
85  list l_out; /* resulting pointer_values */
86  list result_paths; /* resulting pointer path of the expression evaluation */
87  list result_paths_interpretations; /* interpretation of the resulting pointer path */
88 
89 } pv_results;
90 
91 #define pips_debug_pv_results(level, message, pv_res) \
92  ifdebug(level) { pips_debug(level, "%s\n", message); \
93  print_pv_results(pv_res);}
94 /* cproto-generated files */
95 /* pointer_values_analyses.c */
96 extern bool pv_undefined_p(void);
97 extern void reset_pv(void);
98 extern void error_reset_pv(void);
99 extern void set_pv(statement_cell_relations /*o*/);
101 extern void init_pv(void);
102 extern void close_pv(void);
103 extern void store_pv(statement /*k*/, cell_relations /*v*/);
104 extern void update_pv(statement /*k*/, cell_relations /*v*/);
107 extern bool bound_pv_p(statement /*k*/);
108 extern void store_or_update_pv(statement /*k*/, cell_relations /*v*/);
109 extern bool gen_pv_undefined_p(void);
110 extern void reset_gen_pv(void);
111 extern void error_reset_gen_pv(void);
114 extern void init_gen_pv(void);
115 extern void close_gen_pv(void);
116 extern void store_gen_pv(statement /*k*/, cell_relations /*v*/);
117 extern void update_gen_pv(statement /*k*/, cell_relations /*v*/);
120 extern bool bound_gen_pv_p(statement /*k*/);
122 extern bool kill_pv_undefined_p(void);
123 extern void reset_kill_pv(void);
124 extern void error_reset_kill_pv(void);
125 extern void set_kill_pv(statement_effects /*o*/);
127 extern void init_kill_pv(void);
128 extern void close_kill_pv(void);
129 extern void store_kill_pv(statement /*k*/, effects /*v*/);
130 extern void update_kill_pv(statement /*k*/, effects /*v*/);
133 extern bool bound_kill_pv_p(statement /*k*/);
134 extern void store_or_update_kill_pv(statement /*k*/, effects /*v*/);
135 extern statement_cell_relations db_get_simple_pv(const char */*module_name*/);
136 extern void db_put_simple_pv(const char */*module_name*/, statement_cell_relations /*scr*/);
137 extern list db_get_in_simple_pv(const char */*module_name*/);
138 extern void db_put_in_simple_pv(const char */*module_name*/, list /*l_pv*/);
139 extern list db_get_out_simple_pv(const char */*module_name*/);
140 extern void db_put_out_simple_pv(const char */*module_name*/, list /*l_pv*/);
141 extern list db_get_initial_simple_pv(const char */*module_name*/);
142 extern void db_put_initial_simple_pv(const char */*module_name*/, list /*l_pv*/);
143 extern list db_get_program_simple_pv(void);
144 extern void db_put_program_simple_pv(list /*l_pv*/);
146 extern void reset_pv_context(pv_context */*p_ctxt*/);
147 extern void pv_context_statement_push(statement /*s*/, pv_context */*ctxt*/);
148 extern void pv_context_statement_pop(pv_context */*ctxt*/);
150 extern pv_results make_pv_results(void);
151 extern void free_pv_results_paths(pv_results */*pv_res*/);
152 extern void print_pv_results(pv_results /*pv_res*/);
153 extern list make_anywhere_anywhere_pvs(void);
154 extern void range_to_post_pv(range /*r*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
155 extern void expression_to_post_pv(expression /*exp*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
156 extern void single_pointer_assignment_to_post_pv(effect /*lhs_eff*/, list /*l_rhs_eff*/, list /*l_rhs_kind*/, bool /*declaration_p*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
157 extern void multiple_pointer_assignment_to_post_pv(effect /*lhs_base_eff*/, type /*lhs_type*/, list /*l_rhs_base_eff*/, list /*l_rhs_base_kind*/, bool /*declaration_p*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
158 extern void assignment_to_post_pv(expression /*lhs*/, bool /*may_lhs_p*/, expression /*rhs*/, bool /*declaration_p*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
159 extern bool simple_pointer_values(const string /*module_name*/);
160 extern bool initial_simple_pointer_values(const string /*module_name*/);
161 extern bool program_simple_pointer_values(const string /*prog_name*/);
162 /* pointer_values_operators.c */
163 extern list make_simple_pv_from_simple_effects(effect /*lhs_eff*/, effect /*rhs_eff*/, cell_interpretation /*ci*/, list /*l_in*/);
164 extern list kill_pointer_values(list /*l_in*/, list /*l_kill*/, pv_context */*ctxt*/);
165 extern list kill_pointer_value(effect /*eff_kill*/, list /*l_in*/, pv_context */*ctxt*/);
166 extern cell_relation simple_pv_translate(cell_relation /*pv_in*/, bool /*in_first_p*/, cell_relation /*pv_old*/);
167 extern list effect_find_equivalent_pointer_values(effect /*eff*/, list /*l_in*/, cell_relation */*exact_aliased_pv*/, list */*l_in_remnants*/);
168 extern list effect_find_aliased_paths_with_pointer_values(effect /*eff*/, list /*l_pv*/, pv_context */*ctxt*/);
169 extern void pointer_values_remove_var(entity /*e*/, bool /*may_p*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
171 extern list pvs_composition_with_transformer(list /*l_pv*/, transformer /*t*/, pv_context */*ctxt*/);
174 extern list simple_pv_must_union(cell_relation /*pv1*/, cell_relation /*pv2*/);
175 extern list simple_pv_may_union(cell_relation /*pv1*/, cell_relation /*pv2*/);
176 extern bool pvs_union_combinable_p(cell_relation /*pv1*/, cell_relation /*pv2*/);
177 extern list simple_pvs_must_union(list /*l_pv1*/, list /*l_pv2*/);
178 extern list simple_pvs_may_union(list /*l_pv1*/, list /*l_pv2*/);
179 extern bool simple_pvs_syntactically_equal_p(list /*l_pv1*/, list /*l_pv2*/);
180 /* pointer_values_intrinsics.c */
181 extern void intrinsic_to_post_pv(entity /*func*/, list /*func_args*/, list /*l_in*/, pv_results */*pv_res*/, pv_context */*ctxt*/);
182 /* prettyprint.c */
183 extern text text_pv(entity /*module*/, int /*margin*/, statement /*s*/);
184 extern bool generic_print_code_pv(char */*module_name*/, pv_context */*ctxt*/);
185 extern bool print_code_simple_pointer_values(char */*module_name*/);
186 extern void generic_print_code_gen_kill_pv(char */*module_name*/);
187 extern bool print_code_simple_gen_kill_pointer_values(char */*module_name*/);
188 #endif /* pointer_values_header_included */
void const char const char const int
struct _newgen_struct_reference_ * reference
Definition: compsec.h:14
struct _newgen_struct_effect_ * effect
Definition: dg.h:21
bool(* cell_preceding_p_func)(cell, descriptor, cell, descriptor, bool, bool *)
struct _newgen_struct_cell_relation_ * cell_relation
Definition: effects.h:98
struct _newgen_struct_cell_ * cell
Definition: effects.h:90
struct _newgen_struct_cell_interpretation_ * cell_interpretation
Definition: effects.h:82
struct _newgen_struct_descriptor_ * descriptor
Definition: effects.h:114
struct _newgen_struct_statement_cell_relations_ * statement_cell_relations
Definition: effects.h:202
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
Definition: newgen_types.h:78
struct cons * list
Definition: newgen_types.h:106
void pointer_values_remove_var(entity, bool, list, pv_results *, pv_context *)
effects delete_kill_pv(statement)
void generic_print_code_gen_kill_pv(char *)
Definition: prettyprint.c:90
list db_get_in_simple_pv(const char *)
void store_or_update_gen_pv(statement, cell_relations)
void close_gen_pv(void)
void update_pv(statement, cell_relations)
pv_context make_simple_pv_context(void)
void set_kill_pv(statement_effects)
void store_kill_pv(statement, effects)
void close_kill_pv(void)
list kill_pointer_values(list, list, pv_context *)
eliminate the cells of l_kill from l_in
bool print_code_simple_pointer_values(char *)
Definition: prettyprint.c:82
cell_relations delete_pv(statement)
pv_results make_pv_results(void)
void range_to_post_pv(range, list, pv_results *, pv_context *)
void assignment_to_post_pv(expression, bool, expression, bool, list, pv_results *, pv_context *)
bool bound_kill_pv_p(statement)
void error_reset_gen_pv(void)
list db_get_out_simple_pv(const char *)
statement_effects get_kill_pv(void)
void set_pv(statement_cell_relations)
void expression_to_post_pv(expression, list, pv_results *, pv_context *)
void intrinsic_to_post_pv(entity, list, list, pv_results *, pv_context *)
pointer_values_intrinsics.c
list pvs_composition_with_transformer(list, transformer, pv_context *)
void init_pv(void)
void db_put_simple_pv(const char *, statement_cell_relations)
cell_relations load_pv(statement)
void store_or_update_kill_pv(statement, effects)
void error_reset_pv(void)
cell_relation simple_pv_translate(cell_relation, bool, cell_relation)
void db_put_program_simple_pv(list)
void store_gen_pv(statement, cell_relations)
void pv_context_statement_pop(pv_context *)
list simple_pvs_may_union(list, list)
statement_cell_relations db_get_simple_pv(const char *)
I don't know how to deal with these mappings if we have to analyse several modules at the same time w...
bool pv_undefined_p(void)
cproto-generated files
list simple_pv_may_union(cell_relation, cell_relation)
void pv_context_statement_push(statement, pv_context *)
text text_pv(entity, int, statement)
prettyprint.c
void single_pointer_assignment_to_post_pv(effect, list, list, bool, list, pv_results *, pv_context *)
statement_cell_relations get_gen_pv(void)
void store_or_update_pv(statement, cell_relations)
void error_reset_kill_pv(void)
void multiple_pointer_assignment_to_post_pv(effect, type, list, list, bool, list, pv_results *, pv_context *)
list make_anywhere_anywhere_pvs(void)
effects load_kill_pv(statement)
list effect_find_aliased_paths_with_pointer_values(effect, list, pv_context *)
find all paths equivalent to eff cell in l_pv by performing a transitive closure
list simple_pv_must_union(cell_relation, cell_relation)
bool initial_simple_pointer_values(const string)
list db_get_program_simple_pv(void)
bool generic_print_code_pv(char *, pv_context *)
Definition: prettyprint.c:53
void reset_pv_context(pv_context *)
void db_put_out_simple_pv(const char *, list)
void reset_gen_pv(void)
void print_pv_results(pv_results)
void db_put_in_simple_pv(const char *, list)
list simple_pvs_must_union(list, list)
void close_pv(void)
list kill_pointer_value(effect, list, pv_context *)
eliminate the cell of eff_kill from l_in
void free_pv_results_paths(pv_results *)
void init_gen_pv(void)
void reset_kill_pv(void)
bool simple_pvs_syntactically_equal_p(list, list)
list cell_relation_to_may_list(cell_relation)
void store_pv(statement, cell_relations)
void reset_pv(void)
void update_kill_pv(statement, effects)
list cell_relation_to_list(cell_relation)
void update_gen_pv(statement, cell_relations)
bool print_code_simple_gen_kill_pointer_values(char *)
Definition: prettyprint.c:95
list effect_find_equivalent_pointer_values(effect, list, cell_relation *, list *)
find pointer_values in l_in which give (possible or exact) paths equivalent to eff.
void db_put_initial_simple_pv(const char *, list)
statement pv_context_statement_head(pv_context *)
bool program_simple_pointer_values(const string)
cell_relations load_gen_pv(statement)
bool kill_pv_undefined_p(void)
bool simple_pointer_values(const string)
interface to compute the simple pointer values of a given module
void set_gen_pv(statement_cell_relations)
list db_get_initial_simple_pv(const char *)
cell_relations delete_gen_pv(statement)
bool bound_gen_pv_p(statement)
void init_kill_pv(void)
cell_relation simple_pv_composition_with_transformer(cell_relation, transformer)
list make_simple_pv_from_simple_effects(effect, effect, cell_interpretation, list)
pointer_values_operators.c
statement_cell_relations get_pv(void)
bool bound_pv_p(statement)
bool gen_pv_undefined_p(void)
bool pvs_union_combinable_p(cell_relation, cell_relation)
struct _newgen_struct_transformer_ * transformer
Definition: ri.h:431
the stack head
Definition: stack.c:62
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
pv_context is a structure holding the methods to use during pointer values analyses
pv_results is a structure holding the different results of an expression pointer values analysis