diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-05 22:55:59 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-05 22:55:59 +0000 |
commit | 29cd975191d09486fbbc2de22f78a6e364b48913 (patch) | |
tree | 2c31b3c3692d04f0b6880985575103f2307a0b76 /gcc/cfganal.c | |
parent | 3a540c9b0b4ebe5b0ab826a4c95e324d726a2b55 (diff) | |
download | gcc-29cd975191d09486fbbc2de22f78a6e364b48913.tar.gz |
* basic-block.h: Remove the prototype for
flow_preorder_transversal_compute.
* cfganal.c (dfst_node): Remove.
(flow_preorder_transversal_compute): Likewise.
* rtl.h: Remove the prototype for get_jump_table_offset.
* rtlanal.c (get_jump_table_offset): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 30aa5c40db3..c76da55296c 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -774,126 +774,6 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order) return dfsnum; } -struct dfst_node -{ - unsigned nnodes; - struct dfst_node **node; - struct dfst_node *up; -}; - -/* Compute a preorder transversal ordering such that a sub-tree which - is the source of a cross edge appears before the sub-tree which is - the destination of the cross edge. This allows for easy detection - of all the entry blocks for a loop. - - The ordering is compute by: - - 1) Generating a depth first spanning tree. - - 2) Walking the resulting tree from right to left. */ - -void -flow_preorder_transversal_compute (int *pot_order) -{ - edge_iterator *stack, ei; - int i; - int max_successors; - int sp; - sbitmap visited; - struct dfst_node *node; - struct dfst_node *dfst; - basic_block bb; - - /* Allocate stack for back-tracking up CFG. */ - stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge)); - sp = 0; - - /* Allocate the tree. */ - dfst = xcalloc (last_basic_block, sizeof (struct dfst_node)); - - FOR_EACH_BB (bb) - { - max_successors = EDGE_COUNT (bb->succs); - dfst[bb->index].node - = (max_successors - ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL); - } - - /* Allocate bitmap to track nodes that have been visited. */ - visited = sbitmap_alloc (last_basic_block); - - /* None of the nodes in the CFG have been visited yet. */ - sbitmap_zero (visited); - - /* Push the first edge on to the stack. */ - stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs); - - while (sp) - { - basic_block src; - basic_block dest; - - /* Look at the edge on the top of the stack. */ - ei = stack[sp - 1]; - src = ei_edge (ei)->src; - dest = ei_edge (ei)->dest; - - /* Check if the edge destination has been visited yet. */ - if (dest != EXIT_BLOCK_PTR && ! TEST_BIT (visited, dest->index)) - { - /* Mark that we have visited the destination. */ - SET_BIT (visited, dest->index); - - /* Add the destination to the preorder tree. */ - if (src != ENTRY_BLOCK_PTR) - { - dfst[src->index].node[dfst[src->index].nnodes++] - = &dfst[dest->index]; - dfst[dest->index].up = &dfst[src->index]; - } - - if (EDGE_COUNT (dest->succs) > 0) - /* Since the DEST node has been visited for the first - time, check its successors. */ - stack[sp++] = ei_start (dest->succs); - } - - else if (! ei_one_before_end_p (ei)) - ei_next (&stack[sp - 1]); - else - sp--; - } - - free (stack); - sbitmap_free (visited); - - /* Record the preorder transversal order by - walking the tree from right to left. */ - - i = 0; - node = &dfst[ENTRY_BLOCK_PTR->next_bb->index]; - pot_order[i++] = 0; - - while (node) - { - if (node->nnodes) - { - node = node->node[--node->nnodes]; - pot_order[i++] = node - dfst; - } - else - node = node->up; - } - - /* Free the tree. */ - - for (i = 0; i < last_basic_block; i++) - if (dfst[i].node) - free (dfst[i].node); - - free (dfst); -} - /* Compute the depth first search order on the _reverse_ graph and store in the array DFS_ORDER, marking the nodes visited in VISITED. Returns the number of nodes visited. |