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/decl2.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/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 332fca5..67ef3777 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2018,12 +2018,6 @@ mark_inline_for_output (decl) ++saved_inlines_used; } -void -clear_temp_name () -{ - temp_name_counter = 0; -} - /* Hand off a unique name which can be used for variable we don't really want to know about anyway, for example, the anonymous variables which are needed to make references work. Declare this thing so we can use it. @@ -2825,7 +2819,7 @@ start_objects (method_type, initp) start_function (void_list_node, make_call_declarator (fnname, void_list_node, NULL_TREE, NULL_TREE), - NULL_TREE, 0); + NULL_TREE, SF_DEFAULT); #if defined(ASM_OUTPUT_CONSTRUCTOR) && defined(ASM_OUTPUT_DESTRUCTOR) /* It can be a static function as long as collect2 does not have @@ -3014,7 +3008,7 @@ start_static_storage_duration_function () start_function (/*specs=*/NULL_TREE, ssdf_decl, /*attrs=*/NULL_TREE, - /*pre_parsed_p=*/1); + SF_DEFAULT | SF_PRE_PARSED); /* Set up the scope of the outermost block in the function. */ store_parm_decls (); |