aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-10-16 19:28:52 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-10-16 19:28:52 +0000
commitafb4afcd90d30faf064bcba6a7b5a86fd4003bdc (patch)
treecb3644326b2ac3cdc4b94ace7e353dcd04c121fb /gcc/ada/gcc-interface/trans.c
parent3b24c708a1d4da6b37ce1bde62d44a056030b635 (diff)
downloadgcc-afb4afcd90d30faf064bcba6a7b5a86fd4003bdc.zip
gcc-afb4afcd90d30faf064bcba6a7b5a86fd4003bdc.tar.gz
gcc-afb4afcd90d30faf064bcba6a7b5a86fd4003bdc.tar.bz2
exp_dbug.ads: Adjust type names in comments.
* exp_dbug.ads: Adjust type names in comments. * gcc-interface/decl.c (maybe_pad_type): Remove NAME_TRAILER parameter, add new IS_COMPONENT_TYPE parameter. Adjust. Remove dead code. (gnat_to_gnu_entity): Adjust for above change. (gnat_to_gnu_component_type): Likewise. (gnat_to_gnu_field): Likewise. * gcc-interface/trans.c (call_to_gnu): Likewise. Do not unnecessarily call max_size. * gcc-interface/utils.c (finish_record_type): Remove obsolete code. * gcc-interface/gigi.h (maybe_pad_type): Adjust prototype. From-SVN: r152916
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index d94d1f4..74aa2b6 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -2423,22 +2423,27 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
}
}
- /* If we are calling by supplying a pointer to a target, set up that
- pointer as the first argument. Use GNU_TARGET if one was passed;
- otherwise, make a target by building a variable of the maximum size
- of the type. */
+ /* If we are calling by supplying a pointer to a target, set up that pointer
+ as the first argument. Use GNU_TARGET if one was passed; otherwise, make
+ a target by building a variable and use the maximum size of the type if
+ it has self-referential size. */
if (TYPE_RETURNS_BY_TARGET_PTR_P (gnu_subprog_type))
{
- tree gnu_real_ret_type
+ tree gnu_ret_type
= TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (gnu_subprog_type)));
if (!gnu_target)
{
- tree gnu_obj_type
- = maybe_pad_type (gnu_real_ret_type,
- max_size (TYPE_SIZE (gnu_real_ret_type), true),
- 0, Etype (Name (gnat_node)), "PAD", false,
- false, false);
+ tree gnu_obj_type;
+
+ if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_ret_type)))
+ gnu_obj_type
+ = maybe_pad_type (gnu_ret_type,
+ max_size (TYPE_SIZE (gnu_ret_type), true),
+ 0, Etype (Name (gnat_node)), false, false,
+ false, true);
+ else
+ gnu_obj_type = gnu_ret_type;
/* ??? We may be about to create a static temporary if we happen to
be at the global binding level. That's a regression from what
@@ -2454,7 +2459,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual_list
= tree_cons (NULL_TREE,
build_unary_op (ADDR_EXPR, NULL_TREE,
- unchecked_convert (gnu_real_ret_type,
+ unchecked_convert (gnu_ret_type,
gnu_target,
false)),
NULL_TREE);