diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-12-05 17:38:43 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-03 16:39:14 +0100 |
commit | 5a843616379b1c02d6702ac6121c576bd05f4209 (patch) | |
tree | 55e87a17924a09e057d357d42c5cd8d453def366 | |
parent | c20458a12d21a93f4ad5596f64545d6142a7d2dc (diff) | |
download | gcc-5a843616379b1c02d6702ac6121c576bd05f4209.zip gcc-5a843616379b1c02d6702ac6121c576bd05f4209.tar.gz gcc-5a843616379b1c02d6702ac6121c576bd05f4209.tar.bz2 |
ada: Rely on default parameter when making component definition nodes
When calling Make_Component_Definition we can rely on the default value of
parameter Aliased_Present being False. This makes code cleaner and consistent
with relying on the default value of other parameters of this routine, e.g.
Null_Exclusion_Present.
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* exp_ch3.adb, exp_ch9.adb, exp_dist.adb, exp_imgv.adb, exp_util.adb,
sem_dist.adb: Remove explicit actual parameter Aliased_Present equal
False; tune comments and whitespace.
-rw-r--r-- | gcc/ada/exp_ch3.adb | 3 | ||||
-rw-r--r-- | gcc/ada/exp_ch9.adb | 29 | ||||
-rw-r--r-- | gcc/ada/exp_dist.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_imgv.adb | 1 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sem_dist.adb | 3 |
6 files changed, 7 insertions, 36 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index a68b4f1..b69da39 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -5687,7 +5687,6 @@ package body Exp_Ch3 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Typ, Loc))), Expression => @@ -9318,7 +9317,6 @@ package body Exp_Ch3 is Defining_Identifier => Parent_N, Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Par_Subtype, Loc))); if Null_Present (Rec_Ext_Part) then @@ -9376,7 +9374,6 @@ package body Exp_Ch3 is Defining_Identifier => First_Tag_Component (T), Component_Definition => Make_Component_Definition (Sloc_N, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Tag), Sloc_N))); if Null_Present (Comp_List) diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index df51856..2e49a4a 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -1628,8 +1628,6 @@ package body Exp_Ch9 is Make_Defining_Identifier (Loc, Chars (Formal)), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => - False, Subtype_Indication => New_Occurrence_Of (Comp_Nam, Loc)))); @@ -4808,7 +4806,7 @@ package body Exp_Ch9 is Identifier => New_Occurrence_Of (Blkent, Loc), Declarations => New_List ( - -- _Chain : Activation_Chain; + -- _Chain : aliased Activation_Chain; Make_Object_Declaration (Loc, Defining_Identifier => Chain, @@ -4968,7 +4966,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Standard_Character, Loc)))); end; @@ -4984,7 +4981,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => @@ -5764,7 +5760,6 @@ package body Exp_Ch9 is Defining_Identifier => Make_Temporary (Loc, 'P'), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Address), Loc))), @@ -5772,7 +5767,6 @@ package body Exp_Ch9 is Defining_Identifier => Make_Temporary (Loc, 'S'), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (D_T2, Loc)))); Decl2 := @@ -8153,7 +8147,6 @@ package body Exp_Ch9 is Defining_Identifier => Component, Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Ctype, Loc)))); Next_Formal_With_Extras (Formal); @@ -9078,14 +9071,12 @@ package body Exp_Ch9 is if Present (Subtype_Indication (Old_Comp)) then New_Comp := Make_Component_Definition (Sloc (Oent), - Aliased_Present => False, Subtype_Indication => New_Copy_Tree (Subtype_Indication (Old_Comp), Discr_Map)); else New_Comp := Make_Component_Definition (Sloc (Oent), - Aliased_Present => False, Access_Definition => New_Copy_Tree (Access_Definition (Old_Comp), Discr_Map)); @@ -9252,7 +9243,7 @@ package body Exp_Ch9 is end; -- Put the _Object component after the private component so that it - -- be finalized early as required by 9.4 (20) + -- be finalized early as required by 9.4(20). Append_To (Cdecls, Object_Comp); end if; @@ -11824,9 +11815,9 @@ package body Exp_Ch9 is Defining_Identifier => Make_Defining_Identifier (Sloc (Tasktyp), Chars => New_External_Name (Tasknm, 'E')), - Aliased_Present => True, - Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc), - Expression => New_Occurrence_Of (Standard_False, Loc)); + Aliased_Present => True, + Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc), + Expression => New_Occurrence_Of (Standard_False, Loc)); Insert_After (N, Elab_Decl); @@ -11880,7 +11871,6 @@ package body Exp_Ch9 is Make_Defining_Identifier (Loc, Name_uTask_Id), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc)))); @@ -12076,7 +12066,6 @@ package body Exp_Ch9 is Make_Defining_Identifier (Loc, Name_uPriority), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Standard_Integer, Loc)))); end if; @@ -12086,12 +12075,11 @@ package body Exp_Ch9 is if Present (Taskdef) and then Has_Storage_Size_Pragma (Taskdef) then Append_To (Cdecls, Make_Component_Declaration (Loc, - Defining_Identifier => + Defining_Identifier => Make_Defining_Identifier (Loc, Name_uSize), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Size_Type), Loc)), @@ -12116,7 +12104,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Size_Type), Loc)))); end if; @@ -12131,7 +12118,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Task_Info_Type), Loc)), @@ -12152,7 +12138,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_CPU_Range), Loc)))); end if; @@ -12174,7 +12159,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Time_Span), Loc)), @@ -12203,7 +12187,6 @@ package body Exp_Ch9 is Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Dispatching_Domain_Access), Loc)))); diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index e8f9b68..e825837 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -2825,7 +2825,6 @@ package body Exp_Dist is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => NVList, - Aliased_Present => False, Object_Definition => New_Occurrence_Of (RTE (RE_NVList_Ref), Loc))); @@ -7251,7 +7250,6 @@ package body Exp_Dist is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Result, - Aliased_Present => False, Object_Definition => New_Occurrence_Of (RTE (RE_NamedValue), Loc), Expression => @@ -7378,7 +7376,6 @@ package body Exp_Dist is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Any, - Aliased_Present => False, Object_Definition => New_Occurrence_Of (RTE (RE_Any), Loc), Expression => Expr)); @@ -7449,7 +7446,6 @@ package body Exp_Dist is Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Extra_Any_Parameter, - Aliased_Present => False, Object_Definition => New_Occurrence_Of (RTE (RE_Any), Loc), Expression => diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb index 1a79fad..ad81712 100644 --- a/gcc/ada/exp_imgv.adb +++ b/gcc/ada/exp_imgv.adb @@ -157,7 +157,6 @@ package body Exp_Imgv is High_Bound => Make_Integer_Literal (Loc, UB))), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Ctyp, Loc))), Expression => Make_Aggregate (Loc, Expressions => V))); end Append_Table_To; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index b9a9b5f..a9424b9 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -10304,7 +10304,6 @@ package body Exp_Util is Make_Defining_Identifier (Loc, Name_uParent), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Constr_Root, Loc)))); Set_Reverse_Storage_Order @@ -10319,7 +10318,6 @@ package body Exp_Util is Make_Defining_Identifier (Loc, Name_uTag), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (RTE (RE_Tag), Loc)))); @@ -10331,7 +10329,6 @@ package body Exp_Util is Defining_Identifier => Make_Temporary (Loc, 'C'), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Str_Type, Loc)))); Append_To (List_Def, diff --git a/gcc/ada/sem_dist.adb b/gcc/ada/sem_dist.adb index fa5fa62..33882bb 100644 --- a/gcc/ada/sem_dist.adb +++ b/gcc/ada/sem_dist.adb @@ -649,8 +649,7 @@ package body Sem_Dist is Make_Defining_Identifier (Loc, Name_Ras), Component_Definition => Make_Component_Definition (Loc, - Aliased_Present => False, - Subtype_Indication => + Subtype_Indication => New_Occurrence_Of (RACW_Type, Loc))))))); Set_Equivalent_Type (User_Type, Fat_Type); |