PIPS
|
Go to the source code of this file.
Data Structures | |
struct | pv_context |
pv_context is a structure holding the methods to use during pointer values analyses More... | |
struct | pv_results |
pv_results is a structure holding the different results of an expression pointer values analysis More... | |
Macros | |
#define | pips_debug_pv_results(level, message, pv_res) |
Definition at line 91 of file pointer_values.h.
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 | ||
) |
first convert the rhs and lhs into memory paths, rhs is evaluated first
this is done even if this is a non-pointer assignment, becasue there maybe side effects on alising hidden in sub-expressions, function calls...
we should test here that lhs_pv_res.result_paths has only one element. well is it correct? can a relational operator expression be a lhs ?
l_gen = NIL; l_kill = NIL;
simple case first: lhs is a pointer
hidden pointer assignments
lhs | hs |
may_lhs_p | ay_lhs_p |
rhs | hs |
declaration_p | eclaration_p |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 1582 of file pointer_values_analyses.c.
References basic_concrete_type_leads_to_pointer_p(), bool_to_string(), CAR, CELL_INTERPRETATION, CONS, copy_effect(), EFFECT, effect_to_may_effect(), effect_undefined, expression_to_post_pv(), expression_to_type(), free_pv_results_paths(), pv_results::l_out, make_cell_interpretation_value_of(), make_pv_results(), multiple_pointer_assignment_to_post_pv(), NIL, pips_debug, pips_debug_pv_results, pips_debug_pvs, pips_internal_error, pointer_type_p(), pv_results::result_paths, pv_results::result_paths_interpretations, single_pointer_assignment_to_post_pv(), type_functional_p, type_fundamental_basic_p(), and type_variable_p.
Referenced by assignment_intrinsic_to_post_pv(), declaration_to_post_pv(), and pointer_values_remove_var().
Referenced by sequence_to_post_pv(), and statement_to_post_pv().
list cell_relation_to_list | ( | cell_relation | cr | ) |
cr | r |
Definition at line 800 of file pointer_values_operators.c.
References CELL_RELATION, CONS, and NIL.
Referenced by simple_pvs_must_union().
list cell_relation_to_may_list | ( | cell_relation | cr | ) |
cr | r |
Definition at line 805 of file pointer_values_operators.c.
References CELL_RELATION, cell_relation_approximation_tag, CONS, is_approximation_may, and NIL.
Referenced by simple_pvs_may_union().
void close_gen_pv | ( | void | ) |
void close_kill_pv | ( | void | ) |
void close_pv | ( | void | ) |
list db_get_in_simple_pv | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 73 of file pointer_values_analyses.c.
References cell_relations_list, db_get_memory_resource(), and module_name().
Referenced by make_simple_pv_context().
list db_get_initial_simple_pv | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 93 of file pointer_values_analyses.c.
References cell_relations_list, db_get_memory_resource(), and module_name().
Referenced by make_simple_pv_context().
list db_get_out_simple_pv | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 83 of file pointer_values_analyses.c.
References cell_relations_list, db_get_memory_resource(), and module_name().
Referenced by make_simple_pv_context().
list db_get_program_simple_pv | ( | void | ) |
Definition at line 103 of file pointer_values_analyses.c.
References cell_relations_list, and db_get_memory_resource().
Referenced by make_simple_pv_context().
statement_cell_relations db_get_simple_pv | ( | const char * | module_name | ) |
I don't know how to deal with these mappings if we have to analyse several modules at the same time when performing an interprocedural analysis.
We may need a stack of mappings, or a global mapping for the whole program, and a temporary mapping to store the resources one module at a time
module_name | odule_name |
Definition at line 63 of file pointer_values_analyses.c.
References db_get_memory_resource(), and module_name().
Referenced by make_simple_pv_context().
void db_put_in_simple_pv | ( | const char * | module_name, |
list | l_pv | ||
) |
module_name | odule_name |
l_pv | _pv |
Definition at line 78 of file pointer_values_analyses.c.
References DB_PUT_MEMORY_RESOURCE, make_cell_relations(), and module_name().
Referenced by make_simple_pv_context().
void db_put_initial_simple_pv | ( | const char * | module_name, |
list | l_pv | ||
) |
module_name | odule_name |
l_pv | _pv |
Definition at line 98 of file pointer_values_analyses.c.
References DB_PUT_MEMORY_RESOURCE, make_cell_relations(), and module_name().
Referenced by make_simple_pv_context().
void db_put_out_simple_pv | ( | const char * | module_name, |
list | l_pv | ||
) |
module_name | odule_name |
l_pv | _pv |
Definition at line 88 of file pointer_values_analyses.c.
References DB_PUT_MEMORY_RESOURCE, make_cell_relations(), and module_name().
Referenced by make_simple_pv_context().
void db_put_program_simple_pv | ( | list | l_pv | ) |
l_pv | _pv |
Definition at line 108 of file pointer_values_analyses.c.
References DB_PUT_MEMORY_RESOURCE, and make_cell_relations().
Referenced by make_simple_pv_context().
void db_put_simple_pv | ( | const char * | module_name, |
statement_cell_relations | scr | ||
) |
module_name | odule_name |
scr | cr |
Definition at line 68 of file pointer_values_analyses.c.
References DB_PUT_MEMORY_RESOURCE, and module_name().
Referenced by make_simple_pv_context().
cell_relations delete_gen_pv | ( | statement | ) |
cell_relations delete_pv | ( | statement | ) |
list effect_find_aliased_paths_with_pointer_values | ( | effect | eff, |
list | l_pv, | ||
pv_context * | ctxt | ||
) |
find all paths equivalent to eff cell in l_pv by performing a transitive closure
eff | is the input effect |
l_pv | is the list of current pointer_values relations |
ctxt | is the pv analysis context |
eff | ff |
l_pv | _pv |
ctxt | txt |
Definition at line 678 of file pointer_values_operators.c.
References generic_effect_find_aliases_with_simple_pointer_values(), pips_assert, simple_cell_preceding_p(), simple_cell_to_simple_cell_conversion(), simple_cell_with_address_of_cell_translation(), simple_cell_with_value_of_cell_translation(), simple_cells_inclusion_p(), simple_cells_intersection_p(), and transformer_undefined.
Referenced by simple_effect_to_constant_path_effects_with_pointer_values(), and single_pointer_assignment_to_post_pv().
list effect_find_equivalent_pointer_values | ( | effect | eff, |
list | l_in, | ||
cell_relation * | exact_aliased_pv, | ||
list * | l_in_remnants | ||
) |
find pointer_values in l_in which give (possible or exact) paths equivalent to eff.
eff | is the considered input path. |
l_in | is the input pointer values list. |
exact_aliased_pv | gives an exact equivalent path found in l_in if it exists. |
l_in_remnants | contains the elemnts of l_in which are neither exact_aliased_pv nor in the returned list. |
eff | ff |
l_in | _in |
exact_aliased_pv | xact_aliased_pv |
l_in_remnants | _in_remnants |
Definition at line 658 of file pointer_values_operators.c.
References generic_effect_find_equivalent_simple_pointer_values(), simple_cell_to_simple_cell_conversion(), simple_cells_inclusion_p(), and simple_cells_intersection_p().
Referenced by free_to_post_pv(), kill_pointer_value(), and make_simple_pv_from_simple_effects().
void error_reset_gen_pv | ( | void | ) |
void error_reset_kill_pv | ( | void | ) |
void error_reset_pv | ( | void | ) |
void expression_to_post_pv | ( | expression | exp, |
list | l_in, | ||
pv_results * | pv_res, | ||
pv_context * | ctxt | ||
) |
we assume no effects on aliases due to subscripts evaluations for the moment
we assume no effects on aliases due to sizeof argument expression for the moment
aborts if there are calls in subscript expressions
free the spine
we assume no effects on aliases due to subscripts evaluations for the moment
exp | xp |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 930 of file pointer_values_analyses.c.
References call_to_post_pv(), cast_expression, CELL_INTERPRETATION, CONS, copy_reference(), EFFECT, entity_local_name(), exp, expression_syntax, expression_to_post_pv(), expression_to_string(), expression_undefined_p, FOREACH, gen_free_list(), gen_full_free_list(), generic_proper_effects_of_complex_address_expression(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, pv_results::l_out, make_action_read_memory(), make_action_write_memory(), make_approximation_exact(), make_cell_interpretation_value_of(), make_descriptor_none(), make_effect(), make_null_pointer_value_cell(), make_undefined_pointer_value_cell(), NIL, pips_debug, pips_debug_pv_results, pips_internal_error, reference_to_effect_func, reference_variable, pv_results::result_paths, pv_results::result_paths_interpretations, same_string_p, syntax_call, syntax_cast, syntax_reference, and syntax_tag.
Referenced by address_of_to_post_pv(), assignment_to_post_pv(), binary_arithmetic_operator_to_post_pv(), c_return_to_post_pv(), conditional_operator_to_post_pv(), default_intrinsic_to_post_pv(), dereferencing_to_post_pv(), expression_to_post_pv(), external_call_to_post_pv(), field_to_post_pv(), forloop_to_post_pv(), heap_intrinsic_to_post_pv(), instruction_to_post_pv(), logical_operator_to_post_pv(), point_to_to_post_pv(), range_to_post_pv(), safe_intrinsic_to_post_pv(), test_to_post_pv(), unary_arithmetic_operator_to_post_pv(), update_operator_to_post_pv(), and whileloop_to_post_pv().
void free_pv_results_paths | ( | pv_results * | pv_res | ) |
pv_res | v_res |
Definition at line 203 of file pointer_values_analyses.c.
References gen_full_free_list(), NIL, pv_results::result_paths, and pv_results::result_paths_interpretations.
Referenced by assignment_to_post_pv(), binary_arithmetic_operator_to_post_pv(), declaration_to_post_pv(), default_intrinsic_to_post_pv(), forloop_to_post_pv(), free_to_post_pv(), heap_intrinsic_to_post_pv(), instruction_to_post_pv(), logical_operator_to_post_pv(), loop_to_post_pv(), range_to_post_pv(), safe_intrinsic_to_post_pv(), sequence_to_post_pv(), single_pointer_assignment_to_post_pv(), test_to_post_pv(), and whileloop_to_post_pv().
bool gen_pv_undefined_p | ( | void | ) |
void generic_print_code_gen_kill_pv | ( | char * | module_name | ) |
module_name | odule_name |
Definition at line 90 of file prettyprint.c.
References module_name(), and pips_assert.
Referenced by print_code_simple_gen_kill_pointer_values().
bool generic_print_code_pv | ( | char * | module_name, |
pv_context * | ctxt | ||
) |
module_name | odule_name |
ctxt | txt |
Definition at line 53 of file prettyprint.c.
References close_prettyprint(), pv_context::db_get_in_pv_func, db_get_memory_resource(), pv_context::db_get_pv_func, get_current_module_entity(), get_current_module_statement(), init_prettyprint(), make_text(), make_text_resource_and_free(), MERGE_TEXTS, module_name(), module_name_to_entity(), NIL, reset_current_module_entity(), reset_current_module_statement(), reset_pv(), set_current_module_entity(), set_current_module_statement(), set_pv(), text_module(), text_pointer_values(), and text_pv().
Referenced by print_code_simple_pointer_values().
statement_cell_relations get_gen_pv | ( | void | ) |
statement_effects get_kill_pv | ( | void | ) |
statement_cell_relations get_pv | ( | void | ) |
void init_gen_pv | ( | void | ) |
void init_kill_pv | ( | void | ) |
void init_pv | ( | void | ) |
Referenced by generic_module_initial_pointer_values(), and generic_module_pointer_values().
bool initial_simple_pointer_values | ( | const | string | ) |
string | odule_name |
Definition at line 1925 of file pointer_values_analyses.c.
References generic_effects_reset_all_methods(), generic_module_initial_pointer_values(), pv_context::initial_pointer_values_p, make_simple_pv_context(), module_name(), reset_pv_context(), and set_methods_for_simple_effects().
void intrinsic_to_post_pv | ( | entity | func, |
list | func_args, | ||
list | l_in, | ||
pv_results * | pv_res, | ||
pv_context * | ctxt | ||
) |
func | unc |
func_args | unc_args |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 1969 of file pointer_values_intrinsics.c.
References entity_local_name(), IntrinsicToPostPVDescriptorTable, IntrinsicDescriptor::name, pips_debug, pips_debug_pv_results, pips_internal_error, and IntrinsicDescriptor::to_post_pv_function.
Referenced by call_to_post_pv().
list kill_pointer_value | ( | effect | eff_kill, |
list | l_in, | ||
pv_context * | ctxt | ||
) |
eliminate the cell of eff_kill from l_in
eff_kill | is the effect describing the cell to be killed |
l_in | is the input list of pointer_values. |
ctxt | is a pointer on the pointer values analysis contex. |
all pointers may be killed
eff_kill characteristics
using old_values, take into account the impact of eff_kill on l_in pointer values second cells which must be expressed in terms of unchanged paths.
should we translate the first or the second pv_in cell
must it be translated ?
pv_in first cell characteristics
pv_in second cell characteristics
pointer value relation is still valid
This should be made generic
we must translate ref_in using the old_values
if there is an exact candidate, it is ranked first and we can use it
generate a new pv for each element of old_values
FOREACH(CELL_RELATION, old_pv, l_old_values)
else branch of if (exact_first_pv)
if (to_be_translated)
FOREACH (CELL_RELATION, pv_in, l_remnants)
Second, take into account the impact of eff_kill on l_old_values relations. We only have to keep those which are not completely killed by kill_eff, and set their approximation to may (this is also true for exact_old_pv)
first use exact_old_pv to translate exact old_values
Then the other old_values
we already know that there may be a non-empty intersection with cell_kill
some more work is necessary
some more precise work could be done here by computing the difference between the pv_old first cell and cell_kill. I don't know if it would be really useful. So let us avoid too complex things for the moment.
some more precise work could be done here by computing the difference between the pv_old first cell and cell_kill. I don't know if it would be really useful. So let us avoid too complex things for the moment.
eff_kill | ff_kill |
l_in | of cell_relations |
ctxt | txt |
Definition at line 193 of file pointer_values_operators.c.
References abstract_pointer_value_cell_p(), anywhere_effect_p(), cell_reference, CELL_RELATION, cell_relation_approximation_tag, cell_relation_first_cell, cell_relation_second_address_of_p, cell_relation_second_cell, cell_relation_undefined, cell_relation_undefined_p, CONS, copy_cell(), copy_cell_relation(), descriptor_undefined, effect_any_reference, effect_approximation_tag, effect_cell, effect_find_equivalent_pointer_values(), FOREACH, free_cell_relation(), gen_free_list(), gen_length(), is_approximation_may, make_descriptor_none(), make_value_of_pointer_value(), NIL, pips_debug, pips_debug_effect, pips_debug_pv, pips_debug_pvs, pv_context::pvs_must_union_func, reference_indices, reference_variable, same_entity_p(), simple_cell_reference_preceding_p(), simple_cells_inclusion_p(), simple_pv_translate(), and transformer_undefined.
Referenced by kill_pointer_values().
list kill_pointer_values | ( | list | l_in, |
list | l_kill, | ||
pv_context * | ctxt | ||
) |
eliminate the cells of l_kill from l_in
l_kill | is the list of effects describing the cells to eliminated from l_in |
l_in | is the input list of pointer_values. |
ctxt | is a pointer on the pointer values analysis contex. |
l_in | of cell_relations |
l_kill | of effects |
ctxt | txt |
Definition at line 155 of file pointer_values_operators.c.
References EFFECT, ENDP, FOREACH, gen_full_copy_list(), gen_full_free_list(), kill_pointer_value(), NIL, pips_debug_effects, and pips_debug_pvs.
Referenced by single_pointer_assignment_to_post_pv().
bool kill_pv_undefined_p | ( | void | ) |
cell_relations load_gen_pv | ( | statement | ) |
cell_relations load_pv | ( | statement | ) |
Referenced by convex_effect_find_aliased_paths_with_pointer_values(), simple_effect_to_constant_path_effects_with_pointer_values(), and text_pv().
list make_anywhere_anywhere_pvs | ( | void | ) |
Definition at line 237 of file pointer_values_analyses.c.
References CELL_RELATION, CONS, copy_cell(), entity_all_locations(), is_approximation_may, make_address_of_pointer_value(), make_cell_reference(), make_descriptor_none(), make_reference(), and NIL.
Referenced by unstructured_to_post_pv().
pv_results make_pv_results | ( | void | ) |
Definition at line 194 of file pointer_values_analyses.c.
References pv_results::l_out, NIL, pv_results::result_paths, and pv_results::result_paths_interpretations.
Referenced by assignment_to_post_pv(), binary_arithmetic_operator_to_post_pv(), conditional_operator_to_post_pv(), declaration_to_post_pv(), external_call_to_post_pv(), forloop_to_post_pv(), heap_intrinsic_to_post_pv(), instruction_to_post_pv(), logical_operator_to_post_pv(), loop_to_post_pv(), safe_intrinsic_to_post_pv(), sequence_to_post_pv(), test_to_post_pv(), and whileloop_to_post_pv().
pv_context make_simple_pv_context | ( | void | ) |
Definition at line 119 of file pointer_values_analyses.c.
References pv_context::cell_preceding_p_func, pv_context::cell_reference_with_address_of_cell_reference_translation_func, pv_context::cell_reference_with_value_of_cell_reference_translation_func, pv_context::db_get_in_pv_func, db_get_in_simple_pv(), pv_context::db_get_initial_pv_func, db_get_initial_simple_pv(), pv_context::db_get_out_pv_func, db_get_out_simple_pv(), pv_context::db_get_program_pv_func, db_get_program_simple_pv(), pv_context::db_get_pv_func, db_get_simple_pv(), pv_context::db_put_in_pv_func, db_put_in_simple_pv(), pv_context::db_put_initial_pv_func, db_put_initial_simple_pv(), pv_context::db_put_out_pv_func, db_put_out_simple_pv(), pv_context::db_put_program_pv_func, db_put_program_simple_pv(), pv_context::db_put_pv_func, db_put_simple_pv(), pv_context::initial_pointer_values_p, pv_context::make_pv_from_effects_func, make_simple_pv_from_simple_effects(), pv_context::pv_composition_with_transformer_func, pv_context::pvs_equal_p_func, pv_context::pvs_may_union_func, pv_context::pvs_must_union_func, simple_cell_preceding_p(), simple_cell_reference_with_address_of_cell_reference_translation(), simple_cell_reference_with_value_of_cell_reference_translation(), simple_pv_composition_with_transformer(), simple_pvs_may_union(), simple_pvs_must_union(), simple_pvs_syntactically_equal_p(), stack_make(), statement_domain, and pv_context::stmt_stack.
Referenced by convex_effect_find_aliased_paths_with_pointer_values(), initial_simple_pointer_values(), print_code_simple_gen_kill_pointer_values(), print_code_simple_pointer_values(), program_simple_pointer_values(), simple_effect_to_constant_path_effects_with_pointer_values(), and simple_pointer_values().
list make_simple_pv_from_simple_effects | ( | effect | lhs_eff, |
effect | rhs_eff, | ||
cell_interpretation | ci, | ||
list | l_in | ||
) |
lhs_eff | hs_eff |
rhs_eff | hs_eff |
ci | i |
l_in | _in |
Definition at line 57 of file pointer_values_operators.c.
References approximation_and(), cell_interpretation_value_of_p, cell_reference, CELL_RELATION, cell_relation_undefined, cell_relation_undefined_p, CONS, copy_reference(), descriptor_undefined, effect_any_reference, effect_approximation_tag, effect_cell, effect_find_equivalent_pointer_values(), FOREACH, free_cell_relation(), gen_free_list(), is_approximation_exact, is_approximation_may, is_cell_reference, make_address_of_pointer_value(), make_cell(), make_descriptor_none(), make_undefined_pointer_value_cell(), make_value_of_pointer_value(), NIL, pips_debug, pips_debug_effect, pips_debug_pvs, simple_cell_reference_preceding_p(), simple_cell_to_store_independent_cell(), simple_pv_translate(), transformer_undefined, and undefined_pointer_value_cell_p().
Referenced by make_simple_pv_context().
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 | ||
) |
we could be more precise here on abstract locations
if (!anywhere_lhs_p)
lhs is not a pointer, but it is an array of pointers or an aggregate type with pointers....
In this case, it cannot be an address_of case
First, search for all accessible pointers
to work around the fact that exact effects are must effects
Then for each found pointer, do as if there were an assignment by translating the rhs path accordingly
build the list of corresponding rhs
should be refined
general case at least :-)
This is not generic, I should use a translation algorithm here I guess
first skip dimensions of kill_ref similar to lhs_base_ref
add the remaining dimensions to the copy of rhs_base_eff
while
if (!ENDP(l_lhs))
if (!anywhere_lhs_p)
lhs_base_eff | hs_base_eff |
lhs_type | hs_type |
l_rhs_base_eff | _rhs_base_eff |
l_rhs_base_kind | _rhs_base_kind |
declaration_p | eclaration_p |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 1444 of file pointer_values_analyses.c.
References anywhere_effect_p(), CAR, CELL_INTERPRETATION, cell_reference_to_type(), cell_undefined, cell_undefined_p, CONS, copy_effect(), EFFECT, effect_any_reference, effect_cell, effect_exact_p, effects_to_must_effects(), ENDP, EXPRESSION, FOREACH, free_type(), gen_free_list(), gen_full_free_list(), gen_length(), generic_effect_generate_all_accessible_paths_effects_with_level(), is_action_write, pv_results::l_out, make_action_write_memory(), make_anywhere_effect(), make_cell_interpretation_address_of(), NIL, null_pointer_value_cell_p(), pips_assert, pips_debug, pips_debug_effects, POP, reference_indices, pv_results::result_paths, single_pointer_assignment_to_post_pv(), type_equal_p(), and undefined_pointer_value_cell_p().
Referenced by assignment_to_post_pv().
void pointer_values_remove_var | ( | entity | e, |
bool | may_p, | ||
list | l_in, | ||
pv_results * | pv_res, | ||
pv_context * | ctxt | ||
) |
possibly assign an undefined value to pointers reachable from e without dereferencements)
Then replace all occurrences of e by an undefined value if it's not a may kill
may_p | ay_p |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 693 of file pointer_values_operators.c.
References assignment_to_post_pv(), cell_reference, CELL_RELATION, cell_relation_first_cell, cell_relation_second_cell, cell_relation_second_interpretation_tag, CONS, copy_cell_relation(), entity_name, entity_to_expression(), exp, expression_undefined, FOREACH, free_cell(), free_cell_relation(), free_expression(), gen_full_free_list(), is_cell_interpretation_value_of, keep, pv_results::l_out, make_undefined_pointer_value_cell(), NIL, pips_debug, pips_debug_pv, pips_debug_pvs, reference_variable, same_entity_p(), and undefined_pointer_value_cell_p().
Referenced by free_to_post_pv(), and sequence_to_post_pv().
bool print_code_simple_gen_kill_pointer_values | ( | char * | module_name | ) |
module_name | odule_name |
Definition at line 95 of file prettyprint.c.
References generic_print_code_gen_kill_pv(), make_simple_pv_context(), module_name(), and reset_pv_context().
bool print_code_simple_pointer_values | ( | char * | module_name | ) |
module_name | odule_name |
Definition at line 82 of file prettyprint.c.
References generic_print_code_pv(), make_simple_pv_context(), module_name(), and reset_pv_context().
void print_pv_results | ( | pv_results | pv_res | ) |
pv_res | v_res |
Definition at line 211 of file pointer_values_analyses.c.
References CAR, CELL_INTERPRETATION, cell_interpretation_value_of_p, EFFECT, ENDP, fprintf(), pv_results::l_out, POP, print_pointer_values(), pv_results::result_paths, and pv_results::result_paths_interpretations.
bool program_simple_pointer_values | ( | const | string | ) |
string | rog_name |
Definition at line 1936 of file pointer_values_analyses.c.
References generic_effects_reset_all_methods(), generic_program_pointer_values(), make_simple_pv_context(), reset_pv_context(), and set_methods_for_simple_effects().
statement pv_context_statement_head | ( | pv_context * | ctxt | ) |
ctxt | txt |
Definition at line 187 of file pointer_values_analyses.c.
References stack_head(), and pv_context::stmt_stack.
Referenced by heap_intrinsic_to_post_pv().
void pv_context_statement_pop | ( | pv_context * | ctxt | ) |
ctxt | txt |
Definition at line 182 of file pointer_values_analyses.c.
References stack_pop(), and pv_context::stmt_stack.
Referenced by sequence_to_post_pv(), and statement_to_post_pv().
void pv_context_statement_push | ( | statement | s, |
pv_context * | ctxt | ||
) |
ctxt | txt |
Definition at line 177 of file pointer_values_analyses.c.
References stack_push(), and pv_context::stmt_stack.
Referenced by sequence_to_post_pv(), and statement_to_post_pv().
bool pv_undefined_p | ( | void | ) |
cproto-generated files
list pvs_composition_with_transformer | ( | list | l_pv, |
transformer | t, | ||
pv_context * | ctxt | ||
) |
l_pv | _pv |
ctxt | txt |
Definition at line 788 of file pointer_values_operators.c.
References CELL_RELATION, FOREACH, and pv_context::pv_composition_with_transformer_func.
Referenced by statement_to_post_pv().
bool pvs_union_combinable_p | ( | cell_relation | pv1, |
cell_relation | pv2 | ||
) |
pv1 | v1 |
pv2 | v2 |
Definition at line 965 of file pointer_values_operators.c.
References cell_compare(), cell_entity(), cell_relation_first_cell, cell_relation_second_cell, cell_relation_second_value_of_p, cell_relation_undefined_p, entity_all_locations_p(), pips_assert, and pv_cells_mergeable_p().
Referenced by simple_pvs_may_union(), and simple_pvs_must_union().
void range_to_post_pv | ( | range | r, |
list | l_in, | ||
pv_results * | pv_res, | ||
pv_context * | ctxt | ||
) |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 913 of file pointer_values_analyses.c.
References expression_to_post_pv(), free_pv_results_paths(), pv_results::l_out, pips_debug, pips_debug_pvs, range_increment, range_lower, and range_upper.
Referenced by loop_to_post_pv().
void reset_gen_pv | ( | void | ) |
void reset_kill_pv | ( | void | ) |
void reset_pv | ( | void | ) |
Referenced by generic_module_initial_pointer_values(), generic_module_pointer_values(), and generic_print_code_pv().
void reset_pv_context | ( | pv_context * | p_ctxt | ) |
p_ctxt->db_get_gen_pv_func =(statement_cell_relations_function) UNDEF ;
p_ctxt->db_put_gen_pv_func = (void_function) UNDEF;
p_ctxt->db_get_kill_pv_func = (statement_effects_function) UNDEF;
p_ctxt->db_put_kill_pv_func = (void_function) UNDEF;
p_ctxt | _ctxt |
Definition at line 162 of file pointer_values_analyses.c.
References pv_context::db_get_pv_func, pv_context::db_put_pv_func, pv_context::make_pv_from_effects_func, pv_context::pv_composition_with_transformer_func, pv_context::pvs_equal_p_func, pv_context::pvs_may_union_func, pv_context::pvs_must_union_func, and UNDEF.
Referenced by convex_effect_find_aliased_paths_with_pointer_values(), initial_simple_pointer_values(), print_code_simple_gen_kill_pointer_values(), print_code_simple_pointer_values(), program_simple_pointer_values(), simple_effect_to_constant_path_effects_with_pointer_values(), and simple_pointer_values().
void set_gen_pv | ( | statement_cell_relations | ) |
void set_kill_pv | ( | statement_effects | ) |
void set_pv | ( | statement_cell_relations | ) |
bool simple_pointer_values | ( | const | string | ) |
interface to compute the simple pointer values of a given module
string | odule_name |
Definition at line 1915 of file pointer_values_analyses.c.
References generic_effects_reset_all_methods(), generic_module_pointer_values(), make_simple_pv_context(), module_name(), reset_pv_context(), and set_methods_for_simple_effects().
cell_relation simple_pv_composition_with_transformer | ( | cell_relation | , |
transformer | |||
) |
list simple_pv_may_union | ( | cell_relation | pv1, |
cell_relation | pv2 | ||
) |
pv1 | v1 |
pv2 | v2 |
Definition at line 891 of file pointer_values_operators.c.
References CAR, cell_any_reference(), cell_compare(), cell_entity(), CELL_RELATION, cell_relation_approximation_tag, cell_relation_first_cell, cell_relation_second_cell, CONS, copy_cell(), copy_cell_relation(), ENDP, entity_all_locations_p(), EXPRESSION, EXPRESSION_, expression_equal_p(), is_approximation_may, make_address_of_pointer_value(), make_descriptor_none(), make_unbounded_expression(), NIL, pips_debug, pips_debug_pvs, POP, and reference_indices.
Referenced by simple_pvs_may_union().
list simple_pv_must_union | ( | cell_relation | pv1, |
cell_relation | pv2 | ||
) |
pv1 | v1 |
pv2 | v2 |
Definition at line 811 of file pointer_values_operators.c.
References CAR, cell_any_reference(), cell_compare(), cell_entity(), CELL_RELATION, cell_relation_approximation_tag, cell_relation_first_cell, cell_relation_second_cell, cell_relation_undefined, CONS, copy_cell(), copy_cell_relation(), ENDP, entity_all_locations_p(), EXPRESSION, EXPRESSION_, expression_equal_p(), is_approximation_exact, is_approximation_may, make_address_of_pointer_value(), make_descriptor_none(), make_unbounded_expression(), NIL, pips_debug, pips_debug_pv, pips_debug_pvs, POP, and reference_indices.
Referenced by simple_pvs_must_union().
cell_relation simple_pv_translate | ( | cell_relation | pv_in, |
bool | in_first_p, | ||
cell_relation | pv_old | ||
) |
pv_in | a the input pointer_value relation |
in_first_p | is true (false) if the first (second) cell of pv_in has to be translated |
pv_old | is the cell relation that gives the value of a prefix path of the first (second) cell of pv_in |
pv_in first or second cell characteristics
pv_old characteristics
is the first cell of pv_old the prefix of ref_in?
act as if there were a [0] indice at the end of ref_old_1
not generic here
not generic here
not generic here
not generic here
not generic here
not generic here
pv_in | v_in |
in_first_p | n_first_p |
pv_old | v_old |
Definition at line 513 of file pointer_values_operators.c.
References cell_reference, cell_relation_first_cell, cell_relation_may_p, cell_relation_second_address_of_p, cell_relation_second_cell, cell_relation_second_value_of_p, copy_cell(), copy_reference(), descriptor_undefined, entity_all_locations_p(), gen_length(), int, is_approximation_exact, is_approximation_may, make_address_of_pointer_value(), make_cell_reference(), make_descriptor_none(), make_value_of_pointer_value(), pips_assert, pips_debug, pips_debug_pv, ref, reference_indices, reference_to_string(), reference_variable, same_entity_p(), simple_cell_reference_with_address_of_cell_reference_translation(), and simple_cell_reference_with_value_of_cell_reference_translation().
Referenced by kill_pointer_value(), and make_simple_pv_from_simple_effects().
l_pv1 | _pv1 |
l_pv2 | _pv2 |
Definition at line 1029 of file pointer_values_operators.c.
References cell_relation_to_may_list(), cell_relations_generic_binary_op(), pvs_union_combinable_p(), simple_pv_may_union(), and simple_pvs_must_union().
Referenced by make_simple_pv_context().
l_pv1 | _pv1 |
l_pv2 | _pv2 |
Definition at line 1010 of file pointer_values_operators.c.
References cell_relation_to_list(), cell_relations_generic_binary_op(), pvs_union_combinable_p(), simple_pv_must_union(), and simple_pvs_must_union().
Referenced by make_simple_pv_context(), simple_pvs_may_union(), and simple_pvs_must_union().
first sort lists
then compare members syntactically
l_pv1 | _pv1 |
l_pv2 | _pv2 |
Definition at line 1042 of file pointer_values_operators.c.
References CAR, CELL_RELATION, ENDP, gen_length(), gen_sort_list(), pointer_value_compare(), POP, and pv_cells_syntactically_equal_p().
Referenced by make_simple_pv_context().
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 | ||
) |
First search for all killed paths
we could be more precise/generic on abstract locations
no aliases for a newly declared entity
if lhs_eff is a may-be-killed, then all aliased effects are also may-be-killed effects
we must find in l_in all pointers p and generate p == rhs for all rhs if p is of a type compatible with rhs, and p == &*anywhere* otherwise. in fact, for the moment we generate p == &*anywhere* in all cases
dealing with first cell
not generic
not generic
generate for all alias p in l_kill p == rhs_eff
except for p==undefined or p==null (should other abstract values/locations be ignored here?)
now take kills into account
and add gen
lhs_eff | hs_eff |
l_rhs_eff | _rhs_eff |
l_rhs_kind | _rhs_kind |
declaration_p | eclaration_p |
l_in | _in |
pv_res | v_res |
ctxt | txt |
Definition at line 1253 of file pointer_values_analyses.c.
References anywhere_effect_p(), CAR, CELL_INTERPRETATION, cell_interpretation_value_of_p, CELL_RELATION, cell_relation_first_cell, cell_relation_second_cell, cell_relation_second_value_of_p, CONS, copy_cell(), copy_effect(), EFFECT, effect_find_aliased_paths_with_pointer_values(), effect_may_p, effect_to_string(), effects_to_may_effects(), ENDP, FOREACH, free_cell_interpretation(), free_effect(), free_pv_results_paths(), gen_full_free_list(), gen_length(), gen_nconc(), ifdebug, kill_pointer_values(), pv_results::l_out, make_action_write_memory(), make_anywhere_effect(), make_approximation_may(), make_cell_interpretation_address_of(), make_descriptor_none(), make_effect(), pv_context::make_pv_from_effects_func, NIL, null_pointer_value_cell_p(), null_pointer_value_effect_p(), pips_assert, pips_debug, pips_debug_effect, pips_debug_effects, pips_debug_pvs, pips_user_warning, POP, pv_context::pvs_must_union_func, pv_results::result_paths, pv_results::result_paths_interpretations, undefined_pointer_value_cell_p(), and undefined_pointer_value_effect_p().
Referenced by assignment_to_post_pv(), external_call_to_post_pv(), forloop_to_post_pv(), free_to_post_pv(), loop_to_post_pv(), multiple_pointer_assignment_to_post_pv(), safe_intrinsic_to_post_pv(), update_operator_to_post_pv(), and whileloop_to_post_pv().
void store_gen_pv | ( | statement | , |
cell_relations | |||
) |
void store_or_update_gen_pv | ( | statement | , |
cell_relations | |||
) |
void store_or_update_pv | ( | statement | , |
cell_relations | |||
) |
void store_pv | ( | statement | , |
cell_relations | |||
) |
Referenced by sequence_to_post_pv(), and statement_to_post_pv().
void update_gen_pv | ( | statement | , |
cell_relations | |||
) |
void update_pv | ( | statement | , |
cell_relations | |||
) |
Referenced by sequence_to_post_pv(), and statement_to_post_pv().