]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove repeated setting of Never_Set_In_Source
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 8 Jun 2022 18:52:48 +0000 (20:52 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 5 Jul 2022 08:28:20 +0000 (08:28 +0000)
Formal parameters have their flag Never_Set_In_Source set at the
beginning of Process_Formals routine (regardless of the parameter mode).
There is no need to set it again when Process_Formals calls
Set_Formal_Mode (for parameters of mode IN OUT and OUT).

Code cleanup related to improved detection of uninitialised objects;
behaviour is unaffected.

gcc/ada/

* sem_ch6.adb (Set_Formal_Mode): Remove unnecessary setting of
Never_Set_In_Source.

gcc/ada/sem_ch6.adb

index 1efc8842db9e700d8e0067daf8dc4ab8d423c1f3..8334647028a6aad2f3b06fcd305c33c8728ee73d 100644 (file)
@@ -13298,10 +13298,9 @@ package body Sem_Ch6 is
             Mutate_Ekind (Formal_Id, E_In_Out_Parameter);
 
          else
-            Mutate_Ekind            (Formal_Id, E_Out_Parameter);
-            Set_Never_Set_In_Source (Formal_Id, True);
-            Set_Is_True_Constant    (Formal_Id, False);
-            Set_Current_Value       (Formal_Id, Empty);
+            Mutate_Ekind         (Formal_Id, E_Out_Parameter);
+            Set_Is_True_Constant (Formal_Id, False);
+            Set_Current_Value    (Formal_Id, Empty);
          end if;
 
       else