From 94cb56d550109103147375802c32ff783ede72f1 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 20 Oct 2015 10:53:39 +0000 Subject: [PATCH] 2015-10-20 Ed Schonberg * sem_smem.adb (Check_Shared_Var): Clean up code that handles type declarations with discriminants, remove obsolete check. 2015-10-20 Arnaud Charlet * par_sco.adb: Minor style fixes. 2015-10-20 Vincent Celier * debug.adb: Update documentation of -gnatdu. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229048 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 13 +++++++++++++ gcc/ada/debug.adb | 11 ++++++----- gcc/ada/par_sco.adb | 7 ++++--- gcc/ada/sem_smem.adb | 9 +++++++-- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1278c0a..5e189a1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,16 @@ +2015-10-20 Ed Schonberg + + * sem_smem.adb (Check_Shared_Var): Clean up code that handles + type declarations with discriminants, remove obsolete check. + +2015-10-20 Arnaud Charlet + + * par_sco.adb: Minor style fixes. + +2015-10-20 Vincent Celier + + * debug.adb: Update documentation of -gnatdu. + 2015-10-20 Hristian Kirtchev * aspects.adb Add aspect Volatile_Function to table diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 0ee0a98..29872b6 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -316,14 +316,15 @@ package body Debug is -- dt Print full tree. The generated tree is output (see also df,dy) -- du Uncheck categorization pragmas. This debug switch causes the - -- categorization pragmas (Pure, Preelaborate etc) to be ignored - -- so that normal checks are not made (this is particularly useful - -- for adding temporary debugging code to units that have pragmas - -- that are inconsistent with the debugging code added. + -- elaboration control pragmas (Pure, Preelaborate, etc.) and the + -- categorization pragmas (Shared_Passive, Remote_Types, etc.) to be + -- ignored, so that normal checks are not made (this is particularly + -- useful for adding temporary debugging code to units that have + -- pragmas that are inconsistent with the debugging code added). -- dv Output trace of overload resolution. Outputs messages for -- overload attempts that involve cascaded errors, or where - -- an interepretation is incompatible with the context. + -- an interpretation is incompatible with the context. -- dw Write semantic scope stack messages. Each time a scope is created -- or removed, a message is output (see the Sem_Ch8.Push_Scope and diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 8593dab..c1e6f03 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -851,11 +851,12 @@ package body Par_SCO is -- Now we have the definitive set of SCO entries, register them in the -- corresponding hash table. - for I in 1 .. Hash_Entries.Last loop + for J in 1 .. Hash_Entries.Last loop SCO_Raw_Hash_Table.Set - (Hash_Entries.Table (I).Sloc, - Hash_Entries.Table (I).SCO_Index); + (Hash_Entries.Table (J).Sloc, + Hash_Entries.Table (J).SCO_Index); end loop; + Hash_Entries.Free; end Process_Decisions; diff --git a/gcc/ada/sem_smem.adb b/gcc/ada/sem_smem.adb index bca184e..6a25501 100644 --- a/gcc/ada/sem_smem.adb +++ b/gcc/ada/sem_smem.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2015, 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- -- @@ -92,6 +92,8 @@ package body Sem_Smem is elsif Is_Record_Type (T) and then not Is_Constrained (T) + and then (Nkind (N) /= N_Object_Declaration + or else No (Expression (N))) then Error_Msg_N ("unconstrained variant records " & @@ -116,9 +118,12 @@ package body Sem_Smem is elsif Is_Record_Type (T) then if Has_Discriminants (T) then + + -- Check for access discriminants. + C := First_Discriminant (T); while Present (C) loop - if Comes_From_Source (C) then + if Is_Access_Type (Etype (C)) then return True; else C := Next_Discriminant (C); -- 2.7.4