[COMMITTED,12/31] ada: Add elaboration switch tags to info messages

Message ID 20240521073035.314024-12-poulhies@adacore.com
State Committed
Commit 21484502b0d773ae485be9c9b814b30f2b52fb2f
Headers
Series [COMMITTED,01/31] ada: Add new Mingw task priority mapping |

Commit Message

Marc Poulhiès May 21, 2024, 7:30 a.m. UTC
  From: Viljar Indus <indus@adacore.com>

Add the ?$? insertion characters for elaboration
message so they would be marked with the [-gnatel]
tag. Note that these insertion characters were
not added for SPARK elaboration messages:

gcc/ada/

	* sem_elab.adb: Add missing elaboration insertion
	characters to info messages.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_elab.adb | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 9205f4cef82..4d6e14cc49c 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -4920,7 +4920,7 @@  package body Sem_Elab is
            and then not New_In_State.Suppress_Info_Messages
          then
             Error_Msg_NE
-              ("info: access to & during elaboration", Attr, Subp_Id);
+              ("info: access to & during elaboration?$?", Attr, Subp_Id);
          end if;
 
          --  Warnings are suppressed when a prior scenario is already in that
@@ -5027,7 +5027,7 @@  package body Sem_Elab is
            and then not New_In_State.Suppress_Info_Messages
          then
             Error_Msg_NE
-              ("info: activation of & during elaboration", Call, Obj_Id);
+              ("info: activation of & during elaboration?$?", Call, Obj_Id);
          end if;
 
          --  Nothing to do when the call activates a task whose type is defined
@@ -6461,7 +6461,7 @@  package body Sem_Elab is
             if In_SPARK then
                return " in SPARK";
             else
-               return "";
+               return "?$?";
             end if;
          end Suffix;
 
@@ -8277,7 +8277,9 @@  package body Sem_Elab is
                Error_Msg_Name_1     := Prag_Nam;
                Error_Msg_Qual_Level := Nat'Last;
 
-               Error_Msg_NE ("info: missing pragma % for unit &", N, Unit_Id);
+               Error_Msg_NE
+                 ("info: missing pragma % for unit &?$?", N,
+                  Unit_Id);
                Error_Msg_Qual_Level := 0;
             end if;
          end Info_Missing_Pragma;
@@ -8406,7 +8408,8 @@  package body Sem_Elab is
                Error_Msg_Qual_Level := Nat'Last;
 
                Error_Msg_NE
-                 ("info: implicit pragma % generated for unit &", N, Unit_Id);
+                 ("info: implicit pragma % generated for unit &?$?",
+                   N, Unit_Id);
 
                Error_Msg_Qual_Level := 0;
                Output_Active_Scenarios (N, In_State);