aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/misc.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-13 01:22:03 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-13 01:22:03 -0700
commit0976078c73f58e7350fcc0516618fdd7737c9696 (patch)
tree9ce1ffbe5f574651dfe2baa17807ad50e4394b8d /gcc/ada/misc.c
parentfe9841365eb7e2908f9ba6b18a85910ee9024a54 (diff)
downloadgcc-0976078c73f58e7350fcc0516618fdd7737c9696.zip
gcc-0976078c73f58e7350fcc0516618fdd7737c9696.tar.gz
gcc-0976078c73f58e7350fcc0516618fdd7737c9696.tar.bz2
function.c (pass_by_reference): New.
* function.c (pass_by_reference): New. (assign_parm_find_data_types): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * expr.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * function.h (pass_by_reference): Declare. ada/ * misc.c (default_pass_by_ref): Use pass_by_reference. From-SVN: r84607
Diffstat (limited to 'gcc/ada/misc.c')
-rw-r--r--gcc/ada/misc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 9d0e31e..37e6f17 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -697,26 +697,26 @@ gnat_get_alias_set (tree type)
int
default_pass_by_ref (tree gnu_type)
{
- CUMULATIVE_ARGS cum;
-
- INIT_CUMULATIVE_ARGS (cum, NULL_TREE, NULL_RTX, 0, 2);
-
/* We pass aggregates by reference if they are sufficiently large. The
choice of constant here is somewhat arbitrary. We also pass by
reference if the target machine would either pass or return by
reference. Strictly speaking, we need only check the return if this
is an In Out parameter, but it's probably best to err on the side of
passing more things by reference. */
- return (0
-#ifdef FUNCTION_ARG_PASS_BY_REFERENCE
- || FUNCTION_ARG_PASS_BY_REFERENCE (cum, TYPE_MODE (gnu_type),
- gnu_type, 1)
-#endif
- || targetm.calls.return_in_memory (gnu_type, NULL_TREE)
- || (AGGREGATE_TYPE_P (gnu_type)
- && (! host_integerp (TYPE_SIZE (gnu_type), 1)
- || 0 < compare_tree_int (TYPE_SIZE (gnu_type),
- 8 * TYPE_ALIGN (gnu_type)))));
+
+ if (pass_by_reference (NULL, TYPE_MODE (gnu_type), gnu_type, 1))
+ return true;
+
+ if (targetm.calls.return_in_memory (gnu_type, NULL_TREE))
+ return true;
+
+ if (AGGREGATE_TYPE_P (gnu_type)
+ && (! host_integerp (TYPE_SIZE (gnu_type), 1)
+ || 0 < compare_tree_int (TYPE_SIZE (gnu_type),
+ 8 * TYPE_ALIGN (gnu_type))))
+ return true;
+
+ return false;
}
/* GNU_TYPE is the type of a subprogram parameter. Determine from the type if