parse.y (function_body): Suppress the block for the outermost curly braces.

* parse.y (function_body): Suppress the block for the outermost
        curly braces.
        * decl.c (pushdecl): Don't try to skip it.
        (begin_function_body): Keep the block we create, not the next one.
        * init.c (emit_base_init): Don't mess with keep_next_level.

From-SVN: r49076
This commit is contained in:
Jason Merrill 2002-01-22 09:42:09 -05:00 committed by Jason Merrill
parent 6bc34b14ef
commit b58564754b
4 changed files with 23 additions and 18 deletions

View File

@ -1,5 +1,11 @@
2002-01-22 Jason Merrill <jason@redhat.com>
* parse.y (function_body): Suppress the block for the outermost
curly braces.
* decl.c (pushdecl): Don't try to skip it.
(begin_function_body): Keep the block we create, not the next one.
* init.c (emit_base_init): Don't mess with keep_next_level.
* class.c (build_base_path): Tweak formatting.
2002-01-19 Nathan Sidwell <nathan@codesourcery.com>

View File

@ -4207,9 +4207,6 @@ pushdecl (x)
them there. */
struct binding_level *b = current_binding_level->level_chain;
/* Skip the ctor/dtor cleanup level. */
b = b->level_chain;
/* ARM $8.3 */
if (b->parm_flag == 1)
{
@ -14054,6 +14051,14 @@ begin_function_body ()
{
tree stmt;
if (processing_template_decl)
/* Do nothing now. */;
else
/* Always keep the BLOCK node associated with the outermost pair of
curly braces of a function. These are needed for correct
operation of dwarfout.c. */
keep_next_level (1);
stmt = begin_compound_stmt (0);
COMPOUND_STMT_BODY_BLOCK (stmt) = 1;
@ -14064,11 +14069,6 @@ begin_function_body ()
else if (DECL_DESTRUCTOR_P (current_function_decl))
begin_destructor_body ();
/* Always keep the BLOCK node associated with the outermost pair of
curly braces of a function. These are needed for correct
operation of dwarfout.c. */
keep_next_level (1);
return stmt;
}

View File

@ -668,11 +668,6 @@ emit_base_init (mem_init_list, base_init_list)
int i;
int n_baseclasses = BINFO_N_BASETYPES (t_binfo);
/* We did a keep_next_level (1) in begin_function_body. We don't want
that to apply to any blocks generated for member initializers, so
clear it out. */
keep_next_level (0);
mem_init_list = sort_member_init (t, mem_init_list);
sort_base_init (t, base_init_list, &rbase_init_list, &vbase_init_list);
@ -753,9 +748,6 @@ emit_base_init (mem_init_list, base_init_list)
perform_member_init (member, init, from_init_list);
mem_init_list = TREE_CHAIN (mem_init_list);
}
/* And restore it. */
keep_next_level (1);
}
/* Returns the address of the vtable (i.e., the value that should be

View File

@ -758,9 +758,16 @@ eat_saved_input:
| END_OF_SAVED_INPUT
;
/* The outermost block of a function really begins before the
mem-initializer-list, so we open one there and suppress the one that
actually corresponds to the curly braces. */
function_body:
.begin_function_body ctor_initializer_opt compstmt
{
.begin_function_body ctor_initializer_opt save_lineno '{'
{ $<ttype>$ = begin_compound_stmt (/*has_no_scope=*/1); }
compstmtend
{
STMT_LINENO ($<ttype>5) = $3;
finish_compound_stmt (/*has_no_scope=*/1, $<ttype>5);
finish_function_body ($1);
}
;