diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-04-04 14:57:18 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2008-04-04 14:57:18 +0000 |
commit | e892493899b225a21746d24221d7dc45fc19fed2 (patch) | |
tree | 4d59bdfcd5fb25b6d8efd2449db7fba8e15351f1 /gcc/cp/decl.c | |
parent | 05008a0c3c6826ee6bc4b5d0368c068af1509d58 (diff) | |
download | gcc-e892493899b225a21746d24221d7dc45fc19fed2.zip gcc-e892493899b225a21746d24221d7dc45fc19fed2.tar.gz gcc-e892493899b225a21746d24221d7dc45fc19fed2.tar.bz2 |
function.c (free_after_parsing): Replace with cxx_push_function_context from C++ front-end.
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
* function.c (free_after_parsing): Replace with
cxx_push_function_context from C++ front-end.
(allocate_struct_function): Don't call langhook.
* langhooks.h (struct lang_hooks_for_functions): Delete.
(struct lang_hooks): Add back missing_noreturn_ok_p here, delete
member "function".
* langhooks-def.h (LANG_HOOKS_MISSING_NORETURN_OK_P): Add.
(LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
LANG_HOOKS_FUNCTION_INITIALIZER): Delete.
(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_MISSING_NORETURN_OK_P,
remove LANG_HOOKS_FUNCTION_INITIALIZER.
* tree-cfg.c: Adjust call to missing_noreturn_ok_p langhook.
* c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P):
Rename to LANG_HOOKS_MISSING_NORETURN_OK_P.
cp:
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
* decl.c (cxx_push_function_context): Delete.
(cxx_pop_function_context): Delete.
(start_preparsed_function): Merge cxx_push_function_context (!f->decl
code only).
* cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
LANG_HOOKS_FUNCTION_FINAL): Delete.
(LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
LANG_HOOKS_MISSING_NORETURN_OK_P.
* cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
Delete prototype.
* semantics.c (current_stmt_tree): Fix comment.
From-SVN: r133900
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8737496..15ebf29 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11258,6 +11258,11 @@ start_preparsed_function (tree decl1, tree attrs, int flags) FIXME factor out the non-RTL stuff. */ bl = current_binding_level; allocate_struct_function (decl1, processing_template_decl); + + /* Initialize the language data structures. Whenever we start + a new function, we destroy temporaries in the usual way. */ + cfun->language = GGC_CNEW (struct language_function); + current_stmt_tree ()->stmts_are_full_exprs_p = 1; current_binding_level = bl; /* Even though we're inside a function body, we still don't want to @@ -12269,47 +12274,6 @@ revert_static_member_fn (tree decl) DECL_STATIC_FUNCTION_P (decl) = 1; } -/* Initialize the variables used during compilation of a C++ - function. */ - -void -cxx_push_function_context (struct function * f) -{ - struct language_function *p = GGC_CNEW (struct language_function); - f->language = p; - - /* Whenever we start a new function, we destroy temporaries in the - usual way. */ - current_stmt_tree ()->stmts_are_full_exprs_p = 1; - - if (f->decl) - { - tree fn = f->decl; - - if (DECL_SAVED_FUNCTION_DATA (fn)) - { - /* If we already parsed this function, and we're just expanding it - now, restore saved state. */ - *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn); - - /* We don't need the saved data anymore. Unless this is an inline - function; we need the named return value info for - declare_return_variable. */ - if (! DECL_INLINE (fn)) - DECL_SAVED_FUNCTION_DATA (fn) = NULL; - } - } -} - -/* Free the language-specific parts of F, now that we've finished - compiling the function. */ - -void -cxx_pop_function_context (struct function * f) -{ - f->language = 0; -} - /* Return which tree structure is used by T, or TS_CP_GENERIC if T is one of the language-independent trees. */ |