Fixed some 64bit warnings because of mixing size_t and other types.
[libfirm] / ir / ir / iredges_t.h
index ced4650..13c8071 100644 (file)
 /**
  * An edge.
  */
-struct _ir_edge_t {
-  ir_node  *src;          /**< The source node of the edge. */
-  int      pos;           /**< The position of the edge at @p src. */
-  unsigned invalid : 1;   /**< edges that are removed are marked invalid. */
-  unsigned present : 1;   /**< Used by the verifier. Don't rely on its content. */
-  unsigned kind    : 4;   /**< The kind of the edge. */
-  struct list_head list;  /**< The list head to queue all out edges at a node. */
+struct ir_edge_t {
+       ir_node  *src;          /**< The source node of the edge. */
+       int      pos;           /**< The position of the edge at @p src. */
+       unsigned invalid : 1;   /**< edges that are removed are marked invalid. */
+       unsigned present : 1;   /**< Used by the verifier. Don't rely on its content. */
+       unsigned kind    : 4;   /**< The kind of the edge. */
+       struct list_head list;  /**< The list head to queue all out edges at a node. */
 #ifdef DEBUG_libfirm
-  long src_nr;            /**< The node number of the source node. */
-  long edge_nr;           /**< A unique number identifying the edge. */
+       long src_nr;            /**< The node number of the source node. */
+       long edge_nr;           /**< A unique number identifying the edge. */
 #endif
 };
 
@@ -78,7 +78,9 @@ struct _ir_edge_t {
 */
 static inline const ir_edge_t *_get_irn_out_edge_first_kind(const ir_node *irn, ir_edge_kind_t kind)
 {
-       const struct list_head *head = _get_irn_outs_head(irn, kind);
+       const struct list_head *head;
+       assert(edges_activated_kind(get_irn_irg(irn), kind));
+       head = _get_irn_outs_head(irn, kind);
        return list_empty(head) ? NULL : list_entry(head->next, ir_edge_t, list);
 }
 
@@ -122,7 +124,7 @@ static inline int _edges_activated_kind(const ir_graph *irg, ir_edge_kind_t kind
 * Assure, that the edges information is present for a certain graph.
 * @param irg The graph.
 */
-static inline void _edges_assure_kind(ir_graph *irg, int kind)
+static inline void _edges_assure_kind(ir_graph *irg, ir_edge_kind_t kind)
 {
        if(!_edges_activated_kind(irg, kind))
                edges_activate_kind(irg, kind);
@@ -131,15 +133,9 @@ static inline void _edges_assure_kind(ir_graph *irg, int kind)
 void edges_init_graph_kind(ir_graph *irg, ir_edge_kind_t kind);
 
 /**
-* Notify of a edge change.
-* The edge from (src, pos) -> old_tgt is redirected to tgt
-*/
-void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt, ir_node *old_tgt, ir_edge_kind_t kind, ir_graph *irg);
-
-/**
-* A node is deleted.
-*/
-void edges_node_deleted(ir_node *old, ir_graph *irg);
+ * A node might be revivaled by CSE.
+ */
+void edges_node_revival(ir_node *node, ir_graph *irg);
 
 void edges_invalidate_kind(ir_node *irn, ir_edge_kind_t kind, ir_graph *irg);
 
@@ -181,12 +177,13 @@ static inline int _get_edge_src_pos(const ir_edge_t *edge)
 */
 extern void init_edges(void);
 
+void edges_invalidate_all(ir_node *irn, ir_graph *irg);
+
 /**
- * Set dbg information for edges.
+ * Helper function to dump the edge set of a graph,
+ * unused in normal code.
  */
-void edges_init_dbg(int do_dbg);
-
-void edges_invalidate_all(ir_node *irn, ir_graph *irg);
+void edges_dump_kind(ir_graph *irg, ir_edge_kind_t kind);
 
 #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)