diff options
author | Robert Dewar <dewar@adacore.com> | 2008-03-26 08:43:59 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-03-26 08:43:59 +0100 |
commit | 7e5e5cc7c4f75b465e1bcb0e4e5037297c5ce38e (patch) | |
tree | 6950f932ec7e2043a54a277a6f82a9c5c322856a /gcc/ada/sem_elab.adb | |
parent | bc9bb02d4ec4130e7e6ffdbb29f6fc57b4137a6c (diff) | |
download | gcc-7e5e5cc7c4f75b465e1bcb0e4e5037297c5ce38e.tar.gz |
tbuild.ads, [...] (N_Pragma): Chars field removed, use Chars (Pragma_Identifier (..
2008-03-26 Robert Dewar <dewar@adacore.com>
* tbuild.ads, tbuild.adb, trans.c, sprint.adb, exp_prag.adb, decl.c,
par-ch2.adb, sem_elab.adb, sem_util.ads (N_Pragma): Chars field
removed, use Chars (Pragma_Identifier (.. instead, adjustments
throughout to accomodate this change.
* s-pooglo.ads, s-pooloc.ads: Minor comment updates
* exp_dbug.adb: Use Sem_Util.Set_Debug_Info_Needed (not
Einfo.Set_Needs_Debug_Info)
From-SVN: r133587
Diffstat (limited to 'gcc/ada/sem_elab.adb')
-rw-r--r-- | gcc/ada/sem_elab.adb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index e3bd6897a1c..922a16d53ae 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2008, 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- -- @@ -1654,12 +1654,6 @@ package body Sem_Elab is return; end if; - -- All OK if warnings suppressed on the entity - - if Warnings_Off (Ent) then - return; - end if; - -- All OK if all warnings suppressed if Warning_Mode = Suppress then @@ -1691,16 +1685,20 @@ package body Sem_Elab is -- Here is where we give the warning - Error_Msg_Sloc := Sloc (Ent); + -- All OK if warnings suppressed on the entity - Error_Msg_NE - ("?elaboration code may access& before it is initialized", - N, Ent); - Error_Msg_NE - ("\?suggest adding pragma Elaborate_Body to spec of &", - N, Scop); - Error_Msg_N - ("\?or an explicit initialization could be added #", N); + if not Has_Warnings_Off (Ent) then + Error_Msg_Sloc := Sloc (Ent); + + Error_Msg_NE + ("?elaboration code may access& before it is initialized", + N, Ent); + Error_Msg_NE + ("\?suggest adding pragma Elaborate_Body to spec of &", + N, Scop); + Error_Msg_N + ("\?or an explicit initialization could be added #", N); + end if; if not All_Errors_Mode then Set_Suppress_Elaboration_Warnings (Ent); @@ -3109,7 +3107,7 @@ package body Sem_Elab is Item := First (Context_Items (Cunit (Current_Sem_Unit))); while Present (Item) loop if Nkind (Item) = N_Pragma - and then Get_Pragma_Id (Chars (Item)) = Pragma_Elaborate_All + and then Pragma_Name (Item) = Name_Elaborate_All then -- Return if some previous error on the pragma itself |