Make get_idx_irn(irg, idx) public (useful for debugging purposes)
authorMoritz Kroll <Moritz.Kroll@gmx.de>
Thu, 25 Dec 2008 22:03:24 +0000 (22:03 +0000)
committerMoritz Kroll <Moritz.Kroll@gmx.de>
Thu, 25 Dec 2008 22:03:24 +0000 (22:03 +0000)
[r24894]

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

index f4f21a9..e970e10 100644 (file)
@@ -287,6 +287,16 @@ long     get_irg_graph_nr(const ir_graph *irg);
  */
 int get_irg_idx(const ir_graph *irg);
 
+/**
+ * Get the node for an index.
+ * @param irg The graph.
+ * @param idx The index you want the node for.
+ * @return    The node with that index or NULL, if there is no node with that index.
+ * @note      The node you got might be dead.
+ */
+ir_node *get_idx_irn(ir_graph *irg, unsigned idx);
+
+
 /********************************************************************************/
 /* States of an ir_graph.                                                       */
 /********************************************************************************/
index deb76bd..23a53c0 100644 (file)
@@ -584,6 +584,10 @@ int get_irg_idx(const ir_graph *irg) {
        return irg->index;
 }
 
+ir_node *(get_idx_irn)(ir_graph *irg, unsigned idx) {
+       return _get_idx_irn(irg, idx);
+}
+
 ir_node *
 (get_irg_start_block)(const ir_graph *irg) {
        return _get_irg_start_block(irg);
index 4675dfc..7c941d1 100644 (file)
@@ -494,7 +494,7 @@ irg_kill_node(ir_graph *irg, ir_node *n) {
  * @note      The node you got might be dead.
  */
 static inline ir_node *
-get_idx_irn(ir_graph *irg, unsigned idx) {
+_get_idx_irn(ir_graph *irg, unsigned idx) {
        assert(idx < (unsigned) ARR_LEN(irg->idx_irn_map));
        return irg->idx_irn_map[idx];
 }
@@ -600,5 +600,6 @@ _get_interprocedural_view(void) {
 #define dec_irg_block_visited(irg)            _dec_irg_block_visited(irg)
 #define get_irg_estimated_node_cnt(irg)       _get_irg_estimated_node_cnt(irg)
 #define get_irg_fp_model(irg)                 _get_irg_fp_model(irg)
+#define get_idx_irn(irg, idx)                 _get_idx_irn(irg, idx)
 
 #endif