PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "text.h"
#include "text-util.h"
#include "top-level.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "points_to_private.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "pipsdbm.h"
#include "workspace-util.h"
#include "effects-util.h"
#include "database.h"
#include "resources.h"
#include "properties.h"
#include "misc.h"
Go to the source code of this file.
Macros | |
#define | PT_TO_SUFFIX ".points_to" |
#define | PT_TO_DECO "points to = " |
#define | SUMMARY_PT_TO_SUFFIX ".summary_points_to" |
#define | SUMMARY_PT_TO_DECO "summary points to = " |
#define | append(s) add_to_current_line(line_buffer, s, str_prefix, tpv) |
Functions | |
list | effect_words_reference (reference obj) |
made from words_reference this function can print entity_name instead of entity_local_name, when the entity is not called in the current program. More... | |
string | effect_reference_to_string (reference ref) |
const char * | pips_region_user_name (entity ent) |
char * pips_region_user_name(entity ent) output : the name of entity. More... | |
static bool | variable_p (entity e) |
lready exist in cprettyprint but in mode static. More... | |
list | words_fictious_reference (reference obj) |
To modelize the heap locations we manufacture fictious reference, that triggered a bug when it appears as an argument of entity_user_name(). More... | |
list | points_to_words_reference (reference r) |
Specific handling of references appearing in points_to. More... | |
list | word_points_to (points_to pt) |
int | points_to_compare_cells (const void *vpt1, const void *vpt2) |
Comparison of two points-to arcs based on their source and sink nodes. More... | |
list | points_to_list_sort (list ptl) |
Allocate a copy of ptl and sort it. More... | |
list | words_points_to_list (__attribute__((unused)) string note, points_to_list s) |
Make sure that points-to are fully ordered before prettyprinting them or validation will be in trouble sooner or later. More... | |
list | words_pointer_value (cell_relation pv) |
string | approximation_to_string (approximation a) |
text | text_pointer_value (cell_relation pv) |
text text_region(effect reg) input : a region output : a text consisting of several lines of commentaries, representing the region modifies : nothing More... | |
text | text_pointer_values (list lpv, string header) |
void | print_pointer_value (cell_relation pv) |
void | print_pointer_values (list lpv) |
#define append | ( | s | ) | add_to_current_line(line_buffer, s, str_prefix, tpv) |
Definition at line 472 of file prettyprint.c.
#define PT_TO_DECO "points to = " |
Definition at line 202 of file prettyprint.c.
#define PT_TO_SUFFIX ".points_to" |
Definition at line 201 of file prettyprint.c.
#define SUMMARY_PT_TO_DECO "summary points to = " |
Definition at line 204 of file prettyprint.c.
#define SUMMARY_PT_TO_SUFFIX ".summary_points_to" |
Definition at line 203 of file prettyprint.c.
string approximation_to_string | ( | approximation | a | ) |
Definition at line 458 of file prettyprint.c.
References approximation_exact_p, approximation_may_p, approximation_must_p, pips_internal_error, and string_undefined.
Referenced by print_or_dump_points_to().
ref | ef |
Definition at line 155 of file prettyprint.c.
References effect_words_reference(), ref, and words_to_string().
Referenced by check_type_of_points_to_cells(), generic_eval_cell_with_points_to(), generic_transform_sink_cells_from_matching_list(), list_assignment_to_points_to(), offset_cell(), points_to_cell_to_string(), reference_dereferencing_to_points_to(), reference_to_points_to_sinks(), references_may_conflict_p(), and references_must_conflict_p().
made from words_reference this function can print entity_name instead of entity_local_name, when the entity is not called in the current program.
prettyprint.c
of string
obj | bj |
Definition at line 68 of file prettyprint.c.
References attach_reference_to_word_list(), CAR, CDR, CHAIN_SWORD, ENDP, entity_and_common_name(), entity_field_p(), entity_in_common_p(), entity_minimal_name(), entity_name, EXPRESSION, expression_syntax, gen_last(), gen_nconc(), get_bool_property(), get_prettyprint_language_tag(), is_language_c, is_language_fortran, is_language_fortran95, NIL, pips_internal_error, POP, reference_indices, reference_variable, STRING, string_undefined, syntax_reference, syntax_reference_p, and Words_Expression().
Referenced by conflicts_sort_callback(), effect_reference_first_pointer_dimension_rank(), effect_reference_to_string(), make_filtered_dg_or_dvdg(), prettyprint_dependence_graph(), prettyprint_dot_dependence_graph(), text_pointer_value(), text_points_to_relation(), text_region_no_action(), words_pointer_value(), and words_points_to().
const char* pips_region_user_name | ( | entity | ent | ) |
char * pips_region_user_name(entity ent) output : the name of entity.
modifies : nothing. comment : allows to "catch" the PHIs entities, else, it works like pips_user_value_name() (see semantics.c).
external_value_name cannot be used because there is no need for the #new suffix, but the #old one is necessary
take care of the constant term TCST
ent is a PHI entity from the regions module
if (!hash_entity_to_values_undefined_p() && !entity_has_values_p(ent))
name = external_value_name(ent);
else
ent | nt |
Definition at line 169 of file prettyprint.c.
References entity_local_name(), entity_minimal_name(), entity_name, and REGIONS_MODULE_NAME.
Referenced by copy_write_statement_with_cumulated_regions(), reg_sc_debug(), reg_v_debug(), text_pointer_value(), text_points_to_relation(), and text_region_no_action().
int points_to_compare_cells | ( | const void * | vpt1, |
const void * | vpt2 | ||
) |
Comparison of two points-to arcs based on their source and sink nodes.
This comparison function is used to sort a list of points-to before storage and print-out.
It must return -1, 0 or 1 like strcmp(). It should avoid 0 because we want a total order to avoid validation problems. Hence the exploitation of the references, number of indices, subscript expressions, etc. if the entity names are not sufficient to disambiguate the references.
When subscript expressions are used, fields are replaced by the corresponding field number. So the sort is based on the field ranks in the data structure and not on the the field names.
For abstract locations, the local name is used for the sort and the global names is sometimes used in the prettyprint. Hence, the alphabetical order is not obvious in the print-out.
vpt1 | pt1 |
vpt2 | pt2 |
Definition at line 295 of file prettyprint.c.
References CAR, cell_to_reference(), ENDP, entity_abstract_location_p(), entity_local_name(), entity_minimal_user_name(), EXPRESSION, expression_constant_p(), expression_to_int(), expression_to_string(), gen_length(), NIL, points_to_sink, points_to_source, POP, reference_indices, reference_variable, and s1.
Referenced by fi_points_to_storage(), init_points_to_analysis(), points_to_list_sort(), and points_to_storage().
Allocate a copy of ptl and sort it.
It might be better to admit a side effect on ptl and to let the caller copy the liste before sorting.
(gen_cmp_func_t)
ptl | tl |
Definition at line 389 of file prettyprint.c.
References gen_full_copy_list(), gen_sort_list(), and points_to_compare_cells().
Referenced by text_points_to_relations(), and words_points_to_list().
Specific handling of references appearing in points_to.
Definition at line 232 of file prettyprint.c.
References entity_minimal_user_name(), NIL, and Words_Any_Reference().
Referenced by word_points_to().
void print_pointer_value | ( | cell_relation | pv | ) |
pv | v |
Definition at line 615 of file prettyprint.c.
References free_text(), print_text(), and text_pointer_value().
Referenced by print_pointer_values().
void print_pointer_values | ( | list | lpv | ) |
lpv | pv |
Definition at line 622 of file prettyprint.c.
References CELL_RELATION, ENDP, FOREACH, fprintf(), and print_pointer_value().
Referenced by print_pv_results().
text text_pointer_value | ( | cell_relation | pv | ) |
text text_region(effect reg) input : a region output : a text consisting of several lines of commentaries, representing the region modifies : nothing
of string
PREFIX
REFERENCES
DESCRIPTOR
sorts in such a way that constraints with phi variables come first.
APPROXIMATION
CLOSE
pv | v |
Definition at line 480 of file prettyprint.c.
References append, approximation_may_p, cell_gap_p, cell_preference_p, cell_reference, cell_relation_approximation, cell_relation_descriptor, cell_relation_first_cell, cell_relation_first_value_of_p, cell_relation_second_address_of_p, cell_relation_second_cell, cell_relation_undefined_p, close_current_line(), concatenate(), CONS, descriptor_convex, descriptor_none_p, effect_words_reference(), FOREACH, gen_free_string_list(), get_comment_continuation(), get_comment_sentinel(), ifdebug, is_inferior_cell_descriptor_pvarval(), is_sentence_formatted, line_buffer, make_sentence(), make_text(), MAX_LINE_LENGTH, NIL, pips_assert, pips_region_user_name(), pips_user_warning, sc_copy(), sc_lexicographic_sort(), sc_rm(), SENTENCE, strdup(), STRING, system_sorted_text_format(), text_undefined, and vect_contains_phi_p().
Referenced by print_pointer_value(), and text_pointer_values().
in case of loose_prettyprint, at least one region to print?
GO: No redundant test anymore, see text_statement_array_regions
header first
lpv | pv |
header | eader |
Definition at line 571 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, append, CELL_RELATION, ENDP, FOREACH, gen_sort_list(), get_bool_property(), get_comment_continuation(), get_comment_sentinel(), HASH_UNDEFINED_VALUE, is_sentence_formatted, line_buffer, list_undefined, make_sentence(), make_text(), MAX_LINE_LENGTH, MERGE_TEXTS, NIL, pointer_value_compare(), strdup(), and text_pointer_value().
Referenced by generic_print_code_pv(), and text_pv().
lready exist in cprettyprint but in mode static.
To be removed later.
Definition at line 207 of file prettyprint.c.
References entity_type, and type_undefined_p.
Referenced by gfc2pips_test_variable(), and word_points_to().
pt | t |
Definition at line 242 of file prettyprint.c.
References approximation_exact_p, cell_to_reference(), CONS, gen_nconc(), NIL, pips_assert, points_to_approximation, points_to_consistent_p(), points_to_sink, points_to_source, points_to_undefined_p, points_to_words_reference(), reference_variable, strdup(), STRING, variable_p(), and words_fictious_reference().
Referenced by generic_reference_to_points_to_matching_list(), generic_transform_sink_cells_from_matching_list(), and words_points_to_list().
To modelize the heap locations we manufacture fictious reference, that triggered a bug when it appears as an argument of entity_user_name().
obj | bj |
Definition at line 215 of file prettyprint.c.
References CHAIN_SWORD, entity_name, NIL, and reference_variable.
Referenced by word_points_to().
list words_pointer_value | ( | cell_relation | pv | ) |
pv | v |
Definition at line 428 of file prettyprint.c.
References approximation_exact_p, approximation_may_p, cell_gap_p, cell_preference_p, cell_reference, cell_relation_approximation, cell_relation_first_cell, cell_relation_first_value_of_p, cell_relation_second_cell, CHAIN_SWORD, effect_words_reference(), gen_nconc(), NIL, and pips_assert.
list words_points_to_list | ( | __attribute__((unused)) string | note, |
points_to_list | s | ||
) |
Make sure that points-to are fully ordered before prettyprinting them or validation will be in trouble sooner or later.
The sort could occur before storing the points-to information into the hash table or just before prettypriting it.
Definition at line 403 of file prettyprint.c.
References CONS, FOREACH, gen_full_free_list(), gen_nconc(), NIL, POINTS_TO, points_to_list_list, points_to_list_sort(), strdup(), STRING, and word_points_to().