https://gcc.gnu.org/g:75da7a6bdc83d99b994c16764960ba0a7d18e135

commit r15-6544-g75da7a6bdc83d99b994c16764960ba0a7d18e135
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Thu Dec 5 18:03:26 2024 +0100

    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.

Diff:
---
 gcc/ada/exp_ch3.adb  | 5 ++---
 gcc/ada/exp_ch4.adb  | 7 +++----
 gcc/ada/exp_disp.adb | 5 ++---
 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 ad292ee404ee..9419d5d2fac3 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 81b2b734bbf0..18656ea24fdb 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 906ddc4175c2..f45c32356a90 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 a24b0704c916..30d3b1bbf4d3 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;
 
       --------------------------------------

Reply via email to