summaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@gcc.gnu.org>2008-05-16 09:36:26 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2008-05-16 09:36:26 -0400
commit9defb1fe37d0ff78a3a8f4729e4f51a957ec902e (patch)
tree83954b55280032f81a5047d421f35181d5f9ce50 /gcc/cfg.c
parent3e894af1569a84c5bb6eb730266248e6a4cae2de (diff)
downloadgcc-9defb1fe37d0ff78a3a8f4729e4f51a957ec902e.tar.gz
[multiple changes]
2008-05-16 Nathan Froyd <froydnj@codesourcery.com> * tree-flow.h (init_empty_tree_cfg_for_function): Declare. * tree-cfg.c (init_empty_tree_cfg_for_function): Define. (init_empty_tree_cfg): Call it. 2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com> * cfg.c (init_flow): Add argument THE_FUN. Use it instead of cfun. Update all users. From-SVN: r135418
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index fe8dba984cf..e8bf789480b 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -81,17 +81,21 @@ static void free_edge (edge);
/* Called once at initialization time. */
void
-init_flow (void)
+init_flow (struct function *the_fun)
{
- if (!cfun->cfg)
- cfun->cfg = GGC_CNEW (struct control_flow_graph);
- n_edges = 0;
- ENTRY_BLOCK_PTR = GGC_CNEW (struct basic_block_def);
- ENTRY_BLOCK_PTR->index = ENTRY_BLOCK;
- EXIT_BLOCK_PTR = GGC_CNEW (struct basic_block_def);
- EXIT_BLOCK_PTR->index = EXIT_BLOCK;
- ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
- EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
+ if (!the_fun->cfg)
+ the_fun->cfg = GGC_CNEW (struct control_flow_graph);
+ n_edges_for_function (the_fun) = 0;
+ ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)
+ = GGC_CNEW (struct basic_block_def);
+ ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)->index = ENTRY_BLOCK;
+ EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun)
+ = GGC_CNEW (struct basic_block_def);
+ EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun)->index = EXIT_BLOCK;
+ ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)->next_bb
+ = EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun);
+ EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun)->prev_bb
+ = ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun);
}
/* Helper function for remove_edge and clear_edges. Frees edge structure