diff options
author | Jason Merrill <jason@redhat.com> | 2001-06-18 12:15:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2001-06-18 12:15:12 -0400 |
commit | 0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a (patch) | |
tree | 70263e15f7a28d4f44a057ee1783e8a0095c5f9a /gcc/c-common.h | |
parent | 923cbdc322ee080c02b94a95eece0618a2a78b47 (diff) | |
download | gcc-0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a.zip gcc-0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a.tar.gz gcc-0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a.tar.bz2 |
Implement the Named Return Value optimization.
* c-common.h (RETURN_NULLIFIED_P): New macro.
* c-semantics.c (genrtl_return_stmt): Check it.
* cp-tree.h (struct cp_language_function): Add x_return_value.
(current_function_return_value): Now a macro.
* decl.c: Don't define it.
(define_label, finish_case_label): Don't clear it.
(init_decl_processing): Don't register it with GC.
* semantics.c (genrtl_finish_function): Don't check it for
no_return_label. Copy the RTL from the return value to
current_function_return_value and walk, calling...
(nullify_returns_r): ...this new fn.
* typeck.c (check_return_expr): Set current_function_return_value.
* expr.c (clear_storage): Set TREE_NOTHROW on the decl for memset.
(emit_block_move): Likewise.
From-SVN: r43445
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r-- | gcc/c-common.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h index 3f766a7..05350c1 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ SCOPE_BEGIN_P (in SCOPE_STMT) DECL_PRETTY_FUNCTION_P (in VAR_DECL) NEW_FOR_SCOPE_P (in FOR_STMT) + RETURN_NULLIFIED_P (in RETURN_STMT) ASM_INPUT_P (in ASM_STMT) 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL) STMT_IS_FULL_EXPR_P (in _STMT) @@ -561,9 +562,11 @@ extern tree strip_array_types PARAMS ((tree)); #define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) #define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) -/* RETURN_STMT accessor. This gives the expression associated with a - return statement. */ +/* RETURN_STMT accessors. These give the expression associated with a + return statement, and whether it should be ignored when expanding + (as opposed to inlining). */ #define RETURN_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0) +#define RETURN_NULLIFIED_P(NODE) TREE_LANG_FLAG_0 (RETURN_STMT_CHECK (NODE)) /* EXPR_STMT accessor. This gives the expression associated with an expression statement. */ |