aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-12-18 08:30:30 -0500
committerJason Merrill <jason@gcc.gnu.org>2001-12-18 08:30:30 -0500
commitf21add0737d299427da125d7b89ecfe89b5e11db (patch)
treeedc5e296aa2480c6b58999dde1d72aa6a6e2b60f /gcc/calls.c
parent769317c56d2321f57f3da95f444026e26f0e795c (diff)
downloadgcc-f21add0737d299427da125d7b89ecfe89b5e11db.zip
gcc-f21add0737d299427da125d7b89ecfe89b5e11db.tar.gz
gcc-f21add0737d299427da125d7b89ecfe89b5e11db.tar.bz2
C++ ABI change: destroy value arguments in caller.
* calls.c (initialize_argument_information): Pass the address of the TARGET_EXPR temporary rather than storing it into another. * semantics.c (genrtl_start_function, genrtl_finish_function): Don't create an extra binding level for the parameters. * decl.c (store_parm_decls): Don't do parameter cleanups. From-SVN: r48154
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 6a22820..afb9b39 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1212,6 +1212,16 @@ initialize_argument_information (num_actuals, args, args_size, n_named_args,
args[i].tree_value);
type = build_pointer_type (type);
}
+ else if (TREE_CODE (args[i].tree_value) == TARGET_EXPR)
+ {
+ /* In the V3 C++ ABI, parameters are destroyed in the caller.
+ We implement this by passing the address of the temporary
+ rather than expanding it into another allocated slot. */
+ args[i].tree_value = build1 (ADDR_EXPR,
+ build_pointer_type (type),
+ args[i].tree_value);
+ type = build_pointer_type (type);
+ }
else
{
/* We make a copy of the object and pass the address to the