add an get_irg_idx
authorMatthias Braun <matze@braunis.de>
Thu, 8 Nov 2007 17:48:33 +0000 (17:48 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 8 Nov 2007 17:48:33 +0000 (17:48 +0000)
[r16490]

include/libfirm/irgraph.h
ir/ir/irgraph.c

index 98df80b..0d2ce3b 100644 (file)
@@ -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
 
 /**
index 103a763..c20c61f 100644 (file)
@@ -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 *