diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-12-05 17:55:09 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-03 16:39:15 +0100 |
commit | 2789e3610ee17c153ab9dc851a4e1ae64afc4103 (patch) | |
tree | 59e454148c32c3de528bfe23eea0e39dcb7f113e /gcc | |
parent | 5a843616379b1c02d6702ac6121c576bd05f4209 (diff) | |
download | gcc-2789e3610ee17c153ab9dc851a4e1ae64afc4103.zip gcc-2789e3610ee17c153ab9dc851a4e1ae64afc4103.tar.gz gcc-2789e3610ee17c153ab9dc851a4e1ae64afc4103.tar.bz2 |
ada: Rely on default parameter when making non-constant nodes
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_ch3.adb | 1 | ||||
-rw-r--r-- | gcc/ada/exp_disp.adb | 8 |
2 files changed, 2 insertions, 7 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index b69da39..ad292ee 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -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))))); diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 9fcc469..906ddc4 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -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 => |