From: Justin Squirek Date: Mon, 6 Apr 2020 11:53:12 +0000 (-0400) Subject: [Ada] Minor refactoring X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0ffadd6eabef9a81d00c1f926aac929b0d94d92;p=gcc.git [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. --- 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;