From: Viljar Indus Date: Tue, 12 Nov 2024 10:32:05 +0000 (+0200) Subject: ada: Relocate implementation of Set_Msg_Insertion_Column X-Git-Tag: basepoints/gcc-16~3866 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b33f74c84ef5681ccb735209d95479a5ece7377;p=thirdparty%2Fgcc.git ada: Relocate implementation of Set_Msg_Insertion_Column The implementation was duplicated in errout and errutil. Move the implementation to erroutc where other similar commonly used functions are. gcc/ada/ChangeLog: * errout.adb: Remove implemntation of Set_Msg_Insertion_Column. * erroutc.adb: Add implementation of Set_Msg_Insertion_Column. * erroutc.ads: Add spec of Set_Msg_Insertion_Column. * errutil.adb: Remove implementation of Set_Msg_Insertion_Column. --- diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 8858df117374..4070d92992d5 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -52,7 +52,6 @@ with Sinfo.Utils; use Sinfo.Utils; with Snames; use Snames; with Stand; use Stand; with Stringt; use Stringt; -with Stylesw; use Stylesw; with System.OS_Lib; with Uname; use Uname; with Warnsw; @@ -143,9 +142,6 @@ package body Errout is -- around node N are required by the Ada syntax, e.g. when N is an -- expression of a qualified expression. - procedure Set_Msg_Insertion_Column; - -- Handle column number insertion (@ insertion character) - procedure Set_Msg_Insertion_Node; -- Handle node (name from node) insertion (& insertion character) @@ -3776,18 +3772,6 @@ package body Errout is Errors_Must_Be_Ignored := To; end Set_Ignore_Errors; - ------------------------------ - -- Set_Msg_Insertion_Column -- - ------------------------------ - - procedure Set_Msg_Insertion_Column is - begin - if RM_Column_Check then - Set_Msg_Str (" in column "); - Set_Msg_Int (Int (Error_Msg_Col) + 1); - end if; - end Set_Msg_Insertion_Column; - ---------------------------- -- Set_Msg_Insertion_Node -- ---------------------------- diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index 9d22996204c1..209159e1765b 100644 --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -42,6 +42,7 @@ with Sinfo.Nodes; with Sinput; use Sinput; with Snames; use Snames; with Stringt; use Stringt; +with Stylesw; use Stylesw; with Targparm; with Uintp; use Uintp; with Widechar; use Widechar; @@ -1330,6 +1331,18 @@ package body Erroutc is end loop; end Set_Msg_Insertion_Code; + ------------------------------ + -- Set_Msg_Insertion_Column -- + ------------------------------ + + procedure Set_Msg_Insertion_Column is + begin + if RM_Column_Check then + Set_Msg_Str (" in column "); + Set_Msg_Int (Int (Error_Msg_Col) + 1); + end if; + end Set_Msg_Insertion_Column; + --------------------------------- -- Set_Msg_Insertion_File_Name -- --------------------------------- diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads index 76cd0205fa84..0853bdbeab6f 100644 --- a/gcc/ada/erroutc.ads +++ b/gcc/ada/erroutc.ads @@ -576,6 +576,9 @@ package Erroutc is procedure Set_Msg_Insertion_Code; -- Handle error code insertion ([] insertion character) + procedure Set_Msg_Insertion_Column; + -- Handle column number insertion (@ insertion character) + procedure Set_Msg_Insertion_File_Name; -- Handle file name insertion (left brace insertion character) diff --git a/gcc/ada/errutil.adb b/gcc/ada/errutil.adb index 1094e8ac3179..0891d4618aa7 100644 --- a/gcc/ada/errutil.adb +++ b/gcc/ada/errutil.adb @@ -32,7 +32,6 @@ with Output; use Output; with Scans; use Scans; with Sinput; use Sinput; with Stringt; use Stringt; -with Stylesw; use Stylesw; package body Errutil is @@ -58,9 +57,6 @@ package body Errutil is -- indicates if there are errors attached to the line, which forces -- listing on, even in the presence of pragma List (Off). - procedure Set_Msg_Insertion_Column; - -- Handle column number insertion (@ insertion character) - procedure Set_Msg_Text (Text : String; Flag : Source_Ptr); -- Add a sequence of characters to the current message. The characters may -- be one of the special insertion characters (see documentation in spec). @@ -495,6 +491,7 @@ package body Errutil is if Warnings_Detected >= Maximum_Messages then Set_Standard_Error; Write_Line ("maximum number of warnings detected"); + Warning_Mode := Suppress; end if; @@ -605,18 +602,6 @@ package body Errutil is Errors_Must_Be_Ignored := To; end Set_Ignore_Errors; - ------------------------------ - -- Set_Msg_Insertion_Column -- - ------------------------------ - - procedure Set_Msg_Insertion_Column is - begin - if RM_Column_Check then - Set_Msg_Str (" in column "); - Set_Msg_Int (Int (Error_Msg_Col) + 1); - end if; - end Set_Msg_Insertion_Column; - ------------------ -- Set_Msg_Text -- ------------------