]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove Current_Node from Errout
authorViljar Indus <indus@adacore.com>
Tue, 5 Nov 2024 08:42:55 +0000 (10:42 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 26 Nov 2024 09:49:35 +0000 (10:49 +0100)
This variable was used for Opt.Include_Subprogram_In_Messages
activated by -gnatdJ. This switch has been removed so this variable
is no longer used.

gcc/ada/ChangeLog:

* errout.ads: Remove Current_Node.
* errout.adb: Remove uses of Current_Node.
* par-ch6.adb: Same as above.
* par-ch7.adb: Same as above.
* par-ch9.adb: Same as above.

gcc/ada/errout.adb
gcc/ada/errout.ads
gcc/ada/par-ch6.adb
gcc/ada/par-ch7.adb
gcc/ada/par-ch9.adb

index 84958a743119c95b196bf7f9f1b6e5446783ac9e..7991f781e42399fc591c37f1371e31a102ca4f9e 100644 (file)
@@ -301,12 +301,12 @@ package body Errout is
 
    procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) is
    begin
-      Error_Msg (Msg, To_Span (Flag_Location), Current_Node);
+      Error_Msg (Msg, To_Span (Flag_Location), Empty);
    end Error_Msg;
 
    procedure Error_Msg (Msg : String; Flag_Span : Source_Span) is
    begin
-      Error_Msg (Msg, Flag_Span, Current_Node);
+      Error_Msg (Msg, Flag_Span, Empty);
    end Error_Msg;
 
    procedure Error_Msg
index 3c0c2cecf68d57b05ede9e78b502d1fa9cad13ab..38b979f61f0cc2a05a21115ea0c8998578ff2ef8 100644 (file)
@@ -48,10 +48,6 @@ package Errout is
    --  Source_Reference line, then this is initialized to No_Source_File, to
    --  force an initial reference to the real source file name.
 
-   Current_Node : Node_Id := Empty;
-   --  Used by Error_Msg as a default Node_Id.
-   --  Relevant only when Opt.Include_Subprogram_In_Messages is set.
-
    -----------------------------------
    -- Suppression of Error Messages --
    -----------------------------------
index c3cc57256164bd404150740d2d9bce3fe2b23ab8..4fe00220222887f39203c9c1e18035301ff06d6a 100644 (file)
@@ -344,7 +344,6 @@ package body Ch6 is
       end if;
 
       Scopes (Scope.Last).Labl := Name_Node;
-      Current_Node := Name_Node;
       Ignore (Tok_Colon);
 
       --  Deal with generic instantiation, the one case in which we do not
index c71e25770f35a39edde58746b2715c2b8b587911..2682df47c53ad3d2336a12f389d42f1b5152a0f1 100644 (file)
@@ -127,7 +127,6 @@ package body Ch7 is
          Scopes (Scope.Last).Sloc := Token_Ptr;
          Name_Node := P_Defining_Program_Unit_Name;
          Scopes (Scope.Last).Labl := Name_Node;
-         Current_Node := Name_Node;
 
          if Aspect_Specifications_Present then
             Aspect_Sloc := Token_Ptr;
@@ -173,7 +172,6 @@ package body Ch7 is
          Scopes (Scope.Last).Sloc := Token_Ptr;
          Name_Node := P_Defining_Program_Unit_Name;
          Scopes (Scope.Last).Labl := Name_Node;
-         Current_Node := Name_Node;
 
          --  Case of renaming declaration
 
index 4d07a3a1f1f5601512d85715ed54695646540d22..9f5273b3e37e5888bbbb70ad502e721dbe9f4738 100644 (file)
@@ -101,7 +101,6 @@ package body Ch9 is
          Scan; -- past BODY
          Name_Node := P_Defining_Identifier (C_Is);
          Scopes (Scope.Last).Labl := Name_Node;
-         Current_Node := Name_Node;
 
          if Token = Tok_Left_Paren then
             Error_Msg_SC ("discriminant part not allowed in task body");
@@ -167,7 +166,7 @@ package body Ch9 is
             Name_Node := P_Defining_Identifier;
             Set_Defining_Identifier (Task_Node, Name_Node);
             Scopes (Scope.Last).Labl := Name_Node;
-            Current_Node := Name_Node;
+
             Set_Discriminant_Specifications
               (Task_Node, P_Known_Discriminant_Part_Opt);
 
@@ -176,7 +175,6 @@ package body Ch9 is
             Name_Node := P_Defining_Identifier (C_Is);
             Set_Defining_Identifier (Task_Node, Name_Node);
             Scopes (Scope.Last).Labl := Name_Node;
-            Current_Node := Name_Node;
 
             if Token = Tok_Left_Paren then
                Error_Msg_SC ("discriminant part not allowed for single task");
@@ -442,7 +440,6 @@ package body Ch9 is
          Scan; -- past BODY
          Name_Node := P_Defining_Identifier (C_Is);
          Scopes (Scope.Last).Labl := Name_Node;
-         Current_Node := Name_Node;
 
          if Token = Tok_Left_Paren then
             Error_Msg_SC ("discriminant part not allowed in protected body");
@@ -497,7 +494,6 @@ package body Ch9 is
             Name_Node := P_Defining_Identifier (C_Is);
             Set_Defining_Identifier (Protected_Node, Name_Node);
             Scopes (Scope.Last).Labl := Name_Node;
-            Current_Node := Name_Node;
             Set_Discriminant_Specifications
               (Protected_Node, P_Known_Discriminant_Part_Opt);
 
@@ -514,7 +510,6 @@ package body Ch9 is
             end if;
 
             Scopes (Scope.Last).Labl := Name_Node;
-            Current_Node := Name_Node;
          end if;
 
          P_Aspect_Specifications (Protected_Node, Semicolon => False);
@@ -1066,7 +1061,6 @@ package body Ch9 is
       Accept_Node := New_Node (N_Accept_Statement, Token_Ptr);
       Scan; -- past ACCEPT
       Scopes (Scope.Last).Labl := Token_Node;
-      Current_Node := Token_Node;
 
       Set_Entry_Direct_Name (Accept_Node, P_Identifier (C_Do));
 
@@ -1215,7 +1209,6 @@ package body Ch9 is
       Name_Node := P_Defining_Identifier;
       Set_Defining_Identifier (Entry_Node, Name_Node);
       Scopes (Scope.Last).Labl := Name_Node;
-      Current_Node := Name_Node;
 
       Formal_Part_Node := P_Entry_Body_Formal_Part;
       Set_Entry_Body_Formal_Part (Entry_Node, Formal_Part_Node);