aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2024-11-12 12:32:05 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-26 10:49:35 +0100
commit9b33f74c84ef5681ccb735209d95479a5ece7377 (patch)
tree7d277c143137dc0a9ad25dbf9a56ee5e37940d7a /gcc
parent9fb54f47d0f5c149c94e86def16e538460ce3636 (diff)
downloadgcc-9b33f74c84ef5681ccb735209d95479a5ece7377.zip
gcc-9b33f74c84ef5681ccb735209d95479a5ece7377.tar.gz
gcc-9b33f74c84ef5681ccb735209d95479a5ece7377.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/errout.adb16
-rw-r--r--gcc/ada/erroutc.adb13
-rw-r--r--gcc/ada/erroutc.ads3
-rw-r--r--gcc/ada/errutil.adb17
4 files changed, 17 insertions, 32 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 8858df1..4070d92 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 9d22996..209159e 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 76cd020..0853bdb 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 1094e8a..0891d46 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 --
------------------