- for(i = 0; i < n; ++i) {
- struct _be_lv_info_node_t *n = &info[i+1].u.node;
- ir_fprintf(f, "%s %+F\n", lv_flags_to_str(n->flags), get_idx_irn(lv->irg, n->idx));
- }
- }
+ be_timer_push(T_LIVE);
+ last_idx = get_irg_last_idx(lv->irg);
+ if (last_idx >= bitset_size(lv->nodes)) {
+ bitset_free(lv->nodes);
+ lv->nodes = bitset_malloc(last_idx * 2);
+ } else {
+ bitset_clear_all(lv->nodes);
+ }
+ ir_nodehashmap_init(&lv->map);
+ obstack_init(&lv->obst);
+
+ n = get_irg_last_idx(lv->irg);
+ nodes = NEW_ARR_F(ir_node *, n);
+ memset(nodes, 0, sizeof(nodes[0]) * n);
+
+ /* inserting the variables sorted by their ID is probably
+ * more efficient since the binary sorted set insertion
+ * will not need to move around the data. */
+ irg_walk_graph(lv->irg, NULL, collect_liveness_nodes, nodes);
+
+ re.lv = lv;
+ re.visited = bitset_malloc(n);
+
+ for (i = 0; i < n; ++i) {
+ if (nodes[i] != NULL)
+ liveness_for_node(nodes[i]);