]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Remove a couple of unreachable statements
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 29 Dec 2022 19:19:36 +0000 (20:19 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 9 Jan 2023 14:42:23 +0000 (15:42 +0100)
The "then" arm of these nested if-statements is trivially unreachable.

gcc/ada/

* exp_ch7.adb (Make_Adjust_Call): Remove unreachable statement.
(Make_Final_Call): Likewise.

gcc/ada/exp_ch7.adb

index f29a97a0ceb6248708e78dee75c766d390befac1..86878616f6a63d06afd78e4f391c2589efd1a92c 100644 (file)
@@ -6043,11 +6043,7 @@ package body Exp_Ch7 is
       --  Derivations from [Limited_]Controlled
 
       elsif Is_Controlled (Utyp) then
-         if Has_Controlled_Component (Utyp) then
-            Adj_Id := Find_Optional_Prim_Op (Utyp, TSS_Deep_Adjust);
-         else
-            Adj_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Adjust_Case));
-         end if;
+         Adj_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Adjust_Case));
 
       --  Tagged types
 
@@ -8396,11 +8392,7 @@ package body Exp_Ch7 is
       --  Derivations from [Limited_]Controlled
 
       elsif Is_Controlled (Utyp) then
-         if Has_Controlled_Component (Utyp) then
-            Fin_Id := Find_Optional_Prim_Op (Utyp, TSS_Deep_Finalize);
-         else
-            Fin_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Finalize_Case));
-         end if;
+         Fin_Id := Find_Optional_Prim_Op (Utyp, Name_Of (Finalize_Case));
 
       --  Tagged types
 
This page took 0.074455 seconds and 5 git commands to generate.