-void compute_ip_outs(ir_graph *irg) { /*irg_walk_func *pre, irg_walk_func *post, void *env) { */
- int i;
- ir_graph *rem = current_ir_graph;
- int rem_view = interprocedural_view;
-
- interprocedural_view = true;
-
- inc_max_irg_visited();
- /* Fix all irg_visited flags */
- for (i = 0; i < get_irp_n_irgs(); i++)
- set_irg_visited(get_irp_irg(i), get_max_irg_visited());
-
- /* Walk starting at unreachable procedures. Only these
- * have End blocks visible in interprocedural view. */
- for (i = 0; i < get_irp_n_irgs(); i++) {
- ir_node *sb;
- current_ir_graph = get_irp_irg(i);
-
- sb = get_irg_start_block(current_ir_graph);
-
- if ((get_Block_n_cfgpreds(sb) > 1) ||
- (get_nodes_block(get_Block_cfgpred(sb, 0)) != sb)) continue;
-
- compute_outs(current_ir_graph); /*cg_walk_2(get_irg_end(current_ir_graph), pre, post, env);*/
- }
-
- /* Check whether we walked all procedures: there could be procedures
- with cyclic calls but no call from the outside. */
- for (i = 0; i < get_irp_n_irgs(); i++) {
- ir_node *sb;
- current_ir_graph = get_irp_irg(i);
-
- /* Test start block: if inner procedure end and end block are not
- * visible and therefore not marked. */
- sb = get_irg_start_block(current_ir_graph);
- if (get_irn_visited(sb) < get_irg_visited(current_ir_graph)) {
- compute_outs(current_ir_graph); /*cg_walk_2(sb, pre, post, env); */
- }
- }
-
- /* Walk all endless loops in inner procedures.
- * We recognize an inner procedure if the End node is not visited. */
- for (i = 0; i < get_irp_n_irgs(); i++) {
- ir_node *e;
- current_ir_graph = get_irp_irg(i);
- e = get_irg_end(current_ir_graph);
- if (get_irn_visited(e) < get_irg_visited(current_ir_graph)) {
- /* Don't visit the End node. */
- /* int j;
- for (j = 0; j < get_End_n_keepalives(e); j++)
- cg_walk_2(get_End_keepalive(e, j), pre, post, env);*/
- compute_outs(current_ir_graph);
- }
- }
-
- interprocedural_view = rem_view;
- current_ir_graph = rem;
+/**
+ * Enter memory for the outs to a node. Handles special nodes
+ *
+ * @param irg the graph
+ * @param free current free address in the chunk allocated for the outs
+ *
+ * @return The next free address
+ */
+static ir_def_use_edge *set_out_edges(ir_graph *irg, ir_def_use_edge *free)
+{
+ ir_node *n;
+ int i;
+
+ inc_irg_visited(irg);
+ free = _set_out_edges(get_irg_end(irg), free);
+
+ /* handle anchored nodes */
+ for (i = anchor_last - 1; i >= 0; --i) {
+ n = get_irg_anchor(irg, i);
+ if (!irn_visited_else_mark(n)) {
+ size_t n_outs = PTR_TO_INT(n->out);
+ n->out = free;
+#ifdef DEBUG_libfirm
+ n->out_valid = 1;
+#endif /* defined DEBUG_libfirm */
+ free += n_outs;
+ }
+ }
+
+ return free;