Commit dc38d746 authored by Till Riedel's avatar Till Riedel
Browse files

ir_dump now outputs unique numbers for types, entitys and graphs instead of address

[r815]
parent d9872784
This diff is collapsed.
......@@ -126,6 +126,10 @@ new_ir_graph (entity *ent, int n_loc)
res->frame = new_Proj (res->start, mode_P, pns_frame_base);
res->globals = new_Proj (res->start, mode_P, pns_globals);
res->args = new_Proj (res->start, mode_T, pns_args);
#ifdef DEBUG_libfirm
res->graph_nr = get_irp_new_node_nr();
#endif
add_in_edge(res->start_block, projX);
/*
......@@ -208,6 +212,18 @@ void free_ir_graph (ir_graph *irg) {
{attr type} get_irg_{attribute name} (ir_graph *irg);
void set_irg_{attr name} (ir_graph *irg, {attr type} {attr}); */
/* Outputs a unique number for this node */
INLINE long
get_irg_graph_nr(ir_graph *irg) {
assert(irg);
#ifdef DEBUG_libfirm
return irg->graph_nr;
#else
return 0;
#endif
}
ir_node *
get_irg_start_block (ir_graph *irg)
{
......
......@@ -72,8 +72,14 @@ struct ir_graph {
every time someone walks through
the graph */
unsigned long block_visited; /**< same as visited, for a complete block */
#ifdef DEBUG_libfirm
int graph_nr; /**< a unique graph number for each graph to make output
readable. */
#endif
};
INLINE long get_irg_graph_nr(ir_graph *irg) ;
/** Make a rudimentary ir graph for the constant code.
Must look like a correct irg, spare everything else. */
ir_graph *new_const_code_irg(void);
......
......@@ -15,6 +15,10 @@
# ifndef _IRNODE_T_H_
# define _IRNODE_T_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
# include "irnode.h"
# include "xprintf.h"
# include "irop_t.h"
......
......@@ -8,9 +8,14 @@
# ifndef _IRPROG_T_H_
# define _IRPROG_T_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "irprog.h"
#include "firm_common_t.h"
/** ir_prog */
struct ir_prog {
firm_kind kind;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment