summaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 37a9fbd0aea..cd3f47c5b63 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -2180,8 +2180,6 @@ max_size (tree exp, int max_p)
gigi_abort (407);
else if (code == COMPOUND_EXPR)
return max_size (TREE_OPERAND (exp, 1), max_p);
- else if (code == WITH_RECORD_EXPR)
- return exp;
{
tree lhs = max_size (TREE_OPERAND (exp, 0), max_p);
@@ -2275,12 +2273,9 @@ build_template (tree template_type, tree array_type, tree expr)
max = convert (TREE_TYPE (field), TYPE_MAX_VALUE (bounds));
/* If either MIN or MAX involve a PLACEHOLDER_EXPR, we must
- surround them with a WITH_RECORD_EXPR giving EXPR as the
- OBJECT. */
- if (CONTAINS_PLACEHOLDER_P (min))
- min = build (WITH_RECORD_EXPR, TREE_TYPE (min), min, expr);
- if (CONTAINS_PLACEHOLDER_P (max))
- max = build (WITH_RECORD_EXPR, TREE_TYPE (max), max, expr);
+ substitute it from OBJECT. */
+ min = SUBSTITUTE_PLACEHOLDER_IN_EXPR (min, expr);
+ max = SUBSTITUTE_PLACEHOLDER_IN_EXPR (max, expr);
template_elts = tree_cons (TREE_CHAIN (field), max,
tree_cons (field, min, template_elts));
@@ -2865,12 +2860,6 @@ convert (tree type, tree expr)
else if (AGGREGATE_TYPE_P (type)
&& TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (etype))
return build1 (NOP_EXPR, type, expr);
- /* If EXPR is a WITH_RECORD_EXPR, do the conversion inside and then make a
- new one. */
- else if (TREE_CODE (expr) == WITH_RECORD_EXPR)
- return build (WITH_RECORD_EXPR, type,
- convert (type, TREE_OPERAND (expr, 0)),
- TREE_OPERAND (expr, 1));
/* If the input type has padding, remove it by doing a component reference
to the field. If the output type has padding, make a constructor
@@ -3250,13 +3239,6 @@ maybe_unconstrained_array (tree exp)
(TREE_TYPE (TREE_TYPE (exp))))),
TREE_OPERAND (exp, 0));
- else if (code == WITH_RECORD_EXPR
- && (TREE_OPERAND (exp, 0)
- != (new = maybe_unconstrained_array
- (TREE_OPERAND (exp, 0)))))
- return build (WITH_RECORD_EXPR, TREE_TYPE (new), new,
- TREE_OPERAND (exp, 1));
-
case RECORD_TYPE:
/* If this is a padded type, convert to the unpadded type and see if
it contains a template. */
@@ -3295,13 +3277,6 @@ unchecked_convert (tree type, tree expr, int notrunc_p)
if (etype == type)
return expr;
- /* If EXPR is a WITH_RECORD_EXPR, do the conversion inside and then make a
- new one. */
- if (TREE_CODE (expr) == WITH_RECORD_EXPR)
- return build (WITH_RECORD_EXPR, type,
- unchecked_convert (type, TREE_OPERAND (expr, 0), notrunc_p),
- TREE_OPERAND (expr, 1));
-
/* If both types types are integral just do a normal conversion.
Likewise for a conversion to an unconstrained array. */
if ((((INTEGRAL_TYPE_P (type)