aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-06-18 12:15:12 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-06-18 12:15:12 -0400
commit0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a (patch)
tree70263e15f7a28d4f44a057ee1783e8a0095c5f9a /gcc/cp/decl.c
parent923cbdc322ee080c02b94a95eece0618a2a78b47 (diff)
downloadgcc-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/cp/decl.c')
-rw-r--r--gcc/cp/decl.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index af9de43..0968220 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -285,13 +285,6 @@ struct named_label_list
#define named_labels cp_function_chain->x_named_labels
-/* Set to 0 at beginning of a function definition, and whenever
- a label (case or named) is defined. Set to value of expression
- returned from function when that value can be transformed into
- a named return value. */
-
-tree current_function_return_value;
-
/* Nonzero means use the ISO C94 dialect of C. */
int flag_isoc94;
@@ -5153,7 +5146,6 @@ define_label (filename, line, name)
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
- current_function_return_value = NULL_TREE;
return decl;
}
}
@@ -5255,7 +5247,6 @@ finish_case_label (low_value, high_value)
own new (temporary) binding contour. */
for (p = current_binding_level; !(p->parm_flag); p = p->level_chain)
p->more_cleanups_ok = 0;
- current_function_return_value = NULL_TREE;
return r;
}
@@ -6624,7 +6615,6 @@ init_decl_processing ()
ggc_add_tree_root (&lastiddecl, 1);
ggc_add_tree_root (&last_function_parm_tags, 1);
- ggc_add_tree_root (&current_function_return_value, 1);
ggc_add_tree_root (&current_function_parm_tags, 1);
ggc_add_tree_root (&last_function_parms, 1);
ggc_add_tree_root (&error_mark_list, 1);