From 1d6f10a19473c4c174bcb8295163be080ae6f64e Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Tue, 14 Aug 2007 10:46:03 +0200 Subject: table.adb, [...] (Append): Reimplement in terms of Set_Item. 2007-08-14 Thomas Quinot * table.adb, g-table.adb, g-dyntab.adb (Append): Reimplement in terms of Set_Item. (Set_Item): When the new item is an element of the currently allocated table passed by reference, save a copy on the stack if we're going to reallocate. Also, in Table.Set_Item, make sure we test the proper variable to determine whether to call Set_Last. * sinput-d.adb, sinput-l.adb, stringt.adb, switch-m.adb, symbols-vms.adb, symbols-processing-vms-alpha.adb, symbols-processing-vms-ia64.adb, sem_elab.adb, repinfo.adb: Replace some occurrences of the pattern T.Increment_Last; T.Table (T.Last) := Value; with a cleaner call to T.Append (Value); From-SVN: r127442 --- gcc/ada/sem_elab.adb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'gcc/ada/sem_elab.adb') diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index bae6a9f..137ac4e 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -1906,14 +1906,13 @@ package body Sem_Elab is -- Delay this call if we are still delaying calls if Delaying_Elab_Checks then - Delay_Check.Increment_Last; - Delay_Check.Table (Delay_Check.Last) := + Delay_Check.Append ( (N => N, E => E, Orig_Ent => Orig_Ent, Curscop => Current_Scope, Outer_Scope => Outer_Scope, - From_Elab_Code => From_Elab_Code); + From_Elab_Code => From_Elab_Code)); return; -- Otherwise, call phase 2 continuation right now @@ -2031,8 +2030,7 @@ package body Sem_Elab is Outer_Level_Sloc := Loc; end if; - Elab_Visited.Increment_Last; - Elab_Visited.Table (Elab_Visited.Last) := E; + Elab_Visited.Append (E); -- If the call is to a function that renames a literal, no check -- is needed. @@ -2076,9 +2074,7 @@ package body Sem_Elab is else pragma Assert (Nkind (Sbody) = N_Subprogram_Body); - Elab_Call.Increment_Last; - Elab_Call.Table (Elab_Call.Last).Cloc := Loc; - Elab_Call.Table (Elab_Call.Last).Ent := E; + Elab_Call.Append ((Cloc => Loc, Ent => E)); if Debug_Flag_LL then Write_Str ("Elab_Call.Last = "); -- cgit v1.1