diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-09-06 21:25:02 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-09-06 21:25:02 +0000 |
commit | 44835fdd5d38ae34088ca2304588382c61064558 (patch) | |
tree | 3849981f81993a14ff6789ad1a4f46090fae3c2c /gcc/cp/decl.c | |
parent | bcf98e48ef4b9eeee82ca6505153216d4b55a22b (diff) | |
download | gcc-44835fdd5d38ae34088ca2304588382c61064558.zip gcc-44835fdd5d38ae34088ca2304588382c61064558.tar.gz gcc-44835fdd5d38ae34088ca2304588382c61064558.tar.bz2 |
extend.texi: Mark named return value extension as deprecated.
* extend.texi: Mark named return value extension as deprecated.
* NEWS: Mention that the named return value extension has been
deprecated.
* cp-tree.h (original_result_rtx): Define.
(TREE_REFERENCE_EXPR): Remove.
(DECL_VPARENT): Likewise.
(pushdecl_nonclass_level): Likewise.
(store_return_init): Likewise.
(reinit_lang_specific): Likewise.
(genrtl_named_return_value): Change prototype.
* decl.c (original_result_rtx): Remove.
(cp_finish_decl): Don't build DECL_STMTs for RESULT_DECLs.
Do not generate RTL for local variables here.
(store_return_init): Remove.
* semantics.c (genrtl_named_return_value): Simplify. Fold in
store_return_init.
(finish_named_return_value): Adjust accordingly. Warn that this
extension is deprecated.
(lang_expand_stmt): Adjust call to genrtl_named_return_value.
From-SVN: r36210
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8537981..b363266 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -269,13 +269,6 @@ int in_std; /* Expect only namespace names now. */ static int only_namespace_names; -/* If original DECL_RESULT of current function was a register, - but due to being an addressable named return value, would up - on the stack, this variable holds the named return value's - original location. */ - -#define original_result_rtx cp_function_chain->x_result_rtx - /* Used only for jumps to as-yet undefined labels, since jumps to defined labels can have their validity checked immediately. */ @@ -8092,7 +8085,9 @@ cp_finish_decl (decl, init, asmspec_tree, flags) return; /* Add this declaration to the statement-tree. */ - if (building_stmt_tree () && at_function_scope_p ()) + if (building_stmt_tree () + && at_function_scope_p () + && TREE_CODE (decl) != RESULT_DECL) add_decl_stmt (decl); if (TYPE_HAS_MUTABLE_P (type)) @@ -8215,8 +8210,7 @@ cp_finish_decl (decl, init, asmspec_tree, flags) { /* If we're not building RTL, then we need to do so now. */ - if (!building_stmt_tree ()) - emit_local_var (decl); + my_friendly_assert (building_stmt_tree (), 20000906); /* Initialize the variable. */ initialize_local_var (decl, init, flags); /* Clean up the variable. */ @@ -14034,31 +14028,6 @@ store_parm_decls () current_eh_spec_try_block = expand_start_eh_spec (); } -/* Bind a name and initialization to the return value of - the current function. */ - -void -store_return_init (decl) - tree decl; -{ - /* If this named return value comes in a register, put it in a - pseudo-register. */ - if (DECL_REGISTER (decl)) - { - original_result_rtx = DECL_RTL (decl); - /* Note that the mode of the old DECL_RTL may be wider than the - mode of DECL_RESULT, depending on the calling conventions for - the processor. For example, on the Alpha, a 32-bit integer - is returned in a DImode register -- the DECL_RESULT has - SImode but the DECL_RTL for the DECL_RESULT has DImode. So, - here, we use the mode the back-end has already assigned for - the return value. */ - DECL_RTL (decl) = gen_reg_rtx (GET_MODE (original_result_rtx)); - if (TREE_ADDRESSABLE (decl)) - put_var_into_stack (decl); - } -} - /* We have finished doing semantic analysis on DECL, but have not yet generated RTL for its body. Save away our current state, so that |