diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-12-05 18:03:26 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-03 16:39:15 +0100 |
commit | 75da7a6bdc83d99b994c16764960ba0a7d18e135 (patch) | |
tree | 4e3b15a724b697293fb9a4c228c135a6bd830610 | |
parent | 2789e3610ee17c153ab9dc851a4e1ae64afc4103 (diff) | |
download | gcc-75da7a6bdc83d99b994c16764960ba0a7d18e135.zip gcc-75da7a6bdc83d99b994c16764960ba0a7d18e135.tar.gz gcc-75da7a6bdc83d99b994c16764960ba0a7d18e135.tar.bz2 |
ada: Rely on default parameter when making non-null nodes
When calling Make_Access_To_Object_Definition and Make_Parameter_Specification
we can rely on the default value of parameter Null_Exclusion_Present being
False. This makes code cleaner and consistent with relying on the default value
of other parameters of this routine.
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* exp_ch3.adb, exp_ch4.adb, exp_disp.adb, inline.adb: Remove explicit
actual parameter Null_Exclusion_Present equal False.
-rw-r--r-- | gcc/ada/exp_ch3.adb | 5 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 7 | ||||
-rw-r--r-- | gcc/ada/exp_disp.adb | 5 | ||||
-rw-r--r-- | gcc/ada/inline.adb | 9 |
4 files changed, 11 insertions, 15 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index ad292ee..9419d5d 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -2960,9 +2960,8 @@ package body Exp_Ch3 is Defining_Identifier => Acc_Type, Type_Definition => Make_Access_To_Object_Definition (Loc, - All_Present => True, - Null_Exclusion_Present => False, - Subtype_Indication => + All_Present => True, + Subtype_Indication => New_Occurrence_Of (Rec_Type, Loc))))); Set_Handled_Statement_Sequence (Body_Node, diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 81b2b73..18656ea 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -909,11 +909,10 @@ package body Exp_Ch4 is Defining_Identifier => Def_Id, Type_Definition => Make_Access_To_Object_Definition (Loc, - All_Present => True, - Null_Exclusion_Present => False, - Constant_Present => + All_Present => True, + Constant_Present => Is_Access_Constant (PtrT), - Subtype_Indication => + Subtype_Indication => New_Occurrence_Of (Etype (Exp), Loc)))); -- Inherit the allocation-related attributes from the original diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 906ddc4..f45c323 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -1525,9 +1525,8 @@ package body Exp_Disp is Defining_Identifier => Make_Temporary (Loc, 'T'), Type_Definition => Make_Access_To_Object_Definition (Loc, - All_Present => True, - Null_Exclusion_Present => False, - Subtype_Indication => + All_Present => True, + Subtype_Indication => New_Occurrence_Of (Desig_Typ, Loc))); Stats := New_List ( diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index a24b070..30d3b1b 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2431,12 +2431,11 @@ package body Inline is Append_To (Formals, Make_Parameter_Specification (Loc, - Defining_Identifier => + Defining_Identifier => Make_Defining_Identifier (Loc, Chars (Obj_Id)), - In_Present => False, - Out_Present => not Constant_Present (Obj_Decl), - Null_Exclusion_Present => False, - Parameter_Type => Typ_Def)); + In_Present => False, + Out_Present => not Constant_Present (Obj_Decl), + Parameter_Type => Typ_Def)); end Build_Return_Object_Formal; -------------------------------------- |