]> gcc.gnu.org Git - gcc.git/commitdiff
(current_block): Function deleted.
authorRichard Stallman <rms@gnu.org>
Tue, 1 Sep 1992 20:30:57 +0000 (20:30 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 1 Sep 1992 20:30:57 +0000 (20:30 +0000)
(set_block):  New function.
(poplevel): If using a previously created block,
don't insert it into the parent level.

From-SVN: r2015

gcc/c-decl.c

index 6e2e46011106e651579ba1fd59a1ea0050f6376e..936b8eacfb5c393e3ca5022f7af257f0f7c3fa5a 100644 (file)
@@ -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;
 }
 \f
 void
This page took 0.072579 seconds and 5 git commands to generate.