Commit 968e5643 by Richard Stallman

(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
parent 023b57e6
...@@ -812,6 +812,7 @@ poplevel (keep, reverse, functionbody) ...@@ -812,6 +812,7 @@ poplevel (keep, reverse, functionbody)
tree subblocks = current_binding_level->blocks; tree subblocks = current_binding_level->blocks;
tree block = 0; tree block = 0;
tree decl; tree decl;
int block_previously_created;
keep |= current_binding_level->keep; keep |= current_binding_level->keep;
...@@ -877,7 +878,8 @@ poplevel (keep, reverse, functionbody) ...@@ -877,7 +878,8 @@ poplevel (keep, reverse, functionbody)
create a BLOCK to record them for the life of this function. */ create a BLOCK to record them for the life of this function. */
block = 0; 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; block = current_binding_level->this_block;
else if (keep || functionbody else if (keep || functionbody
|| (current_binding_level->keep_if_subblocks && subblocks != 0)) || (current_binding_level->keep_if_subblocks && subblocks != 0))
...@@ -973,8 +975,11 @@ poplevel (keep, reverse, functionbody) ...@@ -973,8 +975,11 @@ poplevel (keep, reverse, functionbody)
if (functionbody) if (functionbody)
DECL_INITIAL (current_function_decl) = block; DECL_INITIAL (current_function_decl) = block;
else if (block) else if (block)
{
if (!block_previously_created)
current_binding_level->blocks current_binding_level->blocks
= chainon (current_binding_level->blocks, block); = chainon (current_binding_level->blocks, block);
}
/* If we did not make a block for the level just exited, /* If we did not make a block for the level just exited,
any blocks made for inner levels any blocks made for inner levels
(since they cannot be recorded as subblocks in that level) (since they cannot be recorded as subblocks in that level)
...@@ -1048,15 +1053,14 @@ insert_block (block) ...@@ -1048,15 +1053,14 @@ insert_block (block)
= chainon (current_binding_level->blocks, 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). */ (the one we are currently in). */
tree void
current_block () set_block (block)
register tree block;
{ {
if (current_binding_level->this_block == 0) current_binding_level->this_block = block;
current_binding_level->this_block = make_node (BLOCK);
return current_binding_level->this_block;
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment