From: Ronan Desplanques Date: Fri, 21 Mar 2025 15:49:20 +0000 (+0100) Subject: ada: Simplify Constrain_Array X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4dc5124872bc3d261fdc6d3f0f7e86976f495e5;p=thirdparty%2Fgcc.git ada: Simplify Constrain_Array Before this patch, Constrain_Array had a feature where it could be passed Empty for the first actual and would then create an Itype itself. There was only one use of this feature and it was unnecessary, so this patch removes it. gcc/ada/ChangeLog: * sem_ch3.adb (Constrain_Array): Simplify. (Process_Subtype): Adjust. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 823cc34e22b..45f7dc90aa4 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -382,7 +382,7 @@ package body Sem_Ch3 is -- created in the procedure and attached to Related_Nod. procedure Constrain_Array - (Def_Id : in out Entity_Id; + (Def_Id : Entity_Id; SI : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id; @@ -13980,7 +13980,7 @@ package body Sem_Ch3 is --------------------- procedure Constrain_Array - (Def_Id : in out Entity_Id; + (Def_Id : Entity_Id; SI : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id; @@ -14080,14 +14080,7 @@ package body Sem_Ch3 is end if; end if; - if No (Def_Id) then - Def_Id := - Create_Itype (E_Array_Subtype, Related_Nod, Related_Id, Suffix); - Set_Parent (Def_Id, Related_Nod); - - else - Mutate_Ekind (Def_Id, E_Array_Subtype); - end if; + Mutate_Ekind (Def_Id, E_Array_Subtype); Set_Size_Info (Def_Id, (T)); Set_First_Rep_Item (Def_Id, First_Rep_Item (T)); @@ -22664,8 +22657,7 @@ package body Sem_Ch3 is -- has not yet been called to create Def_Id. else - if Is_Array_Type (Subtype_Mark_Id) - or else Is_Concurrent_Type (Subtype_Mark_Id) + if Is_Concurrent_Type (Subtype_Mark_Id) or else Is_Access_Type (Subtype_Mark_Id) then Def_Id := Empty;