aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elab.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-06-11 12:52:35 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-06-11 12:52:35 +0200
commit2e57f88b778de597f3bd3ed2fbe2b634eb46fc2d (patch)
tree8164bb2479d90ef5d1bb21f44ae01230e59b55a6 /gcc/ada/sem_elab.adb
parentc230ed0b7e7cfec4bc9c437f833aa703ac9b3f95 (diff)
downloadgcc-2e57f88b778de597f3bd3ed2fbe2b634eb46fc2d.zip
gcc-2e57f88b778de597f3bd3ed2fbe2b634eb46fc2d.tar.gz
gcc-2e57f88b778de597f3bd3ed2fbe2b634eb46fc2d.tar.bz2
[multiple changes]
2014-06-11 Geert Bosch <bosch@adacore.com> * s-exctab.adb: avoid race conditions in exception registration. 2014-06-11 Robert Dewar <dewar@adacore.com> * errout.adb (Warn_Insertion): New function. (Error_Msg): Use Warn_Insertion and Prescan_Message. (Error_Msg_Internal): Set Info field of error object. (Error_Msg_NEL): Use Prescan_Message. (Set_Msg_Text): Don't store info: at start of message. (Skip_Msg_Insertion_Warning): New name for Set_Msg_Insertion_Warning. (Skip_Msg_Insertion_Warning): Now just skips warning insertion. * errout.ads: Document new ?$? and >$> insertion sequences Document use of "(style)" and "info: " * erroutc.adb (dmsg): Print several missing fields (Get_Warning_Tag): Handle -gnatel case (?$?) (Output_Msg_Text): Deal with new tagging of info messages * erroutc.ads: Is_Info_Msg: New global (Error_Msg_Object): Add field Info (Prescan_Message): New procedure, this procedure replaces the old Test_Style_Warning_Serious_Unconditional_Msg * errutil.adb, exp_util.adb, par-ch7.adb, sem_ch13.adb, sem_ch7.adb, sem_elab.adb: Follow new rules for info message (info belongs only at the start of a message, and only in the first message, not in any of the continuations). * gnat_ugn.texi: Document full set of warning tags. From-SVN: r211447
Diffstat (limited to 'gcc/ada/sem_elab.adb')
-rw-r--r--gcc/ada/sem_elab.adb55
1 files changed, 36 insertions, 19 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 7f494d8..da32731 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -942,7 +942,7 @@ package body Sem_Elab is
if Inst_Case then
Elab_Warning
("instantiation of& may raise Program_Error?l?",
- "info: instantiation of& during elaboration?", Ent);
+ "info: instantiation of& during elaboration?$?", Ent);
-- Indirect call case, info message only in static elaboration
-- case, because the attribute reference itself cannot raise
@@ -950,7 +950,7 @@ package body Sem_Elab is
elsif Access_Case then
Elab_Warning
- ("", "info: access to& during elaboration?", Ent);
+ ("", "info: access to& during elaboration?$?", Ent);
-- Subprogram call case
@@ -961,13 +961,13 @@ package body Sem_Elab is
then
Elab_Warning
("implicit call to & may raise Program_Error?l?",
- "info: implicit call to & during elaboration?",
+ "info: implicit call to & during elaboration?$?",
Ent);
else
Elab_Warning
("call to & may raise Program_Error?l?",
- "info: call to & during elaboration?",
+ "info: call to & during elaboration?$?",
Ent);
end if;
end if;
@@ -977,13 +977,13 @@ package body Sem_Elab is
if Nkind (N) in N_Subprogram_Instantiation then
Elab_Warning
("\missing pragma Elaborate for&?l?",
- "\info: implicit pragma Elaborate for& generated?",
+ "\implicit pragma Elaborate for& generated?$?",
W_Scope);
else
Elab_Warning
("\missing pragma Elaborate_All for&?l?",
- "\info: implicit pragma Elaborate_All for & generated?",
+ "\implicit pragma Elaborate_All for & generated?$?",
W_Scope);
end if;
end Generate_Elab_Warnings;
@@ -1063,7 +1063,7 @@ package body Sem_Elab is
Error_Msg_Node_2 := W_Scope;
Error_Msg_NE
("info: call to& in elaboration code " &
- "requires pragma Elaborate_All on&?", N, E);
+ "requires pragma Elaborate_All on&?$?", N, E);
end if;
-- Set indication for binder to generate Elaborate_All
@@ -2320,15 +2320,14 @@ package body Sem_Elab is
if Inst_Case then
Error_Msg_NE
- ("instantiation of& may occur before body is seen<<",
+ ("instantiation of& may occur before body is seen<l<",
N, Orig_Ent);
else
Error_Msg_NE
- ("call to& may occur before body is seen<<", N, Orig_Ent);
+ ("call to& may occur before body is seen<l<", N, Orig_Ent);
end if;
- Error_Msg_N
- ("\Program_Error ]<<", N);
+ Error_Msg_N ("\Program_Error ]<l<", N);
Output_Calls (N);
end if;
@@ -2570,7 +2569,7 @@ package body Sem_Elab is
Error_Msg_Node_2 := Task_Scope;
Error_Msg_NE
("info: activation of an instance of task type&" &
- " requires pragma Elaborate_All on &?", N, Ent);
+ " requires pragma Elaborate_All on &?$?", N, Ent);
end if;
Activate_Elaborate_All_Desirable (N, Task_Scope);
@@ -3056,6 +3055,10 @@ package body Sem_Elab is
-- by the error message circuits (i.e. it has a single upper
-- case letter at the end).
+ -----------------------------
+ -- Is_Printable_Error_Name --
+ -----------------------------
+
function Is_Printable_Error_Name (Nm : Name_Id) return Boolean is
begin
if not Is_Internal_Name (Nm) then
@@ -3078,17 +3081,31 @@ package body Sem_Elab is
Ent := Elab_Call.Table (J).Ent;
- if Is_Generic_Unit (Ent) then
- Error_Msg_NE ("\??& instantiated #", N, Ent);
+ -- Dynamic elaboration model, warnings controlled by -gnatwl
- elsif Is_Init_Proc (Ent) then
- Error_Msg_N ("\??initialization procedure called #", N);
+ if Dynamic_Elaboration_Checks then
+ if Is_Generic_Unit (Ent) then
+ Error_Msg_NE ("\\?l?& instantiated #", N, Ent);
+ elsif Is_Init_Proc (Ent) then
+ Error_Msg_N ("\\?l?initialization procedure called #", N);
+ elsif Is_Printable_Error_Name (Chars (Ent)) then
+ Error_Msg_NE ("\\?l?& called #", N, Ent);
+ else
+ Error_Msg_N ("\\?l?called #", N);
+ end if;
- elsif Is_Printable_Error_Name (Chars (Ent)) then
- Error_Msg_NE ("\??& called #", N, Ent);
+ -- Static elaboration model, info messages controlled by -gnatel
else
- Error_Msg_N ("\?? called #", N);
+ if Is_Generic_Unit (Ent) then
+ Error_Msg_NE ("\\?$?& instantiated #", N, Ent);
+ elsif Is_Init_Proc (Ent) then
+ Error_Msg_N ("\\?$?initialization procedure called #", N);
+ elsif Is_Printable_Error_Name (Chars (Ent)) then
+ Error_Msg_NE ("\\?$?& called #", N, Ent);
+ else
+ Error_Msg_N ("\\?$?called #", N);
+ end if;
end if;
end loop;
end Output_Calls;