diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-11-25 14:54:17 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-12-02 16:26:28 +0000 |
commit | e4b5ab01946554dabfc68090ae114182c96caf13 (patch) | |
tree | 825566e0e452d75819b661cea7f023d4ddb4dc8b | |
parent | ec9c3bd5d2d6d91a9967bf153ebf1411e6bb10c0 (diff) | |
download | gcc-e4b5ab01946554dabfc68090ae114182c96caf13.zip gcc-e4b5ab01946554dabfc68090ae114182c96caf13.tar.gz gcc-e4b5ab01946554dabfc68090ae114182c96caf13.tar.bz2 |
[Ada] Cleanup insertion of single freezing actions
gcc/ada/
* exp_util.adb (Append_Freeze_Action): Tune whitespace to make
the code look similar to Append_Freeze_Actions, which takes a
List_Id.
* sem_ch6.adb (Analyze_Return_Type): Cleanup with
Append_Freeze_Action.
* exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Likewise.
* sem_ch3.adb (Build_Access_Subprogram_Wrapper): Likewise.
* contracts.adb (Add_Indirect_Call_Wrapper): Remove extra call
to Ensure_Freeze_Node.
(Add_Call_Helper): Likewise.
* freeze.adb (Check_Inherited_Conditions): Likewise.
(Attribute_Renaming): Likewise.
* sem_ch8.adb: Likewise.
-rw-r--r-- | gcc/ada/contracts.adb | 2 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 3 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 1 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 1 |
7 files changed, 4 insertions, 13 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 2726486..98f469b 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -3761,7 +3761,6 @@ package body Contracts is ICW_Decl := Build_ICW_Decl; - Ensure_Freeze_Node (Tagged_Type); Append_Freeze_Action (Tagged_Type, ICW_Decl); Analyze (ICW_Decl); @@ -4034,7 +4033,6 @@ package body Contracts is -- Add the helper to the freezing actions of the tagged type - Ensure_Freeze_Node (Tagged_Type); Append_Freeze_Action (Tagged_Type, Helper_Decl); Analyze (Helper_Decl); diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 9a0bbb4..828f5a5 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -580,8 +580,7 @@ package body Exp_Ch3 is -- Place body in list of freeze actions for the type. - Ensure_Freeze_Node (Type_Id); - Append_Freeze_Actions (Type_Id, New_List (Body_Node)); + Append_Freeze_Action (Type_Id, Body_Node); end Build_Access_Subprogram_Wrapper_Body; --------------------------- diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 1bba059..0aa7937 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -458,7 +458,6 @@ package body Exp_Util is else Append (N, Actions (Fnode)); end if; - end Append_Freeze_Action; --------------------------- diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 6804c04..bd03ffa 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2044,9 +2044,8 @@ package body Freeze is -- node of the record type declaration to ensure that it will -- override the internal primitive built by Derive_Subprogram. - Ensure_Freeze_Node (R); - if Late_Overriding then + Ensure_Freeze_Node (R); Insert_Before_And_Analyze (Freeze_Node (R), DTW_Decl); else Append_Freeze_Action (R, DTW_Decl); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 02066e4..6b25a6a 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -6815,8 +6815,7 @@ package body Sem_Ch3 is -- in a dispatch table. if not GNATprove_Mode then - Ensure_Freeze_Node (Id); - Append_Freeze_Actions (Id, New_List (New_Decl)); + Append_Freeze_Action (Id, New_Decl); -- Under GNATprove mode there is no such problem but we do not declare -- it in the freezing actions since they are not analyzed under this diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 9c21732..fa4de4c 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2715,13 +2715,11 @@ package body Sem_Ch6 is end if; else - Ensure_Freeze_Node (Typ); - declare IR : constant Node_Id := Make_Itype_Reference (Sloc (N)); begin Set_Itype (IR, Etype (Designator)); - Append_Freeze_Actions (Typ, New_List (IR)); + Append_Freeze_Action (Typ, IR); end; end if; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index e3a4881..34f7ac1 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -4689,7 +4689,6 @@ package body Sem_Ch8 is if Is_Tagged_Type (Etype (P)) and then In_Open_Scopes (Scope (Etype (P))) then - Ensure_Freeze_Node (Etype (P)); Append_Freeze_Action (Etype (P), Body_Node); else Rewrite (N, Body_Node); |