diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-04-03 05:38:32 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2008-04-03 05:38:32 +0000 |
commit | d2784db4e5b1950ca24582e3dd716af7f5e04906 (patch) | |
tree | 85505dacc4125c518bd797dee4270aa38c395fe9 /gcc/function.c | |
parent | 0a262d5466e618a2df7c25c9eac7ef1d4497c0c7 (diff) | |
download | gcc-d2784db4e5b1950ca24582e3dd716af7f5e04906.zip gcc-d2784db4e5b1950ca24582e3dd716af7f5e04906.tar.gz gcc-d2784db4e5b1950ca24582e3dd716af7f5e04906.tar.bz2 |
c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED, [...]): Delete.
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
* c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete.
* c-tree.h (c_push_function_context, c_pop_function_context): Remove
argument.
* c-decl.c (c_push_function_context, c_pop_function_context): Remove
argument, call {push,pop}_function_context from here.
* c-parser.c: Use c_{push,pop}_function_context.
* function.c (push_function_context_to): Move meat ...
(push_function_context): ... here. Simplify.
* function.c (pop_function_context_from): Move meat ...
(pop_function_context): ... here. Simplify.
* langhooks.h (struct lang_hooks_for_functions): Remove enter_nested,
leave_nested).
* langhooks-def.h (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete.
(LANG_HOOKS_FUNCTION_INITIALIZER): Delete them from here.
* tree.h (push_function_context_to, pop_function_context_from): Remove.
cp:
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
* method.c (synthesize_method): Use {push,pop}_function_context.
* name-lookup.c (push_to_top_level): Likewise.
* parser.c (cp_parser_late_parsing_for_member): Likewise.
From-SVN: r133860
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/gcc/function.c b/gcc/function.c index 56f9865..197c393 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -234,60 +234,36 @@ find_function_data (tree decl) } /* Save the current context for compilation of a nested function. - This is called from language-specific code. The caller should use - the enter_nested langhook to save any language-specific state, - since this function knows only about language-independent - variables. */ + This is called from language-specific code. */ void -push_function_context_to (tree context ATTRIBUTE_UNUSED) +push_function_context (void) { - struct function *p; - if (cfun == 0) allocate_struct_function (NULL, false); - p = cfun; - - p->outer = outer_function_chain; - outer_function_chain = p; - - lang_hooks.function.enter_nested (p); + cfun->outer = outer_function_chain; + outer_function_chain = cfun; set_cfun (NULL); } -void -push_function_context (void) -{ - push_function_context_to (current_function_decl); -} - /* Restore the last saved context, at the end of a nested function. This function is called from language-specific code. */ void -pop_function_context_from (tree context ATTRIBUTE_UNUSED) +pop_function_context (void) { struct function *p = outer_function_chain; set_cfun (p); outer_function_chain = p->outer; - current_function_decl = p->decl; - lang_hooks.function.leave_nested (p); - /* Reset variables that have known state during rtx generation. */ virtuals_instantiated = 0; generating_concat_p = 1; } -void -pop_function_context (void) -{ - pop_function_context_from (current_function_decl); -} - /* Clear out all parts of the state in F that can safely be discarded after the function has been parsed, but not compiled, to let garbage collection reclaim the memory. */ |