aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 3d13386..7709a03 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -101,6 +101,20 @@ flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
&& loop->pred[outer->depth] == outer;
}
+/* Returns superloop of LOOP at given DEPTH. */
+
+struct loop *
+superloop_at_depth (struct loop *loop, unsigned depth)
+{
+ if (depth > (unsigned) loop->depth)
+ abort ();
+
+ if (depth == (unsigned) loop->depth)
+ return loop;
+
+ return loop->pred[depth];
+}
+
/* Dump the loop information specified by LOOP to the stream FILE
using auxiliary dump callback function LOOP_DUMP_AUX if non null. */