rbitset: Let rbitset_alloca() return the new raw bitset.
[libfirm] / ir / ir / iredges_t.h
index ae20797..8315ca1 100644 (file)
@@ -22,7 +22,6 @@
  * @brief   Everlasting outs -- private header.
  * @author  Sebastian Hack, Andreas Schoesser
  * @date    15.01.2005
- * @version $Id$
  */
 #ifndef FIRM_IR_EDGES_T_H
 #define FIRM_IR_EDGES_T_H
@@ -104,7 +103,7 @@ static inline const ir_edge_t *get_irn_out_edge_next_(const ir_node *irn, const
 {
        struct list_head *next = last->list.next;
        const struct list_head *head
-               = &get_irn_edge_info_const(irn, last->kind)->outs_head;
+               = &get_irn_edge_info_const(irn, (ir_edge_kind_t)last->kind)->outs_head;
        return next == head ? NULL : list_entry(next, ir_edge_t, list);
 }
 
@@ -113,7 +112,7 @@ static inline const ir_edge_t *get_irn_out_edge_next_(const ir_node *irn, const
  * @param irn The node.
  * @return The number of edges pointing to this node.
  */
-static inline int get_irn_n_edges_kind_(const ir_node *irn, int kind)
+static inline int get_irn_n_edges_kind_(const ir_node *irn, ir_edge_kind_t kind)
 {
        return get_irn_edge_info_const(irn, kind)->out_count;
 }
@@ -135,6 +134,8 @@ static inline void edges_assure_kind_(ir_graph *irg, ir_edge_kind_t kind)
 
 void edges_init_graph_kind(ir_graph *irg, ir_edge_kind_t kind);
 
+void edges_node_deleted(ir_node *irn);
+
 /**
  * A node might be revivaled by CSE.
  */
@@ -142,28 +143,6 @@ void edges_node_revival(ir_node *node);
 
 void edges_invalidate_kind(ir_node *irn, ir_edge_kind_t kind);
 
-/**
- * Register additional memory in an edge.
- * This must be called before Firm is initialized.
- * @param  n Number of bytes you need.
- * @return A number you have to keep and to pass
- *         edges_get_private_data()
- *         to get a pointer to your data.
- */
-size_t edges_register_private_data(size_t n);
-
-/**
- * Get a pointer to the private data you registered.
- * @param  edge The edge.
- * @param  ofs  The number, you obtained with
- *              edges_register_private_data().
- * @return A pointer to the private data.
- */
-static inline void *get_edge_private_data_(const ir_edge_t *edge, int ofs)
-{
-       return (void *) ((char *) edge + sizeof(edge[0]) + ofs);
-}
-
 static inline ir_node *get_edge_src_irn_(const ir_edge_t *edge)
 {
        return edge->src;
@@ -174,6 +153,17 @@ static inline int get_edge_src_pos_(const ir_edge_t *edge)
        return edge->pos;
 }
 
+/**
+ * Returns the edge object of an outgoing edge at a node.
+ * @param  irn  The node at which the edge originates.
+ * @param  pos  The position of the edge.
+ * @param  kind The kind of the edge.
+ * @return      The corresponding edge object or NULL,
+ *              if no such edge exists.
+ */
+FIRM_API const ir_edge_t *get_irn_edge_kind(const ir_node *irn,
+                                            int pos, ir_edge_kind_t kind);
+
 /**
  * Initialize the out edges.
  * This must be called before firm is initialized.
@@ -197,7 +187,6 @@ void edges_notify_edge(ir_node *src, int pos, ir_node *tgt,
 #define get_irn_n_edges_kind(irn, kind)   get_irn_n_edges_kind_(irn, kind)
 #define get_edge_src_irn(edge)            get_edge_src_irn_(edge)
 #define get_edge_src_pos(edge)            get_edge_src_pos_(edge)
-#define get_edge_private_data(edge, ofs)  get_edge_private_data_(edge,ofs)
 #define get_irn_out_edge_next(irn, last)  get_irn_out_edge_next_(irn, last)
 
 #ifndef get_irn_n_edges