]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Rely on default parameter when making non-null nodes
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 5 Dec 2024 17:03:26 +0000 (18:03 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 3 Jan 2025 15:39:15 +0000 (16:39 +0100)
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.

gcc/ada/exp_ch3.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_disp.adb
gcc/ada/inline.adb

index ad292ee404ee1a26be4e479acbec0c692bcc053a..9419d5d2fac32ee0b438ee47fcf9681bd2f8167d 100644 (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,
index 81b2b734bbf0f9dcda0cab28d0bec9893dc28774..18656ea24fdbb4a202c51f9f1eeac63b29bc2200 100644 (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
index 906ddc4175c2dd98e690cfffa46c939af9b55573..f45c32356a9057d1653f8712ff483ee251527d1d 100644 (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 (
index a24b0704c916025b5bcb8f08adf51cf8943d3f0b..30d3b1bbf4d372ab2db206a3b0fc36f4f773e1cd 100644 (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;
 
       --------------------------------------