aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/gigi.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-11-30 11:46:32 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-11-30 11:46:32 +0000
commit933a73251d95fb930028cb76eee7a892f41f867b (patch)
tree04f64660b152400aaf2762b907ade2f74782d611 /gcc/ada/gcc-interface/gigi.h
parentf8125f0c9ce43aac6d7a96753e4617af68ee0009 (diff)
downloadgcc-933a73251d95fb930028cb76eee7a892f41f867b.zip
gcc-933a73251d95fb930028cb76eee7a892f41f867b.tar.gz
gcc-933a73251d95fb930028cb76eee7a892f41f867b.tar.bz2
gigi.h (is_simple_additive_expression): Declare.
* gcc-interface/gigi.h (is_simple_additive_expression): Declare. * gcc-interface/trans.c (struct range_check_info_d): Add DISP and NEG_P fields. (find_loop_for): Add DISP and NEG_P parameters with default value. Call is_simple_additive_expression to handle additive expressions. (Loop_Statement_to_gnu): Deal with displacement in range checks. (Raise_Error_to_gnu): Likewise. (gnat_to_gnu): Add call to find_loop_for. (is_simple_additive_expression): New function extracted from... (gnat_invariant_expr): ...here. Call it on the expression. From-SVN: r231064
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r--gcc/ada/gcc-interface/gigi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 46ec42e..e98e7e6 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -962,6 +962,12 @@ extern tree gnat_rewrite_reference (tree ref, rewrite_fn func, void *data,
i.e. if it doesn't depend on the context in which it is evaluated. */
extern tree get_inner_constant_reference (tree exp);
+/* Return true if EXPR is the addition or the subtraction of a constant and,
+ if so, set *ADD to the addend, *CST to the constant and *MINUS_P to true
+ if this is a subtraction. */
+extern bool is_simple_additive_expression (tree expr, tree *add, tree *cst,
+ bool *minus_p);
+
/* If EXPR is an expression that is invariant in the current function, in the
sense that it can be evaluated anywhere in the function and any number of
times, return EXPR or an equivalent expression. Otherwise return NULL. */