summaryrefslogtreecommitdiff
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-04-26 11:13:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-04-26 11:13:14 +0000
commitdd366ec309a4afc80ce5b6442321eb847b1b851f (patch)
tree027570a5994a1bcef5487d0da3c38370ec98d67f /gcc/cfgloop.c
parenta9e0d843713b294d12c3a3faedbc0c817e581014 (diff)
downloadgcc-dd366ec309a4afc80ce5b6442321eb847b1b851f.tar.gz
Makefile.in (lto-streamer-in.o): Add $(CFGLOOP_H) dependency.
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. From-SVN: r198334
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c17
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. */