- struct build_walker *w = data;
- INIT_LIST_HEAD(_get_irn_outs_head(irn, w->kind));
- _get_irn_edge_info(irn, w->kind)->out_count = 0;
+ struct build_walker *w = data;
+ ir_edge_kind_t kind = w->kind;
+ list_head *head = _get_irn_outs_head(irn, kind);
+ INIT_LIST_HEAD(head);
+ _get_irn_edge_info(irn, kind)->edges_built = 0;
+ _get_irn_edge_info(irn, kind)->out_count = 0;
+}
+
+/**
+ * Pre-Walker: initializes the list-heads and set the out-count
+ * of all nodes to 0.
+ *
+ * Additionally touches DEP nodes, as they might be DEAD.
+ * THIS IS UGLY, but I don't find a better way until we
+ *
+ * a) ensure that dead nodes are not used as input
+ * b) it might be sufficient to add those stupid NO_REG nodes
+ * to the anchor
+ */
+static void init_lh_walker_dep(ir_node *irn, void *data) {
+ struct build_walker *w = data;
+ ir_edge_kind_t kind = w->kind;
+ list_head *head = _get_irn_outs_head(irn, kind);
+ int i;
+
+ INIT_LIST_HEAD(head);
+ _get_irn_edge_info(irn, kind)->edges_built = 0;
+ _get_irn_edge_info(irn, kind)->out_count = 0;
+
+ for (i = get_irn_deps(irn) - 1; i >= 0; --i) {
+ ir_node *dep = get_irn_dep(irn, i);
+
+ head = _get_irn_outs_head(dep, kind);
+
+ INIT_LIST_HEAD(head);
+ _get_irn_edge_info(dep, kind)->edges_built = 0;
+ _get_irn_edge_info(dep, kind)->out_count = 0;
+ }