+2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * function.h (block_chainon): Declare.
+ * function.c (block_chainon): Define.
+
2011-04-14 Anatoly Sokolov <aesok@post.ru>
Eric Weddington <eric.weddington@atmel.com>
Georg-Johann Lay <avr@gjlay.de>
+2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/utils.c (gnat_poplevel): Use block_chainon.
+
2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/ada-tree.h (union lang_tree_node): Check for TS_COMMON
else if (BLOCK_VARS (block) == NULL_TREE)
{
BLOCK_SUBBLOCKS (level->chain->block)
- = chainon (BLOCK_SUBBLOCKS (block),
- BLOCK_SUBBLOCKS (level->chain->block));
+ = block_chainon (BLOCK_SUBBLOCKS (block),
+ BLOCK_SUBBLOCKS (level->chain->block));
BLOCK_CHAIN (block) = free_block_chain;
free_block_chain = block;
}
+2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * decl.c (poplevel): Use block_chainon.
+
2011-04-13 Jason Merrill <jason@redhat.com>
PR c++/48594
}
else if (block)
current_binding_level->blocks
- = chainon (current_binding_level->blocks, block);
+ = block_chainon (current_binding_level->blocks, block);
/* If we did not make a block for the level just exited,
any blocks made for inner levels
of something else. */
else if (subblocks)
current_binding_level->blocks
- = chainon (current_binding_level->blocks, subblocks);
+ = block_chainon (current_binding_level->blocks, subblocks);
/* Each and every BLOCK node created here in `poplevel' is important
(e.g. for proper debugging information) so if we created one
+2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * f95-lang.c (poplevel): Use BLOCK_CHAIN and block_chainon.
+
2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
* f95-lang.c (union lang_tree_node): Check for TS_COMMON before
/* Record the BLOCK node just built as the subblock its enclosing scope. */
for (subblock_node = subblock_chain; subblock_node;
- subblock_node = TREE_CHAIN (subblock_node))
+ subblock_node = BLOCK_CHAIN (subblock_node))
BLOCK_SUPERCONTEXT (subblock_node) = block_node;
/* Clear out the meanings of the local variables of this level. */
else if (block_node)
{
current_binding_level->blocks
- = chainon (current_binding_level->blocks, block_node);
+ = block_chainon (current_binding_level->blocks, block_node);
}
/* If we did not make a block for the level just exited, any blocks made for
else. */
else if (subblock_chain)
current_binding_level->blocks
- = chainon (current_binding_level->blocks, subblock_chain);
+ = block_chainon (current_binding_level->blocks, subblock_chain);
if (block_node)
TREE_USED (block_node) = 1;
return prev;
}
+/* Concatenate two chains of blocks (chained through BLOCK_CHAIN)
+ by modifying the last node in chain 1 to point to chain 2. */
+
+tree
+block_chainon (tree op1, tree op2)
+{
+ tree t1;
+
+ if (!op1)
+ return op2;
+ if (!op2)
+ return op1;
+
+ for (t1 = op1; BLOCK_CHAIN (t1); t1 = BLOCK_CHAIN (t1))
+ continue;
+ BLOCK_CHAIN (t1) = op2;
+
+#ifdef ENABLE_TREE_CHECKING
+ {
+ tree t2;
+ for (t2 = op2; t2; t2 = BLOCK_CHAIN (t2))
+ gcc_assert (t2 != t1);
+ }
+#endif
+
+ return op1;
+}
+
/* Count the subblocks of the list starting with BLOCK. If VECTOR is
non-NULL, list them all into VECTOR, in a depth-first preorder
traversal of the block tree. Also clear TREE_ASM_WRITTEN in all
extern void clear_block_marks (tree);
extern tree blocks_nreverse (tree);
+extern tree block_chainon (tree, tree);
/* Return size needed for stack frame based on slots so far allocated.
This size counts from zero. It is not rounded to STACK_BOUNDARY;
+2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * decl.c (poplevel): Use BLOCK_CHAIN and block_chainon.
+
2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
* java-tree.h (union lang_tree_node): Check for TS_COMMON before
/* In each subblock, record that this is its superior. */
- for (link = subblocks; link; link = TREE_CHAIN (link))
+ for (link = subblocks; link; link = BLOCK_CHAIN (link))
BLOCK_SUPERCONTEXT (link) = block;
/* Clear out the meanings of the local variables of this level. */
if (block)
{
current_binding_level->blocks
- = chainon (current_binding_level->blocks, block);
+ = block_chainon (current_binding_level->blocks, block);
}
/* If we did not make a block for the level just exited,
any blocks made for inner levels
of something else. */
else if (subblocks)
current_binding_level->blocks
- = chainon (current_binding_level->blocks, subblocks);
+ = block_chainon (current_binding_level->blocks, subblocks);
if (bind)
java_add_stmt (bind);