From: Richard Stallman Date: Tue, 1 Sep 1992 20:30:57 +0000 (+0000) Subject: (current_block): Function deleted. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=968e5643fcba38e3e84dae02a0e1945c65fc1c83;p=gcc.git (current_block): Function deleted. (set_block): New function. (poplevel): If using a previously created block, don't insert it into the parent level. From-SVN: r2015 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6e2e4601110..936b8eacfb5 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -812,6 +812,7 @@ poplevel (keep, reverse, functionbody) tree subblocks = current_binding_level->blocks; tree block = 0; tree decl; + int block_previously_created; keep |= current_binding_level->keep; @@ -877,7 +878,8 @@ poplevel (keep, reverse, functionbody) create a BLOCK to record them for the life of this function. */ block = 0; - if (current_binding_level->this_block != 0) + block_previously_created = (current_binding_level->this_block != 0); + if (block_previously_created) block = current_binding_level->this_block; else if (keep || functionbody || (current_binding_level->keep_if_subblocks && subblocks != 0)) @@ -973,8 +975,11 @@ poplevel (keep, reverse, functionbody) if (functionbody) DECL_INITIAL (current_function_decl) = block; else if (block) - current_binding_level->blocks - = chainon (current_binding_level->blocks, block); + { + if (!block_previously_created) + current_binding_level->blocks + = chainon (current_binding_level->blocks, block); + } /* If we did not make a block for the level just exited, any blocks made for inner levels (since they cannot be recorded as subblocks in that level) @@ -1048,15 +1053,14 @@ insert_block (block) = chainon (current_binding_level->blocks, block); } -/* Return the BLOCK node for the innermost scope +/* Set the BLOCK node for the innermost scope (the one we are currently in). */ -tree -current_block () +void +set_block (block) + register tree block; { - if (current_binding_level->this_block == 0) - current_binding_level->this_block = make_node (BLOCK); - return current_binding_level->this_block; + current_binding_level->this_block = block; } void