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.
This commit is contained in:
Piotr Trojanek 2024-12-05 18:03:26 +01:00 committed by Marc Poulhiès
parent 2789e3610e
commit 75da7a6bdc
4 changed files with 11 additions and 15 deletions

View file

@ -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,

View file

@ -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

View file

@ -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 (

View file

@ -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;
--------------------------------------