diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2011-04-14 11:18:40 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2011-04-14 11:18:40 +0000 |
commit | 61e46a7d5e8031930c341dc122ba614d6970886b (patch) | |
tree | 639555a2163347dbebd098a7599ee397b518a58a /gcc | |
parent | 023009d4d1a7471a5b965af6baf2d721e607fe92 (diff) | |
download | gcc-61e46a7d5e8031930c341dc122ba614d6970886b.zip gcc-61e46a7d5e8031930c341dc122ba614d6970886b.tar.gz gcc-61e46a7d5e8031930c341dc122ba614d6970886b.tar.bz2 |
utils.c (gnat_poplevel): Use block_chainon.
gcc/ada/
* gcc-interface/utils.c (gnat_poplevel): Use block_chainon.
gcc/
* function.h (block_chainon): Declare.
* function.c (block_chainon): Define.
gcc/cp/
* decl.c (poplevel): Use block_chainon.
gcc/fortran//
* f95-lang.c (poplevel): Use BLOCK_CHAIN and block_chainon.
gcc/java/
* decl.c (poplevel): Use BLOCK_CHAIN and block_chainon.
From-SVN: r172418
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 6 | ||||
-rw-r--r-- | gcc/function.c | 28 | ||||
-rw-r--r-- | gcc/function.h | 1 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/java/decl.c | 6 |
11 files changed, 60 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d0c01a..0aa3fab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2c0aeb8..3e85959 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 3ecea18..1031ee9 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -459,8 +459,8 @@ gnat_poplevel (void) 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; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 05f12be..271da0c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7dea9b7..7553886 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -794,7 +794,7 @@ poplevel (int keep, int reverse, int functionbody) } 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 @@ -803,7 +803,7 @@ poplevel (int keep, int reverse, int functionbody) 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 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 96b92dc..5e155e0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index ffe8953..eb38484 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -444,7 +444,7 @@ poplevel (int keep, int reverse, int functionbody) /* 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. */ @@ -475,7 +475,7 @@ poplevel (int keep, int reverse, int functionbody) 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 @@ -484,7 +484,7 @@ poplevel (int keep, int reverse, int functionbody) 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; diff --git a/gcc/function.c b/gcc/function.c index c292282..dd42fba 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4179,6 +4179,34 @@ blocks_nreverse (tree t) 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 diff --git a/gcc/function.h b/gcc/function.h index 6e7f539..73af294 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -713,6 +713,7 @@ extern void number_blocks (tree); 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; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0c19120..a96b507 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 75f44c9..cb01248 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1481,7 +1481,7 @@ poplevel (int keep, int reverse, int functionbody) /* 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. */ @@ -1545,7 +1545,7 @@ poplevel (int keep, int reverse, int functionbody) 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 @@ -1554,7 +1554,7 @@ poplevel (int keep, int reverse, int functionbody) 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); |