From c0ffadd6eabef9a81d00c1f926aac929b0d94d92 Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Mon, 6 Apr 2020 07:53:12 -0400 Subject: [PATCH] [Ada] Minor refactoring gcc/ada/ * exp_attr.adb (Expand_Attribute): Set Stores_Attribute_Old_Prefix to generated renamings of 'Old constants for later use in generating finalization routines. * exp_ch7.adb (Build_Finalizer): Minor reformatting. Use "or else" operators. --- gcc/ada/exp_attr.adb | 2 ++ gcc/ada/exp_ch7.adb | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index f21ec9e9117..14ffe8ec42f 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -4706,6 +4706,8 @@ package body Exp_Attr is Name => Convert_To (Typ, New_Occurrence_Of (CW_Temp, Loc)))); + Set_Stores_Attribute_Old_Prefix (CW_Temp); + -- Non-tagged case else diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 6dfecac1f70..bd7a1e4bded 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1376,12 +1376,12 @@ package body Exp_Ch7 is --------------------- procedure Build_Finalizer - (N : Node_Id; - Clean_Stmts : List_Id; - Mark_Id : Entity_Id; - Top_Decls : List_Id; - Defer_Abort : Boolean; - Fin_Id : out Entity_Id) + (N : Node_Id; + Clean_Stmts : List_Id; + Mark_Id : Entity_Id; + Top_Decls : List_Id; + Defer_Abort : Boolean; + Fin_Id : out Entity_Id) is Acts_As_Clean : constant Boolean := Present (Mark_Id) @@ -2155,7 +2155,6 @@ package body Exp_Ch7 is Decl := Last_Non_Pragma (Decls); while Present (Decl) loop - -- Library-level tagged types if Nkind (Decl) = N_Full_Type_Declaration then @@ -3510,7 +3509,7 @@ package body Exp_Ch7 is -- Step 3: Finalizer creation - if Acts_As_Clean or Has_Ctrl_Objs or Has_Tagged_Types then + if Acts_As_Clean or else Has_Ctrl_Objs or else Has_Tagged_Types then Create_Finalizer; end if; end Build_Finalizer; -- 2.30.2