public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Remove repeated setting of Never_Set_In_Source
@ 2022-07-05  8:30 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-05  8:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

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.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

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

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 675 bytes --]

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-05  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05  8:30 [Ada] Remove repeated setting of Never_Set_In_Source Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).