summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-chrec.h')
-rw-r--r--gcc/tree-chrec.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index 55f6e978545..bc5c7782201 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -69,7 +69,6 @@ extern tree chrec_fold_minus (tree, tree, tree);
extern tree chrec_fold_multiply (tree, tree, tree);
extern tree chrec_convert (tree, tree, tree);
extern tree chrec_convert_aggressive (tree, tree);
-extern tree chrec_type (tree);
/* Operations. */
extern tree chrec_apply (unsigned, tree, tree);
@@ -106,6 +105,8 @@ build_polynomial_chrec (unsigned loop_num,
|| right == chrec_dont_know)
return chrec_dont_know;
+ gcc_assert (TREE_TYPE (left) == TREE_TYPE (right));
+
return build3 (POLYNOMIAL_CHREC, TREE_TYPE (left),
build_int_cst (NULL_TREE, loop_num), left, right);
}
@@ -208,4 +209,16 @@ no_evolution_in_loop_p (tree chrec, unsigned loop_num, bool *res)
return true;
}
+/* Returns the type of the chrec. */
+
+static inline tree
+chrec_type (tree chrec)
+{
+ if (automatically_generated_chrec_p (chrec))
+ return NULL_TREE;
+
+ return TREE_TYPE (chrec);
+}
+
+
#endif /* GCC_TREE_CHREC_H */