PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "text.h"
#include "text-util.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "properties.h"
#include "misc.h"
#include "prettyprint.h"
#include "semantics.h"
#include "points-to.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, tpt_to) |
#define append | ( | s | ) | add_to_current_line(line_buffer, s, str_prefix, tpt_to) |
Definition at line 245 of file points_to_prettyprint.c.
#define PT_TO_DECO "points to = " |
Definition at line 57 of file points_to_prettyprint.c.
#define PT_TO_SUFFIX ".points_to" |
Definition at line 56 of file points_to_prettyprint.c.
#define SUMMARY_PT_TO_DECO "summary points to = " |
Definition at line 59 of file points_to_prettyprint.c.
#define SUMMARY_PT_TO_SUFFIX ".summary_points_to" |
Definition at line 58 of file points_to_prettyprint.c.
bool print_code_points_to | ( | const char * | module_name, |
string resource_name | __attribute__(__unused__), | ||
string | file_suffix | ||
) |
bool print_code_points_to(const char* module_name,
string resource_name attribute ((unused)), string file_suffix) { list wl = list_undefined; text t, st = text_undefined; bool res; debug_on("POINTS_TO_DEBUG_LEVEL"); set_current_module_entity(local_name_to_top_level_entity(module_name)); points_to_list summary_pts_to = (points_to_list) db_get_memory_resource(DBR_SUMMARY_POINTS_TO_LIST, module_name, true); wl = words_points_to_list(PT_TO_DECO, summary_pts_to); pips_debug(1, "considering module %s \n", module_name); /* FI: just for debugging *\/ // check_abstract_locations(); set_printed_points_to_list((statement_points_to) db_get_memory_resource(DBR_POINTS_TO_LIST, module_name, true)); statement_points_to_consistent_p(get_printed_points_to_list()); set_current_module_statement((statement) db_get_memory_resource(DBR_CODE, module_name, true)); // FI: should be language neutral... st = words_predicate_to_commentary(wl, get_comment_sentinel()); t = text_code_points_to(get_current_module_statement()); MERGE_TEXTS(st, t); res= make_text_resource_and_free(module_name,DBR_PRINTED_FILE,file_suffix, st); reset_current_module_entity(); reset_current_module_statement(); reset_printed_points_to_list(); debug_off(); return true; }
Load IN pts-to
Load OUT pts-to
FI: just for debugging
statement_points_to_consistent_p(get_printed_points_to_list());
text sum_tex = text_points_to_relations(l_sum_pt_to, "Points To:");
Definition at line 131 of file points_to_prettyprint.c.
References close_prettyprint(), db_get_memory_resource(), debug_off, debug_on, get_current_module_entity(), get_current_module_statement(), init_prettyprint(), local_name_to_top_level_entity(), make_text(), make_text_resource_and_free(), MERGE_TEXTS, module_name(), NIL, pips_debug, reset_current_module_entity(), reset_current_module_statement(), reset_printed_points_to_list(), set_current_module_entity(), set_current_module_statement(), set_printed_points_to_list(), text_module(), text_points_to_relations(), and text_pt_to().
Referenced by print_code_points_to_list().
bool print_code_points_to_list | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 202 of file points_to_prettyprint.c.
References module_name(), print_code_points_to(), and PT_TO_SUFFIX.
void print_points_to_graph | ( | points_to_graph | ptg | ) |
ptg | tg |
Definition at line 190 of file points_to_prettyprint.c.
References fprintf(), ok, points_to_graph_bottom, points_to_graph_set, and print_points_to_set().
void print_points_to_list | ( | points_to_list | ptl | ) |
ptl | tl |
Definition at line 183 of file points_to_prettyprint.c.
References free_text(), print_text(), and text_points_to_relations().
void print_points_to_relation | ( | points_to | pt_to | ) |
print a points-to arc, print_points_to() or print_points_to_arc()
pt_to | t_to |
Definition at line 399 of file points_to_prettyprint.c.
References free_text(), print_text(), and text_points_to_relation().
Referenced by print_points_to_relations().
void print_points_to_relations | ( | list | l_pt_to | ) |
print a list of points-to arcs
l_pt_to | _pt_to |
Definition at line 407 of file points_to_prettyprint.c.
References ENDP, FOREACH, fprintf(), POINTS_TO, and print_points_to_relation().
Definition at line 84 of file points_to_prettyprint.c.
References close_prettyprint(), debug_off, debug_on, get_current_module_entity(), init_prettyprint(), text_module(), and text_points_to().
text text_points_to | ( | entity module | __attribute__(__unused__), |
int margin | __attribute__(__unused__), | ||
statement | s | ||
) |
Definition at line 66 of file points_to_prettyprint.c.
References bound_printed_points_to_list_p(), CONS, get_comment_sentinel(), load_printed_points_to_list(), NIL, PT_TO_DECO, strdup(), STRING, words_points_to_list(), and words_predicate_to_commentary().
Referenced by text_code_points_to().
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
Change nowhere cells into undefined to comply with the C standard
if (points_to_second_address_of_p(pt_to))
append("&");
DESCRIPTOR
sorts in such a way that constraints with phi variables come first.
APPROXIMATION
CLOSE
pt_to | t_to |
Definition at line 253 of file points_to_prettyprint.c.
References append, approximation_may_p, cell_gap_p, cell_preference_p, cell_reference, close_current_line(), concatenate(), CONS, descriptor_convex, descriptor_none_p, effect_words_reference(), entity_typed_nowhere_locations_p(), 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, points_to_approximation, points_to_descriptor, points_to_sink, points_to_source, points_to_undefined_p, reference_variable, sc_copy(), sc_lexicographic_sort(), sc_rm(), SENTENCE, strdup(), STRING, system_sorted_text_format(), text_undefined, and vect_contains_phi_p().
Referenced by print_points_to_relation(), and text_points_to_relations().
text text_points_to_relations | ( | points_to_list | ptl, |
string | header | ||
) |
in case of loose_prettyprint, at least one region to print?
GO: No redundant test anymore, see text_statement_array_regions
header first
ptl | tl |
header | eader |
Definition at line 349 of file points_to_prettyprint.c.
References ADD_SENTENCE_TO_TEXT, append, ENDP, FOREACH, 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, points_to_list_bottom, points_to_list_list, points_to_list_sort(), strdup(), and text_points_to_relation().
Referenced by print_code_points_to(), print_points_to_list(), and text_pt_to().
text text_pt_to | ( | entity __attribute__((unused)) | module_name, |
int __attribute__((unused)) | margin, | ||
statement | s | ||
) |
Definition at line 422 of file points_to_prettyprint.c.
References load_printed_points_to_list(), and text_points_to_relations().
Referenced by print_code_points_to().
pt | t |
Definition at line 210 of file points_to_prettyprint.c.
References approximation_exact_p, approximation_may_p, cell_gap_p, cell_preference_p, cell_reference, CHAIN_SWORD, CONS, effect_words_reference(), gen_nconc(), NIL, nowhere_cell_p(), pips_assert, points_to_approximation, points_to_sink, points_to_source, and STRING.