diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-09-09 19:02:39 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-09-09 19:02:39 +0000 |
commit | a8f73d4b365bbfe9145bfd4ae16159d632ca0c33 (patch) | |
tree | 405b90c13653975957260d95ca2290648afa63ea /gcc/cp/semantics.c | |
parent | 0a8a198ceb46752b7b7e8f3f7b259347e4ba45b6 (diff) | |
download | gcc-a8f73d4b365bbfe9145bfd4ae16159d632ca0c33.zip gcc-a8f73d4b365bbfe9145bfd4ae16159d632ca0c33.tar.gz gcc-a8f73d4b365bbfe9145bfd4ae16159d632ca0c33.tar.bz2 |
Reorganize per-function data.
* cp-tree.h (saved_scope): Add function_decl, bindings.
(language_function): Rename binding_level to bindings.
(cp_function_chain): Use the current_function, not the
outer_function_chain.
(current_class_ptr): Make it work, even when there's no
current function.
(current_class_ref): Likewise.
(SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
macros.
(clear_temp_name): Remove.
* decl.c (check_function_type): New function, broken out from
start_function.
(current_binding_level): Adjust definition.
(pushlevel): Simplify.
(poplevel): Don't use named_label_uses when we're outside
a function scope.
(mark_saved_scope): Mark function_decl and bindings.
(maybe_push_to_top_level): Don't unconditionally push a new
function context. Save bindings and the current_function_decl.
Don't clear named_labels.
(pop_from_top_level): Pop function context if appropriate.
(init_decl_processing): Set init_lang_status and free_lang_status,
rather than save_lang_status and restore_lang_status.
(start_function): Take SF_* flags. Don't clear per-function data.
Reorder and simplify to use new per-function data code. Add
asserts.
(store_parm_decls): Don't call init_function_start here.
(finish_function): Adjust for new handling of per-function data.
(push_cp_function_context): Simplify.
(mark_cp_function_context): Change binding_level to bindings.
* decl2.c (clear_temp_name): Remove.
(start_objects): Use SF flags to start_function.
(start_static_storage_duration_function): Likewise.
* except.c (start_anon_func): Remove redundant calls to
push_function_context_to. Use SF flags to start function.
(end_anon_func): Remove redundant call to pop_function_context
from.
* lex.c (reinit_parse_for_function): Don't initialize per-function
data.
* method.c (emit_thunk): Clear current_function after calling
assemble_end_function. Use SF flags for start_function.
(synthesize_method): Use SF flags for start_function.
* parse.c: Regenerated.
* parse.y (fn.defpen): Likewise.
(pending_inline): Clear current_function, even if something goes
wrong.
* pt.c (instantiate_decl): Use SF flags to start_function.
Don't save and restore expanding_p.
(add_tree): Handle the case where we are outside any function.
(end_tree): Likewise.
* rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
* semantics.c (begin_function_definition): Likewise.
(expand_body): Likewise.
From-SVN: r29240
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 822027e..38eab3b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1394,7 +1394,7 @@ begin_function_definition (decl_specs, declarator) tree specs; tree attrs; split_specs_attrs (decl_specs, &specs, &attrs); - if (!start_function (specs, declarator, attrs, 0)) + if (!start_function (specs, declarator, attrs, SF_DEFAULT)) return 0; reinit_parse_for_function (); @@ -2182,16 +2182,10 @@ void expand_body (fn) tree fn; { - int saved_expanding_p; tree t; tree try_block; - /* Let the compiler know that now is the time to really generate - actualy RTL. */ - saved_expanding_p = expanding_p; - expanding_p = 1; - - start_function (NULL_TREE, fn, NULL_TREE, 1); + start_function (NULL_TREE, fn, NULL_TREE, SF_PRE_PARSED | SF_EXPAND); store_parm_decls (); /* There are a few things that we do not handle recursively. For @@ -2242,7 +2236,4 @@ expand_body (fn) } finish_function (lineno, 0); - - /* Restore EXPANDING_P. */ - expanding_p = saved_expanding_p; } |