]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Rely on default parameter when making non-constant nodes
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 5 Dec 2024 16:55:09 +0000 (17:55 +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_Object_Declaration we
can rely on the default value of parameter Constant_Present being False. This
makes code cleaner and consistent with relying on the default value of other
parameters of this routine, like Null_Exclusion_Present.

Code cleanup; semantics is unaffected.

gcc/ada/ChangeLog:

* exp_ch3.adb, exp_disp.adb: Remove explicit actual parameter
Constant_Present equal False; tune comments.

gcc/ada/exp_ch3.adb
gcc/ada/exp_disp.adb

index b69da39da36e260a28a23638ed408fd7f5d0170f..ad292ee404ee1a26be4e479acbec0c692bcc053a 100644 (file)
@@ -2962,7 +2962,6 @@ package body Exp_Ch3 is
                   Make_Access_To_Object_Definition (Loc,
                     All_Present            => True,
                     Null_Exclusion_Present => False,
-                    Constant_Present       => False,
                     Subtype_Indication     =>
                       New_Occurrence_Of (Rec_Type, Loc)))));
 
index 9fcc469448881b2a58c004020dfd5e4114856795..906ddc4175c2dd98e690cfffa46c939af9b55573 100644 (file)
@@ -1527,7 +1527,6 @@ package body Exp_Disp is
                   Make_Access_To_Object_Definition (Loc,
                     All_Present            => True,
                     Null_Exclusion_Present => False,
-                    Constant_Present       => False,
                     Subtype_Indication     =>
                       New_Occurrence_Of (Desig_Typ, Loc)));
 
@@ -1974,7 +1973,6 @@ package body Exp_Disp is
                   Make_Access_To_Object_Definition (Loc,
                     All_Present            => True,
                     Null_Exclusion_Present => False,
-                    Constant_Present       => False,
                     Subtype_Indication     =>
                       New_Occurrence_Of (Ftyp, Loc)));
 
@@ -4922,7 +4920,7 @@ package body Exp_Disp is
       if not Building_Static_DT (Typ) then
 
          --  Generate:
-         --    DT     : No_Dispatch_Table_Wrapper;
+         --    DT     : aliased No_Dispatch_Table_Wrapper;
          --    DT_Ptr : Tag := !Tag (DT.NDT_Prims_Ptr'Address);
 
          if not Has_DT (Typ) then
@@ -4930,7 +4928,6 @@ package body Exp_Disp is
               Make_Object_Declaration (Loc,
                 Defining_Identifier => DT,
                 Aliased_Present     => True,
-                Constant_Present    => False,
                 Object_Definition   =>
                   New_Occurrence_Of
                     (RTE (RE_No_Dispatch_Table_Wrapper), Loc)));
@@ -4973,7 +4970,7 @@ package body Exp_Disp is
             end if;
 
          --  Generate:
-         --    DT : Dispatch_Table_Wrapper (Nb_Prim);
+         --    DT : aliased Dispatch_Table_Wrapper (Nb_Prim);
          --    DT_Ptr : Tag := !Tag (DT.Prims_Ptr'Address);
 
          else
@@ -4992,7 +4989,6 @@ package body Exp_Disp is
               Make_Object_Declaration (Loc,
                 Defining_Identifier => DT,
                 Aliased_Present     => True,
-                Constant_Present    => False,
                 Object_Definition   =>
                   Make_Subtype_Indication (Loc,
                     Subtype_Mark =>