diff options
author | Robert Dewar <dewar@adacore.com> | 2007-06-06 12:23:26 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-06-06 12:23:26 +0200 |
commit | 1c28fe3afee2a7dde65f9aa96560d0170af3aae7 (patch) | |
tree | cfb263da79acf0351b12e03edf6c58d335c721a2 /gcc/ada/nlists.adb | |
parent | 0a36105d5657dd7126160c5bae2b9b68af63fcff (diff) | |
download | gcc-1c28fe3afee2a7dde65f9aa96560d0170af3aae7.zip gcc-1c28fe3afee2a7dde65f9aa96560d0170af3aae7.tar.gz gcc-1c28fe3afee2a7dde65f9aa96560d0170af3aae7.tar.bz2 |
sinput.ads, [...] (Unlock): New procedure.
2007-04-20 Robert Dewar <dewar@adacore.com>
* sinput.ads, sinput.adb, uintp.ads, urealp.adb, stringt.adb,
sem_elim.adb, prj-strt.adb, repinfo.ads, repinfo.adb, namet.ads,
elists.ads, elists.adb, lib.ads, lib.adb (Unlock): New procedure.
Fix lower bound of tables.
Add rep clauses.
* nlists.adb: Ditto.
(Prev_Node, Next_Node): Change index type to Int so that it properly
covers the range First_Node_Id - 1 up.
From-SVN: r125391
Diffstat (limited to 'gcc/ada/nlists.adb')
-rw-r--r-- | gcc/ada/nlists.adb | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ada/nlists.adb b/gcc/ada/nlists.adb index 5d4ef38..8778a9e 100644 --- a/gcc/ada/nlists.adb +++ b/gcc/ada/nlists.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -68,7 +68,7 @@ package body Nlists is package Lists is new Table.Table ( Table_Component_Type => List_Header, - Table_Index_Type => List_Id, + Table_Index_Type => List_Id'Base, Table_Low_Bound => First_List_Id, Table_Initial => Alloc.Lists_Initial, Table_Increment => Alloc.Lists_Increment, @@ -88,7 +88,7 @@ package body Nlists is package Next_Node is new Table.Table ( Table_Component_Type => Node_Id, - Table_Index_Type => Node_Id, + Table_Index_Type => Node_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Orig_Nodes_Initial, Table_Increment => Alloc.Orig_Nodes_Increment, @@ -96,7 +96,7 @@ package body Nlists is package Prev_Node is new Table.Table ( Table_Component_Type => Node_Id, - Table_Index_Type => Node_Id, + Table_Index_Type => Node_Id'Base, Table_Low_Bound => First_Node_Id, Table_Initial => Alloc.Orig_Nodes_Initial, Table_Increment => Alloc.Orig_Nodes_Increment, @@ -131,9 +131,20 @@ package body Nlists is -------------------------- procedure Allocate_List_Tables (N : Node_Id) is + Old_Last : constant Node_Id'Base := Next_Node.Last; + begin + pragma Assert (N >= Old_Last); Next_Node.Set_Last (N); Prev_Node.Set_Last (N); + + -- Make sure we have no uninitialized junk in any new entires added. + -- This ensures that Tree_Gen will not write out any unitialized junk. + + for J in Old_Last + 1 .. N loop + Next_Node.Table (J) := Empty; + Prev_Node.Table (J) := Empty; + end loop; end Allocate_List_Tables; ------------ @@ -1379,4 +1390,15 @@ package body Nlists is Prev_Node.Tree_Write; end Tree_Write; + ------------ + -- Unlock -- + ------------ + + procedure Unlock is + begin + Lists.Locked := False; + Prev_Node.Locked := False; + Next_Node.Locked := False; + end Unlock; + end Nlists; |