diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2013-04-11 16:15:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2013-04-11 16:15:25 +0000 |
commit | 966b587e0b513fa8075beaf9ab184ed74686ee97 (patch) | |
tree | 50ecfdf73e14a55579b5dfadb4bcc575c87bafec /gcc/stor-layout.c | |
parent | 76545796c5181baef9511af159178aef8d93de7c (diff) | |
download | gcc-966b587e0b513fa8075beaf9ab184ed74686ee97.tar.gz |
stor-layout.c (skip_simple_constant_arithmetic): Move to...
* stor-layout.c (skip_simple_constant_arithmetic): Move to...
* tree.c (skip_simple_constant_arithmetic): ...here and make public.
(skip_simple_arithmetic): Tidy up.
* tree.h (skip_simple_constant_arithmetic): Declare.
ada/
* gcc-interface/decl.c (elaborate_expression_1): Skip only constant
arithmetics when looking for a read-only variable in the expression.
From-SVN: r197815
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 5b89f749f7a..67dd9587b99 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -98,32 +98,6 @@ variable_size (tree size) /* An array of functions used for self-referential size computation. */ static GTY(()) vec<tree, va_gc> *size_functions; -/* Look inside EXPR into simple arithmetic operations involving constants. - Return the outermost non-arithmetic or non-constant node. */ - -static tree -skip_simple_constant_arithmetic (tree expr) -{ - while (true) - { - if (UNARY_CLASS_P (expr)) - expr = TREE_OPERAND (expr, 0); - else if (BINARY_CLASS_P (expr)) - { - if (TREE_CONSTANT (TREE_OPERAND (expr, 1))) - expr = TREE_OPERAND (expr, 0); - else if (TREE_CONSTANT (TREE_OPERAND (expr, 0))) - expr = TREE_OPERAND (expr, 1); - else - break; - } - else - break; - } - - return expr; -} - /* Similar to copy_tree_r but do not copy component references involving PLACEHOLDER_EXPRs. These nodes are spotted in find_placeholder_in_expr and substituted in substitute_in_expr. */ |