Restored somehow lost AMD Family 11h support.
[libfirm] / ir / ana / irouts.c
index 815977b..742f108 100644 (file)
@@ -306,7 +306,7 @@ static int _count_outs(ir_node *n)
        int start, i, res, irn_arity;
 
        mark_irn_visited(n);
-       n->out = INT_TO_PTR(1);     /* Space for array size. */
+       n->out = (ir_def_use_edge*) INT_TO_PTR(1);     /* Space for array size. */
 
        start = is_Block(n) ? 0 : -1;
        irn_arity = get_irn_arity(n);
@@ -326,7 +326,7 @@ static int _count_outs(ir_node *n)
                        res += _count_outs(skipped_pred);
 
                /*count my Def-Use edges */
-               skipped_pred->out = INT_TO_PTR(PTR_TO_INT(skipped_pred->out) + 1);
+               skipped_pred->out = (ir_def_use_edge*) INT_TO_PTR(PTR_TO_INT(skipped_pred->out) + 1);
        }
        return res;
 }
@@ -348,7 +348,7 @@ static int count_outs(ir_graph *irg)
        for (i = anchor_last - 1; i >= 0; --i) {
                n = get_irg_anchor(irg, i);
                if (!irn_visited_else_mark(n)) {
-                       n->out = INT_TO_PTR(1);
+                       n->out = (ir_def_use_edge*) INT_TO_PTR(1);
                        ++res;
                }
        }
@@ -490,153 +490,6 @@ void free_irp_outs(void)
                free_irg_outs(get_irp_irg(i));
 }
 
-
-/*------------------------------------------------------------*
- *  This computes the outedges for in interprocedural graph.  *
- *  There is one quirk:                                       *
- *  The number of the outedges for each node is saved in      *
- *  the first member of the ir_node** array. Maybe we should  *
- *  change this to make it more portable...                   *
- *------------------------------------------------------------*/
-
-
-#ifdef INTERPROCEDURAL_VIEW
-/**
- * Inits the number of outedges for each node
- * before counting.
- */
-static void init_count(ir_node * node, void *env)
-{
-       (void) env;
-       node->out = (ir_node **) 1; /* 1 for the array size */
-}
-
-
-/**
- * Adjusts the out edge count for its predecessors
- * and adds the current arity to the overall count,
- * which is saved in "env"
- */
-static void node_arity_count(ir_node * node, void * env)
-{
-       int *anz = (int *) env, arity, n_outs, i, start;
-       ir_node *succ;
-
-       arity = get_irn_arity(node);
-       start = (is_Block(node)) ? 0 : -1;
-
-       n_outs = 1 + arity + (-start);  // ((is_Block(node)) ? 0 : 1);   // Why + 1??
-       *anz += n_outs;
-
-       for (i = start; i < arity; i++) {
-               succ = get_irn_n(node, i);
-               succ->out = (ir_node **)INT_TO_PTR(PTR_TO_INT(succ->out) + 1);
-       }
-}
-
-/*
- * Inits all nodes for setting the outedges
- * Returns the overall count of edges
- */
-int count_ip_outs(void)
-{
-       int res = 0;
-
-       cg_walk(init_count, node_arity_count, &res);
-
-       return(res);
-}
-
-static int dummy_count = 0, global_count; /* Only for debugging */
-
-/**
- * For each node: Sets the pointer to array
- * in which the outedges are written later.
- * The current array start is transported in env
- */
-static void set_array_pointer(ir_node *node, void *env)
-{
-       int n_outs;
-       ir_node ***free = (ir_node ***) env;
-
-       /* Allocate my array */
-       n_outs = PTR_TO_INT(node->out);  /* We wrote the count here in count_ip_outs */
-       dummy_count += n_outs;
-       assert(dummy_count <= global_count && "More outedges than initially counted!");
-       node -> out = *free;
-       *free = &((*free)[n_outs]);
-       /* We count the successors again, the space will be sufficient.
-          We use this counter to remember the position for the next back
-          edge. */
-       node -> out[0] = (ir_node *) 0;
-}
-
-
-/**
- * Adds an outedge from the predecessor to the
- * current node.
- */
-static void set_out_pointer(ir_node * node, void *env)
-{
-       int i, arity = get_irn_arity(node);
-       ir_node *succ;
-       int start = (!is_Block(node)) ? -1 : 0;
-       (void) env;
-
-       for (i = start; i < arity; ++i) {
-               succ = get_irn_n(node, i);
-               succ->out[get_irn_n_outs(succ)+1] = node;
-               succ->out[0] = INT_TO_PTR(get_irn_n_outs(succ) + 1);
-       }
-}
-
-
-/*
- * Sets the outedges for all nodes.
- */
-void set_ip_outs(void)
-{
-       ir_node **outedge_array = get_irp_ip_outedges();
-       cg_walk(set_array_pointer, set_out_pointer, (void *) &outedge_array);
-}
-
-
-
-/*
- * Counts the outedges, allocates memory to save the
- * outedges and fills this outedge array in interprocedural
- * view!
- */
-void compute_ip_outs(void)
-{
-       int n_out_edges;
-       ir_node **out_edges;
-
-       assert(get_irp_ip_view_state() == ip_view_valid &&
-        "Cannot construct outs for invalid ip view.");
-
-       if (irp->outs_state != outs_none) {
-               free_ip_outs();
-       }
-
-       global_count = n_out_edges = count_ip_outs();
-       out_edges    = XMALLOCNZ(ir_node*, n_out_edges);
-       set_irp_ip_outedges(out_edges);
-       set_ip_outs();
-}
-
-void free_ip_outs(void)
-{
-       ir_node **out_edges = get_irp_ip_outedges();
-       if (out_edges != NULL) {
-               free(out_edges);
-               set_irp_ip_outedges(NULL);
-       }
-       irp->outs_state = outs_none;
-}
-#endif
-
-
 void free_irg_outs(ir_graph *irg)
 {
        /*   current_ir_graph->outs_state = outs_none; */