From 203717b8dd44597fb10c126b33a28528a2432e9c Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 8 Nov 2007 17:48:33 +0000 Subject: [PATCH] add an get_irg_idx [r16490] --- include/libfirm/irgraph.h | 2 +- ir/ir/irgraph.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/libfirm/irgraph.h b/include/libfirm/irgraph.h index 98df80b43..0d2ce3b86 100644 --- a/include/libfirm/irgraph.h +++ b/include/libfirm/irgraph.h @@ -278,7 +278,7 @@ int get_irg_n_locs (ir_graph *irg); #ifdef DEBUG_libfirm /** Returns the graph number. */ -long get_irg_graph_nr(ir_graph *irg); +long get_irg_graph_nr(const ir_graph *irg); #endif /** diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 103a7633a..c20c61fe7 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -413,14 +413,15 @@ int return _is_ir_graph(thing); } -/* Outputs a unique number for this node */ -long get_irg_graph_nr(ir_graph *irg) { - assert(irg); #ifdef DEBUG_libfirm +/* Outputs a unique number for this node */ +long get_irg_graph_nr(const ir_graph *irg) { return irg->graph_nr; -#else - return (long)PTR_TO_INT(irg); +} #endif + +int get_irg_idx(const ir_graph *irg) { + return irg->index; } ir_node * -- 2.20.1