diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-26 11:13:14 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-26 11:13:14 +0000 |
commit | 7a569539703acb109ac1905068a974f3dff82e82 (patch) | |
tree | 027570a5994a1bcef5487d0da3c38370ec98d67f /gcc/cfgloop.c | |
parent | f6568ea476aa52a6e23c6db43b3e240cde55783a (diff) | |
download | gcc-7a569539703acb109ac1905068a974f3dff82e82.tar.gz |
2013-04-26 Richard Biener <rguenther@suse.de>
* Makefile.in (lto-streamer-in.o): Add $(CFGLOOP_H) dependency.
(lto-streamer-out.o): Likewise.
* cfgloop.c (init_loops_structure): Export, add struct function
argument and adjust.
(flow_loops_find): Adjust.
* cfgloop.h (enum loop_estimation): Add EST_LAST.
(init_loops_structure): Declare.
* lto-streamer-in.c: Include cfgloop.h.
(input_cfg): Input the loop tree.
* lto-streamer-out.c: Include cfgloop.h.
(output_cfg): Output the loop tree.
(output_struct_function_base): Do not drop PROP_loops.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198334 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r-- | gcc/cfgloop.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 568b7a2a13d..28b63ae2f36 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -339,8 +339,9 @@ alloc_loop (void) /* Initializes loops structure LOOPS, reserving place for NUM_LOOPS loops (including the root of the loop tree). */ -static void -init_loops_structure (struct loops *loops, unsigned num_loops) +void +init_loops_structure (struct function *fn, + struct loops *loops, unsigned num_loops) { struct loop *root; @@ -349,11 +350,11 @@ init_loops_structure (struct loops *loops, unsigned num_loops) /* Dummy loop containing whole function. */ root = alloc_loop (); - root->num_nodes = n_basic_blocks; - root->latch = EXIT_BLOCK_PTR; - root->header = ENTRY_BLOCK_PTR; - ENTRY_BLOCK_PTR->loop_father = root; - EXIT_BLOCK_PTR->loop_father = root; + root->num_nodes = n_basic_blocks_for_function (fn); + root->latch = EXIT_BLOCK_PTR_FOR_FUNCTION (fn); + root->header = ENTRY_BLOCK_PTR_FOR_FUNCTION (fn); + ENTRY_BLOCK_PTR_FOR_FUNCTION (fn)->loop_father = root; + EXIT_BLOCK_PTR_FOR_FUNCTION (fn)->loop_father = root; loops->larray->quick_push (root); loops->tree_root = root; @@ -411,7 +412,7 @@ flow_loops_find (struct loops *loops) if (!loops) { loops = ggc_alloc_cleared_loops (); - init_loops_structure (loops, 1); + init_loops_structure (cfun, loops, 1); } /* Ensure that loop exits were released. */ |