PIPS
prettyprint.c File Reference
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "misc.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "effects.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "text.h"
#include "text-util.h"
#include "prettyprint.h"
#include "pointer_values.h"
+ Include dependency graph for prettyprint.c:

Go to the source code of this file.

Functions

text text_pv (entity __attribute__((unused)) module, int __attribute__((unused)) margin, statement s)
 
bool generic_print_code_pv (char *module_name, pv_context *ctxt)
 
bool print_code_simple_pointer_values (char *module_name)
 
void generic_print_code_gen_kill_pv (char *module_name)
 
bool print_code_simple_gen_kill_pointer_values (char *module_name)
 

Function Documentation

◆ generic_print_code_gen_kill_pv()

void generic_print_code_gen_kill_pv ( char *  module_name)
Parameters
module_nameodule_name

Definition at line 90 of file prettyprint.c.

91 {
93 }
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172

References module_name(), and pips_assert.

Referenced by print_code_simple_gen_kill_pointer_values().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generic_print_code_pv()

bool generic_print_code_pv ( char *  module_name,
pv_context ctxt 
)
Parameters
module_nameodule_name
ctxttxt

Definition at line 53 of file prettyprint.c.

54 {
55  bool success;
56 
58  db_get_memory_resource(DBR_CODE, module_name, true));
60 
62 
63  list l_in = (*ctxt->db_get_in_pv_func)(module_name);
64  list l_out = (*ctxt->db_get_in_pv_func)(module_name);
65 
67  text t = make_text(NIL);
68  MERGE_TEXTS(t, text_pointer_values(l_in, "IN Pointer values:"));
69  MERGE_TEXTS(t, text_pointer_values(l_out, "OUT Pointer values:"));
72  success = make_text_resource_and_free(module_name, DBR_PRINTED_FILE, ".pv", t);
74 
77  reset_pv();
78  return success;
79 }
text make_text(list a)
Definition: text.c:107
text text_pointer_values(list lpv, string header)
Definition: prettyprint.c:571
bool success
Definition: gpips-local.h:59
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
text text_pv(entity __attribute__((unused)) module, int __attribute__((unused)) margin, statement s)
Definition: prettyprint.c:46
void set_pv(statement_cell_relations)
void reset_pv(void)
void close_prettyprint()
because some prettyprint functions may be used for debug, so the last hook set by somebody may have s...
Definition: misc.c:242
void init_prettyprint(text(*hook)(entity, int, statement))
checks that the prettyprint hook was actually reset...
Definition: misc.c:231
text text_module(entity, statement)
bool make_text_resource_and_free(const char *, const char *, const char *, text)
Definition: print.c:82
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
list(* db_get_in_pv_func)(const char *)
statement_cell_relations(* db_get_pv_func)(const char *)
set to true for an initial module analysis
#define MERGE_TEXTS(r, t)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_code_simple_gen_kill_pointer_values()

bool print_code_simple_gen_kill_pointer_values ( char *  module_name)
Parameters
module_nameodule_name

Definition at line 95 of file prettyprint.c.

96 {
99  reset_pv_context(&ctxt);
100  return(true);
101 }
void generic_print_code_gen_kill_pv(char *module_name)
Definition: prettyprint.c:90
pv_context make_simple_pv_context(void)
void reset_pv_context(pv_context *)
pv_context is a structure holding the methods to use during pointer values analyses

References generic_print_code_gen_kill_pv(), make_simple_pv_context(), module_name(), and reset_pv_context().

+ Here is the call graph for this function:

◆ print_code_simple_pointer_values()

bool print_code_simple_pointer_values ( char *  module_name)
Parameters
module_nameodule_name

Definition at line 82 of file prettyprint.c.

83 {
86  reset_pv_context(&ctxt);
87  return success;
88 }
bool generic_print_code_pv(char *module_name, pv_context *ctxt)
Definition: prettyprint.c:53

References generic_print_code_pv(), make_simple_pv_context(), module_name(), and reset_pv_context().

+ Here is the call graph for this function:

◆ text_pv()

text text_pv ( entity __attribute__((unused))  module,
int __attribute__((unused))  margin,
statement  s 
)

Definition at line 46 of file prettyprint.c.

47 {
49 
50  return(text_pointer_values(lpv, "Pointer values:"));
51 }
#define cell_relations_list(x)
Definition: effects.h:549
cell_relations load_pv(statement)

References cell_relations_list, load_pv(), and text_pointer_values().

Referenced by generic_print_code_pv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: