From: Ronan Desplanques Date: Mon, 17 Mar 2025 16:15:29 +0000 (+0100) Subject: ada: Factorize initialization of local variable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043596fa26b9bf0e03fa8c8ce4986eb8aa8218c3;p=thirdparty%2Fgcc.git ada: Factorize initialization of local variable gcc/ada/ChangeLog: * sem_ch3.adb (Process_Subtype): Factorize initialization of variable. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 1263d7004d9..0c262aa40f3 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -22555,7 +22555,7 @@ package body Sem_Ch3 is -- Local variables - P : Node_Id; + P : constant Node_Id := Parent (S); Def_Id : Entity_Id; Error_Node : Node_Id; Full_View_Id : Entity_Id; @@ -22579,7 +22579,6 @@ package body Sem_Ch3 is end if; Check_Incomplete (S); - P := Parent (S); if Excludes_Null then -- Create an Itype that is a duplicate of Entity (S) but with the @@ -22652,7 +22651,6 @@ package body Sem_Ch3 is Check_Incomplete (Subtype_Mark (S)); end if; - P := Parent (S); Subtype_Mark_Id := Entity (Subtype_Mark (S)); -- Explicit subtype declaration case