aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 2d15285..c92b6b9 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -632,6 +632,23 @@ chrec_apply (unsigned var,
return res;
}
+/* For a given CHREC and an induction variable map IV_MAP that maps
+ (loop->num, expr) for every loop number of the current_loops an
+ expression, calls chrec_apply when the expression is not NULL. */
+
+tree
+chrec_apply_map (tree chrec, VEC (tree, heap) *iv_map)
+{
+ int i;
+ tree expr;
+
+ for (i = 0; VEC_iterate (tree, iv_map, i, expr); i++)
+ if (expr)
+ chrec = chrec_apply (i, chrec, expr);
+
+ return chrec;
+}
+
/* Replaces the initial condition in CHREC with INIT_COND. */
tree