diff options
author | Jason Merrill <jason@redhat.com> | 2009-09-08 14:12:37 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-09-08 14:12:37 -0400 |
commit | 02c5ff73d4f5079748e004854024c656c2e6afc9 (patch) | |
tree | 2339e78f9bc818c70ec05a01489f0027d1558a3a | |
parent | 3e54529c11ba739ea0a6d7c5a2daa16680a73e14 (diff) | |
download | gcc-02c5ff73d4f5079748e004854024c656c2e6afc9.zip gcc-02c5ff73d4f5079748e004854024c656c2e6afc9.tar.gz gcc-02c5ff73d4f5079748e004854024c656c2e6afc9.tar.bz2 |
decl.c (grokmethod): Rename from start_method.
* decl.c (grokmethod): Rename from start_method.
(finish_method): Remove.
* cp-tree.h: Adjust.
* parser.c (cp_parser_save_member_function_body): Adjust.
From-SVN: r151526
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 57 | ||||
-rw-r--r-- | gcc/cp/parser.c | 7 |
4 files changed, 12 insertions, 62 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bac7098..69eb476 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2009-09-02 Jason Merrill <jason@redhat.com> + + * decl.c (grokmethod): Rename from start_method. + (finish_method): Remove. + * cp-tree.h: Adjust. + * parser.c (cp_parser_save_member_function_body): Adjust. + 2009-09-03 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 23b41d3..4f03868 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4418,8 +4418,7 @@ extern tree begin_function_body (void); extern void finish_function_body (tree); extern tree outer_curly_brace_block (tree); extern tree finish_function (int); -extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree); -extern tree finish_method (tree); +extern tree grokmethod (cp_decl_specifier_seq *, const cp_declarator *, tree); extern void maybe_register_incomplete_var (tree); extern void maybe_commonize_var (tree); extern void complete_vars (tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index cad0fc5..99ae9f1 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12444,8 +12444,8 @@ finish_function (int flags) CHANGES TO CODE IN `grokfield'. */ tree -start_method (cp_decl_specifier_seq *declspecs, - const cp_declarator *declarator, tree attrlist) +grokmethod (cp_decl_specifier_seq *declspecs, + const cp_declarator *declarator, tree attrlist) { tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, &attrlist); @@ -12499,62 +12499,9 @@ start_method (cp_decl_specifier_seq *declspecs, cp_finish_decl (fndecl, NULL_TREE, false, NULL_TREE, 0); - /* Make a place for the parms. */ - begin_scope (sk_function_parms, fndecl); - DECL_IN_AGGR_P (fndecl) = 1; return fndecl; } - -/* Go through the motions of finishing a function definition. - We don't compile this method until after the whole class has - been processed. - - FINISH_METHOD must return something that looks as though it - came from GROKFIELD (since we are defining a method, after all). - - This is called after parsing the body of the function definition. - STMTS is the chain of statements that makes up the function body. - - DECL is the ..._DECL that `start_method' provided. */ - -tree -finish_method (tree decl) -{ - tree fndecl = decl; - tree old_initial; - - tree link; - - if (decl == void_type_node) - return decl; - - old_initial = DECL_INITIAL (fndecl); - - /* Undo the level for the parms (from start_method). - This is like poplevel, but it causes nothing to be - saved. Saving information here confuses symbol-table - output routines. Besides, this information will - be correctly output when this method is actually - compiled. */ - - /* Clear out the meanings of the local variables of this level; - also record in each decl which block it belongs to. */ - - for (link = current_binding_level->names; link; link = TREE_CHAIN (link)) - { - if (DECL_NAME (link) != NULL_TREE) - pop_binding (DECL_NAME (link), link); - gcc_assert (TREE_CODE (link) != FUNCTION_DECL); - DECL_CONTEXT (link) = NULL_TREE; - } - - poplevel (0, 0, 0); - - DECL_INITIAL (fndecl) = old_initial; - - return decl; -} /* VAR is a VAR_DECL. If its type is incomplete, remember VAR so that diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 64869cd..14733b8 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18172,8 +18172,8 @@ cp_parser_save_member_function_body (cp_parser* parser, cp_token *last; tree fn; - /* Create the function-declaration. */ - fn = start_method (decl_specifiers, declarator, attributes); + /* Create the FUNCTION_DECL. */ + fn = grokmethod (decl_specifiers, declarator, attributes); /* If something went badly wrong, bail out now. */ if (fn == error_mark_node) { @@ -18221,9 +18221,6 @@ cp_parser_save_member_function_body (cp_parser* parser, friend templates are handled correctly. */ DECL_INITIALIZED_IN_CLASS_P (fn) = 1; - /* We're done with the inline definition. */ - finish_method (fn); - /* Add FN to the queue of functions to be parsed later. */ TREE_VALUE (parser->unparsed_functions_queues) = tree_cons (NULL_TREE, fn, |