]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove unused variables from the binder generation routine
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 22 May 2025 10:16:18 +0000 (12:16 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:44 +0000 (10:29 +0200)
Remove leftovers from zero cost exception handling; semantics is unaffected.

gcc/ada/ChangeLog:

* ali.ads (Unit_Record): Fix grammar in comment.
* bindgen.adb (Num_Elab_Calls, Num_Primary_Stacks): Remove counters
that were only incremented and never actually used.

gcc/ada/ali.ads
gcc/ada/bindgen.adb

index 2f90b88a7c6722c0fd884e94e99f2ed0099b7b16..da71c51e4ab9fcf4be7e588efd24617c59e8f178 100644 (file)
@@ -358,8 +358,8 @@ package ALI is
       --  Indicates presence of PR parameter for a preelaborated package
 
       No_Elab : Boolean;
-      --  Indicates presence of NE parameter for a unit that has does not
-      --  have an elaboration routine (since it has no elaboration code).
+      --  Indicates presence of NE parameter for a unit that does not have an
+      --  elaboration routine (since it has no elaboration code).
 
       Pure : Boolean;
       --  Indicates presence of PU parameter for a package having pragma Pure
index bc47ec12ab3af19d9c43266272f0b5735869db95..cb39af67f9a5dfdadeb986a5fe8de534e69c06c0 100644 (file)
@@ -53,13 +53,6 @@ package body Bindgen is
    --  Flag which indicates whether the program uses the GNARL library
    --  (presence of the unit System.OS_Interface)
 
-   Num_Elab_Calls : Nat := 0;
-   --  Number of generated calls to elaboration routines
-
-   Num_Primary_Stacks : Nat := 0;
-   --  Number of default-sized primary stacks the binder needs to allocate for
-   --  task objects declared in the program.
-
    Num_Sec_Stacks : Nat := 0;
    --  Number of default-sized primary stacks the binder needs to allocate for
    --  task objects declared in the program.
@@ -2483,16 +2476,6 @@ package body Bindgen is
          ALIs.Table (ALIs.First).Time_Slice_Value := Opt.Time_Slice_Value;
       end if;
 
-      --  Count number of elaboration calls
-
-      for E in Elab_Order'Range loop
-         if Units.Table (Elab_Order (E)).No_Elab then
-            null;
-         else
-            Num_Elab_Calls := Num_Elab_Calls + 1;
-         end if;
-      end loop;
-
       --  Count the number of statically allocated stacks to be generated by
       --  the binder. If the user has specified the number of default-sized
       --  secondary stacks, use that number. Otherwise start the count at one
@@ -2506,9 +2489,6 @@ package body Bindgen is
       end if;
 
       for J in Units.First .. Units.Last loop
-         Num_Primary_Stacks :=
-           Num_Primary_Stacks + Units.Table (J).Primary_Stack_Count;
-
          Num_Sec_Stacks :=
            Num_Sec_Stacks + Units.Table (J).Sec_Stack_Count;
       end loop;