PIPS
|
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "properties.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "text-util.h"
#include "effects-simple.h"
#include "pips-libs.h"
#include "transformer.h"
Go to the source code of this file.
list expression_to_points_to_sinks | ( | _UNUSED_ expression | e, |
_UNUSED_ points_to_graph | in | ||
) |
Definition at line 63 of file points_to.c.
References NIL, and pips_internal_error.
Referenced by semantics_expression_to_points_to_sinks().
list expression_to_points_to_sources | ( | _UNUSED_ expression | e, |
_UNUSED_ points_to_graph | in | ||
) |
Definition at line 71 of file points_to.c.
References NIL, and pips_internal_error.
Referenced by semantics_expression_to_points_to_sources().
points_to_graph get_points_to_graph_from_statement | ( | _UNUSED_ statement | st | ) |
Interface with points-to library.
Definition at line 56 of file points_to.c.
References pips_internal_error.
Referenced by new_substitute_stubs_in_transformer(), semantics_expression_to_points_to_sinks(), semantics_expression_to_points_to_sources(), and substitute_stubs_in_transformer().
transformer new_substitute_stubs_in_transformer | ( | transformer | tf, |
call | c, | ||
statement | s, | ||
bool | backward_p | ||
) |
This leads to an empty transformer because the statement is unreachable. Some kind of dereferencement error has occured earlier in the execution
tf | f |
backward_p | ackward_p |
Definition at line 417 of file points_to.c.
References free_points_to_graph(), free_transformer(), get_points_to_graph_from_statement(), make_points_to_graph(), points_to_graph_bottom, pt_to_list_undefined_p(), substitute_stubs_in_transformer_with_translation_binding(), transformer_empty(), and user_call_to_points_to_interprocedural_binding_set().
Referenced by c_user_call_to_transformer().
The sources of the relevant points-to.
Definition at line 226 of file points_to.c.
References cell_any_reference(), gen_in_list_p(), points_to_sink, and reference_variable.
Referenced by substitute_stubs_in_transformer().
list semantics_expression_to_points_to_sinks | ( | expression | e | ) |
Returns a list of cells.
Definition at line 112 of file points_to.c.
References CELL, CONS, expression_to_points_to_sinks(), get_current_statement_from_statement_global_stack(), get_points_to_graph_from_statement(), list_undefined, make_anywhere_points_to_cell(), NIL, points_to_expression_to_concrete_type(), and pt_to_list_undefined_p().
Referenced by generic_unary_operation_to_transformer(), and points_to_unary_operation_to_transformer().
list semantics_expression_to_points_to_sources | ( | expression | e | ) |
Special wrapping for the semantics analyses.
points_to.c
FI: check if new cells are allocated to build the returned location list ll...
Definition at line 94 of file points_to.c.
References expression_to_points_to_sources(), get_current_statement_from_statement_global_stack(), get_points_to_graph_from_statement(), points_to_graph_undefined, pt_to_list_undefined_p(), and statement_undefined_p.
Referenced by any_assign_to_transformer(), any_basic_update_to_transformer(), any_update_to_transformer(), lhs_expression_to_transformer(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), and struct_reference_assignment_or_equality_to_transformer().
transformer substitute_scalar_stub_in_transformer | ( | transformer | tf, |
entity | se, | ||
entity | de, | ||
bool | backward_p, | ||
list * | ppl | ||
) |
If both "se", source entity, and "de", destination entity, are defined, substitute the values of "se" by the values of "de" in "backward_p" mode, when translating a callee transformer at a call site of a caller.
If the "se" entity cannot be substituted, its value must be project.
tf | f |
se | e |
de | e |
backward_p | ackward_p |
ppl | pl |
Definition at line 136 of file points_to.c.
References CONS, ENTITY, entity_has_values_p(), entity_is_argument_p(), entity_to_new_value(), entity_to_old_value(), entity_undefined_p, entity_user_name(), global_new_value_to_global_old_value(), pips_user_warning, transformer_arguments, and transformer_value_substitute().
Referenced by forward_substitute_array_location_in_transformer(), new_array_element_backward_substitution_in_transformer(), substitute_struct_stub_in_transformer(), and substitute_stubs_in_transformer().
transformer substitute_struct_stub_in_transformer | ( | transformer | t, |
reference | l, | ||
type | lt, | ||
reference | r, | ||
type rt | __attribute__(unused), | ||
bool | backward_p, | ||
list * | ppl | ||
) |
Definition at line 175 of file points_to.c.
References add_subscript_to_reference(), analyzed_type_p(), array_type_p(), constant_memory_access_path_to_location_entity(), copy_reference(), ENTITY, entity_basic_concrete_type(), entity_to_expression(), entity_undefined_p, f(), FOREACH, free_reference(), int_to_expression(), struct_type_to_fields(), substitute_scalar_stub_in_transformer(), and type_struct_variable_p().
Referenced by substitute_stubs_in_transformer().
transformer substitute_stubs_in_transformer | ( | transformer | tf, |
call | c, | ||
statement | s, | ||
bool | backward_p | ||
) |
Exploit the binding map to substitute calles's stubs by actual arguments, which may be stubs of the callers,.
backward_p request a substitution from the callees' frame into the caller's frame, which is useful for transformers. Flag backward_p is set to false to compute summary preconditions.
FI: this function is now only used for preconditions. It has been rewritten for transformers to speed up the process when array elements are involved. It is better to start from the needs, the stubs used in the transformer, than from all possible stubs, but it is much easier for a backward translation. With a forward translation, regular variables may have to be translated into stubs.
FI: A quick improvement would to return when no translation is needed... but you do not always know it when backward_p is set to false.
tf | f |
backward_p | ackward_p |
Definition at line 256 of file points_to.c.
References analyzed_reference_p(), approximation_exact_p, approximation_must_p, atomic_points_to_reference_p(), cell_any_reference(), compute_basic_concrete_type(), CONS, constant_memory_access_path_to_location_entity(), ENDP, ENTITY, entity_basic_concrete_type(), entity_has_values_p(), entity_undefined_p, gen_free_list(), get_current_module_entity(), get_points_to_graph_from_statement(), NIL, pips_internal_error, pl, points_to_approximation, points_to_graph_bottom, points_to_sink, points_to_source, pt_to_list_undefined_p(), reference_indices, reference_to_type(), reference_variable, relevant_translation_pair_p(), safe_transformer_projection(), SET_FOREACH, substitute_scalar_stub_in_transformer(), substitute_struct_stub_in_transformer(), transformer_to_analyzed_locations(), transformer_to_potential_stub_translation(), type_struct_variable_p(), and user_call_to_points_to_interprocedural_binding_set().
Referenced by process_call_for_summary_precondition().
|
static |
Definition at line 375 of file points_to.c.
References CELL, cell_any_reference(), constant_memory_access_path_to_location_entity(), ENTITY, entity_basic_concrete_type(), entity_initial, entity_is_argument_p(), entity_to_new_value(), entity_to_old_value(), entity_undefined_p, external_entity_to_new_value(), external_entity_to_old_value(), FOREACH, gen_free_list(), generic_atomic_points_to_reference_p(), NIL, pips_assert, points_to_reference_to_concrete_type(), reference_indices, reference_to_points_to_translations(), reference_variable, transformer_arguments, transformer_to_analyzed_locations(), transformer_value_substitute(), type_equal_p(), value_reference, and value_reference_p.
Referenced by new_substitute_stubs_in_transformer().
Compute the binding relations in a complete interprocedural way: be as accurate as possible.
This piece of code has been copied from user_call_to_points_to_interprocedural(), which should be modularized...
Not much to do if both IN and OUT are empty, except if OUT is bottom (see below)
For the side effect on binding
set pt_in_filtered =
filter_formal_context_according_to_actual_context(fpcl,
pt_in,
pt_binded,
binding);
pt_caller | t_caller |
Definition at line 79 of file points_to.c.
References NIL, and pips_internal_error.
Referenced by new_substitute_stubs_in_transformer(), and substitute_stubs_in_transformer().