]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove useless global variable
authorRonan Desplanques <desplanques@adacore.com>
Wed, 5 Feb 2025 13:45:28 +0000 (14:45 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 5 Jun 2025 08:18:38 +0000 (10:18 +0200)
This patch removes a global variable that was made useless by a previous
change and mistakenly hadn't been removed then.

gcc/ada/ChangeLog:

* opt.ads: Remove useless variable.
* sem_ch9.adb (Analyze_Abort_Statement, Analyze_Accept_Alternative,
Analyze_Accept_Statement, Analyze_Asynchronous_Select,
Analyze_Conditional_Entry_Call, Analyze_Delay_Alternative,
Analyze_Delay_Relative, Analyze_Delay_Until, Analyze_Entry_Body,
Analyze_Entry_Body_Formal_Part, Analyze_Entry_Call_Alternative,
Analyze_Entry_Declaration, Analyze_Entry_Index_Specification,
Analyze_Protected_Body, Analyze_Protected_Definition,
Analyze_Protected_Type_Declaration, Analyze_Requeue,
Analyze_Selective_Accept, Analyze_Single_Protected_Declaration,
Analyze_Single_Task_Declaration, Analyze_Task_Body,
Analyze_Task_Definition, Analyze_Task_Type_Declaration,
Analyze_Terminate_Alternative, Analyze_Timed_Entry_Call,
Analyze_Triggering_Alternative): Remove useless assignments.

gcc/ada/opt.ads
gcc/ada/sem_ch9.adb

index 87ce3a1d4639dff045c9e6ec486b4b102aeb1325..cbe470105fd1817e2518918c2c1d1fc0f1b0fc9f 100644 (file)
@@ -1522,10 +1522,6 @@ package Opt is
    --  used for inconsistency error messages. A value of System_Location is
    --  used if the policy is set in package System.
 
-   Tasking_Used : Boolean := False;
-   --  Set True if any tasking construct is encountered. Used to activate the
-   --  output of the Q, L and T lines in ALI files.
-
    Time_Slice_Set : Boolean := False;
    --  GNATBIND
    --  Set True if a pragma Time_Slice is processed in the main unit, or
index 71394aa563ff4c5c87ee7595557d95aa8de2081d..031c49f0e362dec70354886e144b122bcd782c57 100644 (file)
@@ -753,8 +753,6 @@ package body Sem_Ch9 is
       T_Name : Node_Id;
 
    begin
-      Tasking_Used := True;
-
       T_Name := First (Names (N));
       while Present (T_Name) loop
          Analyze (T_Name);
@@ -790,8 +788,6 @@ package body Sem_Ch9 is
 
    procedure Analyze_Accept_Alternative (N : Node_Id) is
    begin
-      Tasking_Used := True;
-
       if Present (Pragmas_Before (N)) then
          Analyze_List (Pragmas_Before (N));
       end if;
@@ -823,8 +819,6 @@ package body Sem_Ch9 is
       Task_Nam  : Entity_Id := Empty;  -- initialize to prevent warning
 
    begin
-      Tasking_Used := True;
-
       --  Entry name is initialized to Any_Id. It should get reset to the
       --  matching entry entity. An error is signalled if it is not reset.
 
@@ -1064,7 +1058,6 @@ package body Sem_Ch9 is
       Trigger        : Node_Id;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (Max_Asynchronous_Select_Nesting, N);
       Check_Restriction (No_Select_Statements, N);
 
@@ -1109,7 +1102,6 @@ package body Sem_Ch9 is
       Is_Disp_Select : Boolean := False;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Select_Statements, N);
 
       --  Ada 2005 (AI-345): The trigger may be a dispatching call
@@ -1154,7 +1146,6 @@ package body Sem_Ch9 is
       Typ  : Entity_Id;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Delay, N);
 
       if Present (Pragmas_Before (N)) then
@@ -1206,7 +1197,6 @@ package body Sem_Ch9 is
       E : constant Node_Id := Expression (N);
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Relative_Delay, N);
       Check_Restriction (No_Delay, N);
       Check_Potentially_Blocking_Operation (N);
@@ -1231,7 +1221,6 @@ package body Sem_Ch9 is
       Typ : Entity_Id;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Delay, N);
       Check_Potentially_Blocking_Operation (N);
       Analyze_And_Resolve (E);
@@ -1266,8 +1255,6 @@ package body Sem_Ch9 is
 
       Freeze_Previous_Contracts (N);
 
-      Tasking_Used := True;
-
       --  Entry_Name is initialized to Any_Id. It should get reset to the
       --  matching entry entity. An error is signalled if it is not reset.
 
@@ -1518,8 +1505,6 @@ package body Sem_Ch9 is
       Formals : constant List_Id   := Parameter_Specifications (N);
 
    begin
-      Tasking_Used := True;
-
       if Present (Index) then
          Analyze (Index);
 
@@ -1545,8 +1530,6 @@ package body Sem_Ch9 is
       Call : constant Node_Id := Entry_Call_Statement (N);
 
    begin
-      Tasking_Used := True;
-
       if Present (Pragmas_Before (N)) then
          Analyze_List (Pragmas_Before (N));
       end if;
@@ -1589,8 +1572,6 @@ package body Sem_Ch9 is
    begin
       Generate_Definition (Def_Id);
 
-      Tasking_Used := True;
-
       --  Case of no discrete subtype definition
 
       if No (D_Sdef) then
@@ -1751,7 +1732,6 @@ package body Sem_Ch9 is
       Loop_Id : constant Entity_Id := Make_Temporary (Sloc (N), 'L');
 
    begin
-      Tasking_Used := True;
       Analyze (Def);
 
       --  There is no elaboration of the entry index specification. Therefore,
@@ -1848,7 +1828,6 @@ package body Sem_Ch9 is
 
       Freeze_Previous_Contracts (N);
 
-      Tasking_Used := True;
       Mutate_Ekind (Body_Id, E_Protected_Body);
       Set_Etype (Body_Id, Standard_Void_Type);
       Spec_Id := Find_Concurrent_Spec (Body_Id);
@@ -1991,7 +1970,6 @@ package body Sem_Ch9 is
    --  Start of processing for Analyze_Protected_Definition
 
    begin
-      Tasking_Used := True;
       Analyze_Declarations (Visible_Declarations (N));
 
       if not Is_Empty_List (Private_Declarations (N)) then
@@ -2047,7 +2025,6 @@ package body Sem_Ch9 is
          return;
       end if;
 
-      Tasking_Used := True;
       Check_Restriction (No_Protected_Types, N);
 
       T := Find_Type_Name (N);
@@ -2422,7 +2399,6 @@ package body Sem_Ch9 is
          Modes    => True,
          Warnings => True);
 
-      Tasking_Used := True;
       Check_Restriction (No_Requeue_Statements, N);
       Check_Unreachable_Code (N);
 
@@ -2754,7 +2730,6 @@ package body Sem_Ch9 is
       Alt_Count         : Uint    := Uint_0;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Select_Statements, N);
 
       --  Loop to analyze alternatives
@@ -2871,7 +2846,6 @@ package body Sem_Ch9 is
 
    begin
       Generate_Definition (Obj_Id);
-      Tasking_Used := True;
 
       --  A single protected declaration is transformed into a pair of an
       --  anonymous protected type and an object of that type. Generate:
@@ -2959,7 +2933,6 @@ package body Sem_Ch9 is
 
    begin
       Generate_Definition (Obj_Id);
-      Tasking_Used := True;
 
       --  A single task declaration is transformed into a pair of an anonymous
       --  task type and an object of that type. Generate:
@@ -3074,7 +3047,6 @@ package body Sem_Ch9 is
 
       Freeze_Previous_Contracts (N);
 
-      Tasking_Used := True;
       Set_Scope (Body_Id, Current_Scope);
       Mutate_Ekind (Body_Id, E_Task_Body);
       Set_Etype (Body_Id, Standard_Void_Type);
@@ -3219,8 +3191,6 @@ package body Sem_Ch9 is
       L : Entity_Id;
 
    begin
-      Tasking_Used := True;
-
       if Present (Visible_Declarations (N)) then
          Analyze_Declarations (Visible_Declarations (N));
       end if;
@@ -3265,8 +3235,6 @@ package body Sem_Ch9 is
 
       --  Proceed ahead with analysis of task type declaration
 
-      Tasking_Used := True;
-
       --  The sequential partition elaboration policy is supported only in the
       --  restricted profile.
 
@@ -3448,8 +3416,6 @@ package body Sem_Ch9 is
 
    procedure Analyze_Terminate_Alternative (N : Node_Id) is
    begin
-      Tasking_Used := True;
-
       if Present (Pragmas_Before (N)) then
          Analyze_List (Pragmas_Before (N));
       end if;
@@ -3469,7 +3435,6 @@ package body Sem_Ch9 is
       Is_Disp_Select : Boolean := False;
 
    begin
-      Tasking_Used := True;
       Check_Restriction (No_Select_Statements, N);
 
       --  Ada 2005 (AI-345): The trigger may be a dispatching call
@@ -3504,8 +3469,6 @@ package body Sem_Ch9 is
       Trigger : constant Node_Id := Triggering_Statement (N);
 
    begin
-      Tasking_Used := True;
-
       if Present (Pragmas_Before (N)) then
          Analyze_List (Pragmas_Before (N));
       end if;